commit 3075a32e9c521343f45e0f2bf480cf08b7beed80
parent b4204d43008f60dfb5d3f4c8651ce62be4674c4a
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 28 Mar 2026 00:34:45 +0530
parent b4204d43008f60dfb5d3f4c8651ce62be4674c4a
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 28 Mar 2026 00:34:45 +0530
lynx: split windows settings into a separate file vim: add align function that can be be invoked by to get table mode vim: add .config/vim/unstaged.vim feature pfs/pfs.cmd: Remove hardcoded passtool vim: Remove buggy S-Insert paste, as the native one is working as expected vim: Update vim/plugins list vim: Update hyperred.vim theme nvim: Fix warning by not including hyperred.vim, it is now available as a colorscheme Carve scoop global install methods out of setup.cmd into gloabl_scoop.ps1 Fix setup.cmd
15 files changed, 158 insertions(+), 86 deletions(-)
diff --git a/.config/cmd/global_scoop.ps1 b/.config/cmd/global_scoop.ps1 @@ -0,0 +1,10 @@ +$scoopPath="C:\ProgramData\scoop" +$env:SCOOP_GLOBAL=$scoopPath +[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine') +$env:SCOOP=$scoopPath;[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'MACHINE') +iex "& {$(irm get.scoop.sh)} -RunAsAdmin" +$Reg='Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment' +$OldPath=(Get-ItemProperty -Path $Reg -Name PATH).Path;$NewPath=$OldPath+';'+$scoopPath+'\shims' +Set-ItemProperty -Path $Reg -Name PATH -Value $NewPath +$CurrentValue=[Environment]::GetEnvironmentVariable('PSModulePath','Machine') +[Environment]::SetEnvironmentVariable('PSModulePath', $CurrentValue + ';'+$scoopPath+'\modules', 'Machine')
diff --git a/.config/cmd/setup.cmd b/.config/cmd/setup.cmd @@ -46,24 +46,34 @@ goto :eof if "%~1" == "" ( call :set_var XDG_ROOT %USERPROFILE% + call :set_var SCOOP %SYSTEMROOT:~0,2%\ProgramData\scoop ) else ( - call :set_var XDG_ROOT "%~1" + call :set_var XDG_ROOT %~1 + call :set_var SCOOP %XDG_ROOT%\scoop ) +echo SCOOP is "%SCOOP%" + call :set_var XDG_CONFIG_HOME %XDG_ROOT%\.config call :set_var XDG_DATA_HOME %XDG_ROOT%\.local\share call :set_var XDG_CACHE_HOME %XDG_ROOT%\.cache -if "%SCOOP_DIR%"=="" set "SCOOP_DIR=%XDG_ROOT%\scoop" -if not exist "%SCOOP_DIR%\shims\scoop.cmd" ( +if not exist "%SCOOP%\apps\scoop\current\bin\scoop.ps1" ( rem Run this in powershell to install scoop and run this script again: rem Set-ExecutionPolicy RemoteSigned -scope CurrentUser rem echo powershell -Command "Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')" + rem TODO Autorun? Print the current settings like Mode: USER or Mode: Admin echo If you want to install scoop globally run the contents of - echo ^%XDG_ROOT^%\.config\cmd\global_scoop.ps1 + echo %XDG_ROOT%\.config\cmd\global_scoop.ps1 rem Install only the absolute essentials - rem scoop install 7zip clink dos2unix grep gpg lf make mingit mpv sed sudo unzip vim + rem TODO Fix global install apps like gpg and firefox, by making it use the XDG_ROOT + rem set base="7zip clink dos2unix grep make mingit mpv sed sudo unzip vim" + rem set full="%cmd% git-annex firefox" + rem TODO Use a parameter to mention this rather hardcoding this value + rem scoop install %full% + scoop config shim kiennq + goto :EOF ) @@ -75,12 +85,13 @@ call :set_var GPGHOME %XDG_DATA_HOME%\gnupg call :set_var PASSWORD_STORE_DIR %XDG_DATA_HOME%\pass call :set_var PASS_BASE_DIR %XDG_DATA_HOME%\pass -call :set_var LYNX_CFG %XDG_CONFIG_HOME%/lynx/lynx.cfg -call :set_var LYNX_LSS %XDG_CONFIG_HOME%/lynx/lynx.lss +call :set_var LYNX_CFG %XDG_CONFIG_HOME%\lynx\lynx.cfg +call :set_var LYNX_LSS %XDG_CONFIG_HOME%\lynx\lynx.lss call :set_var VIFM %XDG_CONFIG_HOME%\vifm -call :set_var FUZZER fzf +call :set_var FUZZER wlines +call :set_var ChocolateyToolsLocation %SYSTEMROOT:~0,2%\ProgramData\Tools rem Apply config patches rem TODO Use mklink instead of xcopy, it will prevent overriding changed files in the destination dir. @@ -90,7 +101,7 @@ if not exist "%SYSTEMDRIVE%\bin" ( mkdir %SYSTEMDRIVE%\bin ) if EXIST "%SCOOP%\apps\busybox\current\busybox.exe" ( copy "%SCOOP%\apps\busybox\current\busybox.exe" %SYSTEMDRIVE%\bin - copy "%SCOOP%\apps\scoop\current\supporting\shims\71\shim.exe" %SYSTEMDRIVE%\bin\sh.exe + copy "%SCOOP%\apps\scoop\current\supporting\shims\kiennq\shim.exe" %SYSTEMDRIVE%\bin\sh.exe call :update_shim C:\bin\sh.shim "C:\bin\busybox.exe" "sh -l" ) @@ -103,14 +114,12 @@ if EXIST %SCOOP%\apps\gpg\current\bin\gpgconf.ctl ( del %SCOOP%\apps\gpg\current\bin\gpgconf.ctl ) -call :add_path "%XDG_ROOT%\scoop\shims" +call :add_path "%SCOOP%\shims" rem Always use \\ infront of '.' (causes issue with findstr) call :add_path "%XDG_ROOT%\.local\bin\cmd" call :add_path "%SYSTEMDRIVE%\bin" call :add_path "%APPDATA%\Python\Python313\Scripts" -set CLINK_EXE="%XDG_ROOT%\scoop\shims\clink.exe" - if errorlevel 0 ( echo Setting up clink clink autorun set >nul
diff --git a/.config/git/config b/.config/git/config @@ -28,11 +28,12 @@ reso = remote set-url origin rev = remote --verbose sm = submodule - st = status + st = status -s -b suir = submodule update --init --recursive wt = worktree wta = worktree add ctags = !.git/hooks/ctags + summary = !git-summary [push] autoSetupRemote = true
diff --git a/.config/lynx/general.cfg b/.config/lynx/general.cfg @@ -0,0 +1,13 @@ +EXTERNAL_MENU:http:browser:open %s &:TRUE +# TODO use a common clipboard program +EXTERNAL_MENU:http:copy:echo %s | clip :TRUE +EXTERNAL_MENU:http:video:mpv %s 1>/dev/null & :TRUE +EXTERNAL_MENU:http:videodl:youtube-dl -q --no-warnings %s &:TRUE +EXTERNAL_MENU:http:songdl:songdl %s &:TRUE +EXTERNAL_MENU:http:wget:wget %s &:TRUE + +XLOADIMAGE_COMMAND:open %s & + +VIEWER:application/postscript:ghostview %s&:XWINDOWS +VIEWER:image/*:open %s&:XWINDOWS +VIEWER:video/*:open %s &:XWINDOWS
diff --git a/.config/lynx/lynx.cfg b/.config/lynx/lynx.cfg @@ -28,21 +28,14 @@ SOURCE_CACHE:MEMORY USE_EXTERNALS:TRUE DEFAULT_USER_MODE:ADVANCED -EXTERNAL_MENU:http:browser:open %s &:TRUE -# TODO use a common clipboard program -EXTERNAL_MENU:http:copy:printf %s | clip :TRUE -EXTERNAL_MENU:http:video:mpv %s 1>/dev/null & :TRUE -EXTERNAL_MENU:http:videodl:youtube-dl -q --no-warnings %s &:TRUE -EXTERNAL_MENU:http:songdl:songdl %s &:TRUE -EXTERNAL_MENU:http:wget:wget %s &:TRUE #KEYMAP:o:ECGOTO #KEYMAP:O:GOTO -XLOADIMAGE_COMMAND:open %s & +INCLUDE:windows.cfg -VIEWER:application/postscript:ghostview %s&:XWINDOWS -VIEWER:image/*:open %s&:XWINDOWS -VIEWER:video/*:open %s &:XWINDOWS MAKE_LINKS_FOR_ALL_IMAGES:TRUE MAKE_PSEUDO_ALTS_FOR_INLINES:TRUE VERBOSE_IMAGES:FALSE + +FORCE_SSL_PROMPT:yes +
diff --git a/.config/lynx/unix.cfg b/.config/lynx/unix.cfg @@ -0,0 +1,12 @@ +EXTERNAL_MENU:http:browser:open %s &:TRUE +EXTERNAL_MENU:http:copy:echo %s | clip :TRUE +EXTERNAL_MENU:http:video:mpv %s 1>/dev/null & :TRUE +EXTERNAL_MENU:http:videodl:youtube-dl -q --no-warnings %s &:TRUE +EXTERNAL_MENU:http:songdl:songdl %s &:TRUE +EXTERNAL_MENU:http:wget:wget %s &:TRUE + +XLOADIMAGE_COMMAND:open %s & + +VIEWER:application/postscript:ghostview %s&:XWINDOWS +VIEWER:image/*:open %s&:XWINDOWS +VIEWER:video/*:open %s &:XWINDOWS
diff --git a/.config/lynx/windows.cfg b/.config/lynx/windows.cfg @@ -0,0 +1,12 @@ +EXTERNAL_MENU:http:browser:o.cmd %s &:TRUE +EXTERNAL_MENU:http:copy:echo %s| clip:TRUE +EXTERNAL_MENU:http:video:mpv --quiet %s &:TRUE +EXTERNAL_MENU:http:videodl:youtube-dl -q --no-warnings %s &:TRUE +EXTERNAL_MENU:http:songdl:songdl %s &:TRUE +EXTERNAL_MENU:http:wget:wget %s &:TRUE + +XLOADIMAGE_COMMAND:o.cmd %s & + +VIEWER:application/postscript:ghostview %s&:XWINDOWS +VIEWER:image/*:o.cmd %s&:XWINDOWS +VIEWER:video/*:o.cmd %s &:XWINDOWS
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua @@ -28,7 +28,6 @@ g.netrw_banner = 0 g.netrw_liststyle = 3 vim.cmd([[ - source $XDG_DATA_HOME/vim/hyper-red.vim source $XDG_DATA_HOME/vim/plugin.vim ]])
diff --git a/.config/profile.cmd b/.config/profile.cmd @@ -1,23 +1,24 @@ @echo off -doskey n=cd $* -doskey g=git $* +doskey cat=type $* +doskey clear=cls +doskey d=curl -fLO $* +doskey dot=git --git-dir="%USERPROFILE%\.local\share\wt\dotfiles.git" $* doskey e=%EDITOR% $* +doskey g=git $* +doskey hb=sh %USERPROFILE%\.local\bin\sh\hb $* doskey l=vifm . doskey ls=dir /B $* doskey m=make $* +doskey n=cd $* +doskey open=start $* doskey pwd=cd doskey rm=del $* -doskey clear=cls -doskey cat=type $* -doskey open=start $* -doskey hb=sh %USERPROFILE%\.local\bin\sh\hb $* -doskey d=curl -fLO $* doskey x=7z x $* -doskey dot=git --git-dir="%USERPROFILE%\.dotfiles" --work-tree="%USERPROFILE%" $* - +doskey killall=taskkill /f /im $* set FM=vifm -IF /I x"%COMSPEC%"==x%CMDCMDLINE% (cd /D %USERPROFILE%) +rem FIXME Enabling this causes right click menus like "Open command prompt" not to work +rem IF /I x"%COMSPEC%"==x%CMDCMDLINE% (cd /D %USERPROFILE%) -if exist "%XDG_CONFIG_HOME%\cmd\userenv.cmd" @call %XDG_CONFIG_HOME%\cmd\userenv.cmd +if exist "%XDG_CONFIG_HOME%\cmd\unstaged.cmd" @call %XDG_CONFIG_HOME%\cmd\unstaged.cmd
diff --git a/.local/bin/cmd/pfs.cmd b/.local/bin/cmd/pfs.cmd @@ -15,7 +15,7 @@ if not exist "%PASSWORD_STORE_DIR%" ( exit /b 1 ) -for /f %%i in ('"gopass ls -f | %FUZZER%"') do ( +for /f %%i in ('"%PASSTOOL% ls -f | %FUZZER%"') do ( set selected_pass=%%i ) @@ -25,12 +25,12 @@ if "%selected_pass%" equ "" ( if "%1" equ "" ( if "%selected_pass:~0,5%" equ "totp/" ( - gopass otp -c %selected_pass% + %PASSTOOL% otp %selected_pass% ) else ( - gopass show -c %selected_pass% + %PASSTOOL% show %selected_pass% ) ) else ( - gopass %1 %selected_pass% + %PASSTOOL% %selected_pass% ) endlocal
diff --git a/.local/bin/sh/pfs b/.local/bin/sh/pfs @@ -5,7 +5,6 @@ : ${PASSWORD_STORE_DIR?"Error var not set"} cd "${PASSWORD_STORE_DIR}" || exit 1 -PASSTOOL=spm type ${PASSTOOL} 2>/dev/null || PASSTOOL=pass selection="$(find -L . -name '*.gpg' | sed 's/.gpg$//g' | ${FUZZER})"
diff --git a/.local/share/vim/keybindings.vim b/.local/share/vim/keybindings.vim @@ -109,8 +109,6 @@ nnoremap <A-j> :cnext<cr> nnoremap <leader>oc :grepadd /:: % nnoremap <leader>oh :grepadd /:: % -nnoremap <S-Insert> :set paste | :norm <C-R>+ - nnoremap <leader>fb :b * vnoremap <tab> >>
diff --git a/.local/share/vim/plugin.vim b/.local/share/vim/plugin.vim @@ -104,4 +104,14 @@ function ReverseDate() normal! dt/wwpldeBP endfunction +function! s:align() + let p = '^\s*|\s.*\s|\s*$' + if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) + let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) + let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) + Tabularize/|/l1 + normal! 0 + call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) + endif +endfunction
diff --git a/.local/share/vim/plugins b/.local/share/vim/plugins @@ -8,14 +8,27 @@ ldrumm/compiler-explorer.vim mbbill/undotree PreciousChicken/vim-groff-viewer Shougo/vimproc.vim -https://sr.ht/~ackyshake/VimCompletesMe.vim -yegappan/mru +taoso/mru.vim torrancew/vim-openscad axvr/zepl.vim -#dense-analysis/ale -prabirshrestha/vim-lsp -mattn/vim-lsp-settings +dense-analysis/ale +#prabirshrestha/vim-lsp +#mattn/vim-lsp-settings prabirshrestha/asyncomplete.vim +axvr/org.vim +img-paste-devs/img-paste.vim +kristijanhusak/vim-dadbod-ui +ledger/vim-ledger +#hsanson/vim-android +will133/vim-dirdiff +tpope/vim-sleuth +travisjeffery/vim-auto-mkdir +https://sr.ht/~ackyshake/VimCompletesMe.vim +jceb/vim-orgmode +tpope/vim-speeddating +padde/jump.vim +#tomtom/tlib_vim +#tomtom/ttodo_vim [opt] tpope/vim-obsession @@ -33,7 +46,6 @@ mhinz/vim-signify junegunn/gv.vim vifm/vifm.vim ctrlpvim/ctrlp.vim -axvr/org.vim rhysd/conflict-marker.vim jpalardy/vim-slime junegunn/goyo.vim
diff --git a/.vimrc b/.vimrc @@ -1,9 +1,23 @@ let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─'] let g:ale_floating_window_border = repeat([''], 8) -let g:ale_c_parse_makefile = 1 -let g:ale_c_always_make = 1 let g:ale_completion_enabled = 1 -let g:ale_fixers = { 'c': 'astyle' } +let g:ale_fixers = { 'c': [ 'astyle'] } +let g:ale_linters = { 'javascript': ['quicklintjs'] } +let g:ale_lint_on_enter = 1 +let g:ale_disable_lsp = 0 + +let g:ale_lint_delay = 0 +let g:ale_lint_on_text_changed = 'always' +if exists('#ALEEvents') + call ale#events#Init() +endif + +"let g:lsp_use_native_client = 1 +"let g:lsp_diagnostics_virtual_text_enabled = 0 +"let g:lsp_diagnostics_enabled = 1 +"let g:lsp_diagnostics_echo_cursor = 1 + + " Handle missing XDG_s gracefully if !exists("$XDG_HOME") let $XDG_HOME = has("win32") ? expand("$USERPROFILE") : expand("$HOME") @@ -17,10 +31,6 @@ if has("&viminfofile") | set viminfofile=$XDG_CACHE_HOME/vim/viminfo | endif set rtp+=$XDG_DATA_HOME/vim -set termguicolors -set background=dark -colorscheme hyperred - filetype plugin indent on syntax on @@ -73,7 +83,6 @@ set nospell let g:netrw_banner = 0 let g:netrw_liststyle = 3 let g:netrw_fastbrowse= 2 -let g:netrw_dirhistmax = 0 let g:netrw_preview = 1 let g:netrw_winsize = 30 @@ -115,7 +124,7 @@ function! FZYFiles() abort endtry endfunction -set synmaxcol=128 +set synmaxcol=1000 let g:netrw_home = $XDG_DATA_HOME . "/vim" call mkdir($XDG_DATA_HOME . "/vim/spell", 'p') @@ -137,11 +146,10 @@ function! s:load_plugins(t) abort packadd conflict-marker.vim packadd mru - call s:plugin_post_conf() + call s:plugin_post_load() endfunction - -func! s:plugin_post_conf() +func! s:plugin_post_load() let g:ctrlp_by_filename = 1 let g:ctrlp_reuse_window = 'netrw\|help\|quickfix' @@ -196,6 +204,10 @@ if has("gui") nnoremap <c-z> :term<cr><c-w>o inoremap <c-z> :term<cr><c-w>o tnoremap <c-z> <c-w>:hide edit #<cr> +else + set termguicolors + set background=dark + colorscheme hyperred endif set shellslash @@ -208,37 +220,28 @@ if has("win32") aug END " shellxquote must be a literal space character. set shellxquote= + set guicursor=a:blinkon0 else set shell=sh endif -let g:table_mode_toggle_map = 'mm' -let g:table_mode_corner='|' - if !exists('g:undotree_WindowLayout') let g:undotree_WindowLayout = 4 let g:undotree_ShortIndicators = 1 endif -"let g:lsc_server_commands = { -" \ 'c': { -" \ 'command': 'clangd', -" \ }, -" \} -"let g:lsc_auto_map = { -" \ 'GoToDefinition': '<C-]>', -" \ 'GoToDefinitionSplit': ['<C-W>]', '<C-W><C-]>'], -" \ 'FindReferences': 'gr', -" \ 'FindImplementations': 'gI', -" \ 'FindCodeActions': 'ga', -" \ 'Rename': 'gR', -" \ 'ShowHover': v:true, -" \ 'DocumentSymbol': 'go', -" \ 'WorkspaceSymbol': 'gS', -" \ 'SignatureHelp': 'gm', -" \ 'Completion': 'completefunc', -" \} -"let g:lsc_enable_autocomplete = v:true -"let g:lsc_enable_diagnostics = v:true -"let g:lsc_reference_highlights = v:false -"let g:lsc_trace_level = 'off' +if &term =~ 'xterm' || &term == 'win32' + " Use DECSCUSR escape sequences + let &t_SI = "\e[6 q" " blink bar + let &t_SR = "\e[4 q" " blink underline + let &t_EI = "\e[2 q" " blink block + let &t_ti ..= "\e[2 q" " blink block + let &t_te .= "\e[0 q" " default (depends on terminal, normally blink block) +endif + +let g:autojump_executable='autojump' +let g:autojum_vim_command='j' + +if filereadable("$XDG_DATA_HOME/.config/vim/unstaged.vim") + source "$XDG_DATA_HOME/.config/vim/unstaged.vim" +endif
: bharatvaj/dotfiles