: bharatvaj/dotfiles

Cross platform dotfiles for linux, mac and windows

commit b4204d43008f60dfb5d3f4c8651ce62be4674c4a
parent 4a725db6e1469198dde622f64497b8acd7a7786a
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Tue, 30 Sep 2025 20:26:09 +0530

sh/cmd: Add alias dot for managing dots

vim: Remove lsc in favour of ale

vim: Add shellshlash with exception for cmd and powershell

vim: Add "alt" keybindings for vim in general and in Windows

vim: Setup repl in vim
7 files changed, 102 insertions(+), 47 deletions(-)
M
.config/cmd/setup.cmd
|
3
++-
M
.config/profile.cmd
|
1
+
M
.config/sh/aliases
|
1
+
M
.local/share/vim/ftplugin/c.vim
|
1
+
M
.local/share/vim/keybindings.vim
|
15
++++++++++++++-
M
.local/share/vim/plugins
|
74
+++++++++++++++++++++++++++++++++++++++++++++++---------------------------
M
.vimrc
|
54
++++++++++++++++++++++++++++++++++++------------------
diff --git a/.config/cmd/setup.cmd b/.config/cmd/setup.cmd
@@ -105,8 +105,9 @@ if EXIST %SCOOP%\apps\gpg\current\bin\gpgconf.ctl (
 
 call :add_path "%XDG_ROOT%\scoop\shims"
 rem Always use \\ infront of '.' (causes issue with findstr)
-call :add_path "%XDG_ROOT%\\.local\bin\cmd"
+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"
 
diff --git a/.config/profile.cmd b/.config/profile.cmd
@@ -14,6 +14,7 @@ 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%" $*
 
 set FM=vifm
 
diff --git a/.config/sh/aliases b/.config/sh/aliases
@@ -58,3 +58,4 @@ alias fy='fzf | clip'
 alias o='xdg-open'
 
 alias voom='VIM_DIR=$XDG_DATA_HOME/vim voom'
+alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
diff --git a/.local/share/vim/ftplugin/c.vim b/.local/share/vim/ftplugin/c.vim
@@ -1,5 +1,6 @@
 iabbrev main@ int main(int argc, char* argv[]) {<cr><cr>}<up>
 iabbrev f@ <esc>bvedivoid <C-o>P() {<cr><cr>}<up>
+iabbrev fi@ <esc>bvediint <C-o>P() {<cr><cr>}<up>
 iabbrev p@ printf("\n");<esc>4hi
 iabbrev r@ return;<left>
 iabbrev i@ #include <><left>
diff --git a/.local/share/vim/keybindings.vim b/.local/share/vim/keybindings.vim
@@ -94,14 +94,27 @@ nnoremap <c-x><c-s> :w<cr>
 
 " Behave vim
 nnoremap Y y$
-nnoremap Q :noh<cr>
+nmap Q gzip
+
+if has("win32")
+    " TODO Check if alt is allowed along with win32 check?
+    nnoremap ë :cprev<cr>
+    nnoremap ê :cnext<cr>
+endif
+
+nnoremap <A-k> :cprev<cr>
+nnoremap <A-j> :cnext<cr>
 
 " development
 nnoremap <leader>oc :grepadd /:: %
 nnoremap <leader>oh :grepadd /:: %
 
+nnoremap <S-Insert> :set paste | :norm <C-R>+
+
 nnoremap <leader>fb :b *
 
+vnoremap <tab> >>
+
 " TODO reflect on whether <leader><leader> is productive, I keep hitting it
 " accidentally
 "nnoremap <leader><leader> :Rg<cr>
diff --git a/.local/share/vim/plugins b/.local/share/vim/plugins
@@ -1,35 +1,44 @@
+907th/vim-auto-save
+AndrewRadev/tagalong.vim
+chrisbra/csv.vim
+dhruvasagar/vim-table-mode
+epheien/termdbg
+hattya/vcvars.vim
+ldrumm/compiler-explorer.vim
+mbbill/undotree
+PreciousChicken/vim-groff-viewer
+Shougo/vimproc.vim
+https://sr.ht/~ackyshake/VimCompletesMe.vim
+yegappan/mru
+torrancew/vim-openscad
+axvr/zepl.vim
+#dense-analysis/ale
+prabirshrestha/vim-lsp
+mattn/vim-lsp-settings
+prabirshrestha/asyncomplete.vim
+
+[opt]
+tpope/vim-obsession
 tpope/vim-commentary
+tpope/vim-dadbod
 tpope/vim-dispatch
 tpope/vim-fugitive
+tpope/vim-projectionist
+tpope/vim-repeat
 tpope/vim-surround
 tpope/vim-unimpaired
-tpope/vim-repeat
-tpope/vim-projectionist
-junegunn/goyo.vim
-AndrewRadev/tagalong.vim
-jpalardy/vim-slime
-Shougo/vimproc.vim
-yuratomo/dbg.vim
-PreciousChicken/vim-groff-viewer
-hattya/vcvars.vim
-mbbill/undotree
-chrisbra/csv.vim
-ldrumm/compiler-explorer.vim
 vim-scripts/todo-txt.vim
-yegappan/mru
-907th/vim-auto-save
+yuratomo/dbg.vim
+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
+ap/vim-css-color
 
-#yegappan/searchcomplete
-# https://git.sr.ht/~torresjrjr/birck.vim
-# mfussenegger/nvim-dap
-# neovim/nvim-lspconfig
-# preservim/tagbar
-# puremourning/vimspector
-# rcarriga/nvim-dap-ui
-# terrortylor/nvim-comment
-# xolox/vim-easytags
-# xolox/vim-misc
-#ap/vim-css-color
 #Bestoa/SearchComplete
 #bfrg/vim-fzy
 #cfdrake/vim-pbxproj

@@ -38,19 +47,30 @@ yegappan/mru
 #evansalter/vim-checklist
 #ferranpm/vim-maildir
 #gfontenot/vim-xcode
+#https://git.sr.ht/~ackyshake/VimCompletesMe.vim
+#https://git.sr.ht/~torresjrjr/birck.vim
 #https://github.com/bfrg/vim-jqplay
 #jerrymarino/xcodebuild.vim
 #joereynolds/vim-minisnip/
 #kana/vim-submode
 #keith/swift.vim
+#mfussenegger/nvim-dap
 #nachumk/systemverilog.vim
+#neovim/nvim-lspconfig
 #notmuch-vim/notmuch-vim
 #ntpeters/vim-better-whitespace.git
 #omniSharp/omnisharp-vim
+#preservim/tagbar
+#puremourning/vimspector
 #radenling/vim-dispatch-neovim
+#rcarriga/nvim-dap-ui
+#terrortylor/nvim-comment
 #tommcdo/vim-ninja-feet.git
-#torrancew/vim-openscad
+#tpope/vim-vinegar
 #vim-scripts/gitignore
 #vim-scripts/SearchComplete
 #vim-scripts/vimacs
-#https://git.sr.ht/~ackyshake/VimCompletesMe.vim
+#xolox/vim-easytags
+#xolox/vim-misc
+#yegappan/searchcomplete
+# psliwka/vim-smoothie # smooth scrolling for vim, it is good, but I personally don't need smooth scrolling
diff --git a/.vimrc b/.vimrc
@@ -1,3 +1,9 @@
+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' }
 " Handle missing XDG_s gracefully
 if !exists("$XDG_HOME")
     let $XDG_HOME = has("win32") ? expand("$USERPROFILE") : expand("$HOME")

@@ -11,6 +17,7 @@ if has("&viminfofile") | set viminfofile=$XDG_CACHE_HOME/vim/viminfo | endif
 
 set rtp+=$XDG_DATA_HOME/vim
 
+set termguicolors
 set background=dark
 colorscheme hyperred
 

@@ -32,6 +39,7 @@ set nocompatible
 set noexpandtab
 set nofixendofline
 set shortmess=Iat
+if has("signs") | set signcolumn=yes | endif
 
 " Turn backup off
 "set nobackup

@@ -152,6 +160,7 @@ func! s:plugin_post_conf()
         let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
     endif
 
+
     packadd termdebug
     let g:termdebug_wide=163
 

@@ -168,24 +177,6 @@ func! s:plugin_post_conf()
         endif
     endif
 
-    let g:lsc_server_commands = {'cpp': 'clangd --log=error'}
-    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'
 endfunc
 
 aug user_cmds

@@ -207,9 +198,14 @@ if has("gui")
     tnoremap <c-z> <c-w>:hide edit #<cr>
 endif
 
+set shellslash
+
 if has("win32")
 	set shell=cmd
 	set shellquote=\" 
+    aug scriptingshellslash
+        au FileType dosbatch,ps1 set noshellslash
+    aug END
 	" shellxquote must be a literal space character.
 	set shellxquote=  
 else

@@ -224,3 +220,25 @@ if !exists('g:undotree_WindowLayout')
 	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'