dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit ce42a23e7f971d16f7f89110799ff69454382ce5
parent 05f41e6feda9e6d6d70f9a804f24b3f10b00d5e6
Author: bharatvaj.ph <bharatvaj.ph@zohocorp.com>
Date:   Mon, 25 Apr 2022 23:50:31 +0530

Optimize vim startup time from 2s to ~0.07 seconds

- Lazy load vim plugins after starting vim, only very important plugins
such as editorconfig-vim, vim-unimpaired, etc are run at startup.
- Add '<leader>ec' for editing vim files quickly.
- Remap '<leader>bb' to :Make (vim-dispatch)

Add .config/alacritty/windows.yml
- This import is always done because alacritty doesn't provide a way to
  check it.

IMPORTANT
---------
Use 'cmd' as the default shell for windows along with clink. Much
better workflow when compared with powershell - so slow man.

- Add .config/cmd/profile.cmd
- Add .config/cmd/aliases.cmd
- Add .config/cmd/setup.ps1
- Add .config/cmd/packages.txt

Diffstat:
M.config/.gitignore | 2++
M.config/alacritty/alacritty.yml | 8++++++--
A.config/alacritty/windows.yml | 3+++
A.config/cmd/aliases.cmd | 5+++++
A.config/cmd/packages.txt | 16++++++++++++++++
A.config/cmd/profile.cmd | 12++++++++++++
A.config/cmd/setup.ps1 | 7+++++++
M.config/vim/keybindings/keybindings.vim | 3++-
M.config/vim/vimrc | 21+++++++++++++--------
M.gitignore | 3++-
M.gitmodules | 72++++++++++++++++++++++++++++++++++++------------------------------------
A.local/share/vim/pack/development/opt/emmet-vim | 1+
A.local/share/vim/pack/development/opt/rust.vim | 1+
A.local/share/vim/pack/development/opt/vim-cmake | 1+
A.local/share/vim/pack/development/opt/vim-msbuild | 1+
D.local/share/vim/pack/development/start/rust.vim | 1-
D.local/share/vim/pack/development/start/vim-cmake | 1-
D.local/share/vim/pack/development/start/vim-msbuild | 1-
A.local/share/vim/pack/general/opt/editorconfig-vim | 1+
A.local/share/vim/pack/general/opt/vim-better-whitespace | 1+
A.local/share/vim/pack/general/opt/vim-codepainter | 1+
A.local/share/vim/pack/general/opt/vim-commentary | 1+
A.local/share/vim/pack/general/opt/vim-easymotion | 1+
A.local/share/vim/pack/general/opt/vim-fugitive | 1+
A.local/share/vim/pack/general/opt/vim-ninja-feet | 1+
A.local/share/vim/pack/general/opt/vim-surround | 1+
A.local/share/vim/pack/general/opt/vim-textobj-user | 1+
A.local/share/vim/pack/general/opt/vim-textobj-xmlattr | 1+
D.local/share/vim/pack/general/start/editorconfig-vim | 1-
D.local/share/vim/pack/general/start/vim-better-whitespace | 1-
D.local/share/vim/pack/general/start/vim-codepainter | 1-
D.local/share/vim/pack/general/start/vim-commentary | 1-
D.local/share/vim/pack/general/start/vim-easymotion | 1-
D.local/share/vim/pack/general/start/vim-fugitive | 1-
D.local/share/vim/pack/general/start/vim-ninja-feet | 1-
D.local/share/vim/pack/general/start/vim-surround | 1-
D.local/share/vim/pack/general/start/vim-textobj-user | 1-
D.local/share/vim/pack/general/start/vim-textobj-xmlattr | 1-
38 files changed, 118 insertions(+), 61 deletions(-)

diff --git a/.config/.gitignore b/.config/.gitignore @@ -7,6 +7,8 @@ !alacritty/** !bash/ !bash/** +!cmd/ +!cmd/** !git/ !git/config !i3 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml @@ -4,8 +4,12 @@ mouse: import: - ~/.config/alacritty/theme.yml - ~/.config/alacritty/font.yml + - ~/.config/alacritty/windows.yml live_config_reload: true -shell: - program: cmd +bell: + command: None + +selection: + save_to_clipboard: true diff --git a/.config/alacritty/windows.yml b/.config/alacritty/windows.yml @@ -0,0 +1,3 @@ +shell: + program: cmd + diff --git a/.config/cmd/aliases.cmd b/.config/cmd/aliases.cmd @@ -0,0 +1,5 @@ +doskey v=vim $* +doskey vi=vim $* +doskey n=nvim $* +doskey g=git $* +doskey l=%USERPROFILE%\.config\cmd\lfcd.cmd diff --git a/.config/cmd/packages.txt b/.config/cmd/packages.txt @@ -0,0 +1,16 @@ +7zip +clink +dos2unix +gpg +grep +lf +lynx +make +mingit +mpv +sed +sudo +unzip +uutils +vim +wget diff --git a/.config/cmd/profile.cmd b/.config/cmd/profile.cmd @@ -0,0 +1,12 @@ +@echo off + +cd %USERPROFILE% +prompt $P ∆ + +set VISUAL=vim +set EDITOR=%VISUAL% +set XDG_CONFIG_HOME=%USERPROFILE%\.config +set XDG_DATA_HOME=%USERPROFILE%\.local\share +set XDG_CACHE_HOME=%USERPROFILE%\.cache + +%USERPROFILE%\.config\cmd\aliases.cmd diff --git a/.config/cmd/setup.ps1 b/.config/cmd/setup.ps1 @@ -0,0 +1,7 @@ +Set-ExecutionPolicy RemoteSigned -scope CurrentUser + +# TODO Handle Admin user check +Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') + +# Install the absolute essentials +scoop install $(gc ~/.config/cmd/packages.txt) diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim @@ -6,6 +6,7 @@ nnoremap <Leader>l :ls<CR>:b<space> nmap <leader>F :GFiles<cr> nnoremap <leader>co :copen<cr> nnoremap <leader>g :grep +nnoremap <leader>ec :edit ~/.config/vim/vimrc<cr> nnoremap Y y$ fun! SetupCommandAlias(from, to) @@ -36,7 +37,7 @@ nnoremap <leader>ww :w<cr> nnoremap <leader>qq :q<cr> " Run Make -nnoremap <leader>bb :make<CR> +nnoremap <leader>bb :Make<CR> " Generate ctags map <leader>c :!ctags -R -f ./.git/tags .<CR> diff --git a/.config/vim/vimrc b/.config/vim/vimrc @@ -50,10 +50,10 @@ source $XDG_CONFIG_HOME/vim/plugin/plugin.vim " Keybindings source $XDG_CONFIG_HOME/vim/keybindings/keybindings.vim +set packpath^=$XDG_DATA_HOME\vim function! s:load_plugins(t) abort " Use XDG Paths for vim - set packpath^=$XDG_DATA_HOME/vim syntax on set synmaxcol=128 " TODO compile hard constants somewhere based on OS @@ -61,15 +61,20 @@ function! s:load_plugins(t) abort set runtimepath+='$XDG_DATA_HOME/vim' set runtimepath+='$XDG_CONFIG_HOME/vim/after' - let g:netrw_home = $XDG_DATA_HOME . "/vim" - " call mkdir($XDG_DATA_HOME . "/vim/spell", 'p') - " set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') - - " set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') - " set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') - " set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') + call mkdir($XDG_DATA_HOME . "/vim/spell", 'p') + set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') + + set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') + set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') + set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') + packadd vim-tmux-navigator + packadd editorconfig-vim + packadd vim-commentary packadd vim-surround + packadd vim-ninja-feet + packadd vim-fugitive + packadd vim-better-whitespace endfunction augroup user_cmds diff --git a/.gitignore b/.gitignore @@ -19,4 +19,5 @@ !.local/bin/ !.local/bin/* -!.local/share/vim/pack/**/start/** +# !.local/share/vim/pack/**/start/** +# !.local/share/vim/pack/**/opt/** diff --git a/.gitmodules b/.gitmodules @@ -1,54 +1,54 @@ -[submodule ".local/share/vim/pack/development/start/rust.vim"] - path = .local/share/vim/pack/development/start/rust.vim +[submodule ".local/share/vim/pack/development/opt/rust.vim"] + path = .local/share/vim/pack/development/opt/rust.vim url = https://git::@github.com/rust-lang/rust.vim.git -[submodule ".local/share/vim/pack/development/start/vim-cmake"] - path = .local/share/vim/pack/development/start/vim-cmake +[submodule ".local/share/vim/pack/development/opt/vim-cmake"] + path = .local/share/vim/pack/development/opt/vim-cmake url = https://git::@github.com/cdelledonne/vim-cmake.git -[submodule ".local/share/vim/pack/development/start/vim-msbuild"] - path = .local/share/vim/pack/development/start/vim-msbuild +[submodule ".local/share/vim/pack/development/opt/vim-msbuild"] + path = .local/share/vim/pack/development/opt/vim-msbuild url = https://git::@github.com/heaths/vim-msbuild.git -[submodule ".local/share/vim/pack/general/start/editorconfig-vim"] - path = .local/share/vim/pack/general/start/editorconfig-vim +[submodule ".local/share/vim/pack/general/opt/editorconfig-vim"] + path = .local/share/vim/pack/general/opt/editorconfig-vim url = https://git::@github.com/editorconfig/editorconfig-vim.git -[submodule ".local/share/vim/pack/general/start/vim-better-whitespace"] - path = .local/share/vim/pack/general/start/vim-better-whitespace +[submodule ".local/share/vim/pack/general/opt/vim-better-whitespace"] + path = .local/share/vim/pack/general/opt/vim-better-whitespace url = https://git::@github.com/ntpeters/vim-better-whitespace.git -[submodule ".local/share/vim/pack/general/start/vim-codepainter"] - path = .local/share/vim/pack/general/start/vim-codepainter +[submodule ".local/share/vim/pack/general/opt/vim-codepainter"] + path = .local/share/vim/pack/general/opt/vim-codepainter url = https://git::@github.com/lpinilla/vim-codepainter.git -[submodule ".local/share/vim/pack/general/start/vim-commentary"] - path = .local/share/vim/pack/general/start/vim-commentary +[submodule ".local/share/vim/pack/general/opt/vim-commentary"] + path = .local/share/vim/pack/general/opt/vim-commentary url = https://git::@github.com/tpope/vim-commentary.git -[submodule ".local/share/vim/pack/general/start/vim-easymotion"] - path = .local/share/vim/pack/general/start/vim-easymotion +[submodule ".local/share/vim/pack/general/opt/vim-surround"] + path = .local/share/vim/pack/general/opt/vim-surround + url = https://git::@github.com/tpope/vim-surround.git +[submodule ".local/share/vim/pack/general/opt/vim-easymotion"] + path = .local/share/vim/pack/general/opt/vim-easymotion url = https://git::@github.com/easymotion/vim-easymotion.git -[submodule ".local/share/vim/pack/general/start/vim-fugitive"] - path = .local/share/vim/pack/general/start/vim-fugitive +[submodule ".local/share/vim/pack/general/opt/vim-fugitive"] + path = .local/share/vim/pack/general/opt/vim-fugitive url = https://git::@github.com/tpope/vim-fugitive.git -[submodule ".local/share/vim/pack/general/start/vim-ninja-feet"] - path = .local/share/vim/pack/general/start/vim-ninja-feet +[submodule ".local/share/vim/pack/general/opt/vim-ninja-feet"] + path = .local/share/vim/pack/general/opt/vim-ninja-feet url = https://git::@github.com/tommcdo/vim-ninja-feet.git -[submodule ".local/share/vim/pack/general/start/vim-repeat"] - path = .local/share/vim/pack/general/start/vim-repeat - url = https://git::@github.com/tpope/vim-repeat.git -[submodule ".local/share/vim/pack/general/start/vim-surround"] - path = .local/share/vim/pack/general/start/vim-surround - url = https://git::@github.com/tpope/vim-surround.git -[submodule ".local/share/vim/pack/general/start/vim-textobj-user"] - path = .local/share/vim/pack/general/start/vim-textobj-user +[submodule ".local/share/vim/pack/general/opt/vim-textobj-user"] + path = .local/share/vim/pack/general/opt/vim-textobj-user url = https://git::@github.com/kana/vim-textobj-user.git -[submodule ".local/share/vim/pack/general/start/vim-textobj-xmlattr"] - path = .local/share/vim/pack/general/start/vim-textobj-xmlattr +[submodule ".local/share/vim/pack/general/opt/vim-textobj-xmlattr"] + path = .local/share/vim/pack/general/opt/vim-textobj-xmlattr url = https://git::@github.com/whatyouhide/vim-textobj-xmlattr.git -[submodule ".local/share/vim/pack/general/start/vim-unimpaired"] - path = .local/share/vim/pack/general/start/vim-unimpaired - url = https://github.com/tpope/vim-unimpaired [submodule ".local/share/vim/pack/themes/start/gruvbox-material"] path = .local/share/vim/pack/themes/start/gruvbox-material url = https://git::@github.com/sainnhe/gruvbox-material.git -[submodule ".local/share/vim/pack/general/start/vim-tmux-navigator"] - path = .local/share/vim/pack/general/start/vim-tmux-navigator - url = https://github.com/christoomey/vim-tmux-navigator [submodule ".local/share/nvim/pack/general/start/nvim-lspconfig"] path = .local/share/nvim/pack/general/start/nvim-lspconfig url = https://github.com/neovim/nvim-lspconfig +[submodule ".local/share/vim/pack/general/start/vim-unimpaired"] + path = .local/share/vim/pack/general/start/vim-unimpaired + url = https://github.com/tpope/vim-unimpaired +[submodule ".local/share/vim/pack/general/start/vim-repeat"] + path = .local/share/vim/pack/general/start/vim-repeat + url = https://git::@github.com/tpope/vim-repeat.git +[submodule ".local/share/vim/pack/general/start/vim-tmux-navigator"] + path = .local/share/vim/pack/general/start/vim-tmux-navigator + url = https://github.com/christoomey/vim-tmux-navigator diff --git a/.local/share/vim/pack/development/opt/emmet-vim b/.local/share/vim/pack/development/opt/emmet-vim @@ -0,0 +1 @@ +Subproject commit 1b7e460de071b7ed45cae3b5bec47310e7d12ed5 diff --git a/.local/share/vim/pack/development/opt/rust.vim b/.local/share/vim/pack/development/opt/rust.vim @@ -0,0 +1 @@ +Subproject commit c06a17151c69b9d61e60a28274932a28fd37c453 diff --git a/.local/share/vim/pack/development/opt/vim-cmake b/.local/share/vim/pack/development/opt/vim-cmake @@ -0,0 +1 @@ +Subproject commit 844b85677d52d932432eb115236d9173ebe3664d diff --git a/.local/share/vim/pack/development/opt/vim-msbuild b/.local/share/vim/pack/development/opt/vim-msbuild @@ -0,0 +1 @@ +Subproject commit 4766d9a225c433e7ce2625bcc6263bfd028c4a50 diff --git a/.local/share/vim/pack/development/start/rust.vim b/.local/share/vim/pack/development/start/rust.vim @@ -1 +0,0 @@ -Subproject commit c06a17151c69b9d61e60a28274932a28fd37c453 diff --git a/.local/share/vim/pack/development/start/vim-cmake b/.local/share/vim/pack/development/start/vim-cmake @@ -1 +0,0 @@ -Subproject commit 844b85677d52d932432eb115236d9173ebe3664d diff --git a/.local/share/vim/pack/development/start/vim-msbuild b/.local/share/vim/pack/development/start/vim-msbuild @@ -1 +0,0 @@ -Subproject commit 4766d9a225c433e7ce2625bcc6263bfd028c4a50 diff --git a/.local/share/vim/pack/general/opt/editorconfig-vim b/.local/share/vim/pack/general/opt/editorconfig-vim @@ -0,0 +1 @@ +Subproject commit 3078cd10b28904e57d878c0d0dab42aa0a9fdc89 diff --git a/.local/share/vim/pack/general/opt/vim-better-whitespace b/.local/share/vim/pack/general/opt/vim-better-whitespace @@ -0,0 +1 @@ +Subproject commit c5afbe91d29c5e3be81d5125ddcdc276fd1f1322 diff --git a/.local/share/vim/pack/general/opt/vim-codepainter b/.local/share/vim/pack/general/opt/vim-codepainter @@ -0,0 +1 @@ +Subproject commit 1ae0ee4f48e7e196ef90bc84ecbc56cad231e9df diff --git a/.local/share/vim/pack/general/opt/vim-commentary b/.local/share/vim/pack/general/opt/vim-commentary @@ -0,0 +1 @@ +Subproject commit 349340debb34f6302931f0eb7139b2c11dfdf427 diff --git a/.local/share/vim/pack/general/opt/vim-easymotion b/.local/share/vim/pack/general/opt/vim-easymotion @@ -0,0 +1 @@ +Subproject commit d75d9591e415652b25d9e0a3669355550325263d diff --git a/.local/share/vim/pack/general/opt/vim-fugitive b/.local/share/vim/pack/general/opt/vim-fugitive @@ -0,0 +1 @@ +Subproject commit 6f07d7e6cd23b7a76dc461fdfb1984717d233806 diff --git a/.local/share/vim/pack/general/opt/vim-ninja-feet b/.local/share/vim/pack/general/opt/vim-ninja-feet @@ -0,0 +1 @@ +Subproject commit cb9b448dd468a338255aed474e6113ed115612c1 diff --git a/.local/share/vim/pack/general/opt/vim-surround b/.local/share/vim/pack/general/opt/vim-surround @@ -0,0 +1 @@ +Subproject commit f51a26d3710629d031806305b6c8727189cd1935 diff --git a/.local/share/vim/pack/general/opt/vim-textobj-user b/.local/share/vim/pack/general/opt/vim-textobj-user @@ -0,0 +1 @@ +Subproject commit 41a675ddbeefd6a93664a4dc52f302fe3086a933 diff --git a/.local/share/vim/pack/general/opt/vim-textobj-xmlattr b/.local/share/vim/pack/general/opt/vim-textobj-xmlattr @@ -0,0 +1 @@ +Subproject commit 694a297f1d75fd527e87da9769f3c6519a87ebb1 diff --git a/.local/share/vim/pack/general/start/editorconfig-vim b/.local/share/vim/pack/general/start/editorconfig-vim @@ -1 +0,0 @@ -Subproject commit 3078cd10b28904e57d878c0d0dab42aa0a9fdc89 diff --git a/.local/share/vim/pack/general/start/vim-better-whitespace b/.local/share/vim/pack/general/start/vim-better-whitespace @@ -1 +0,0 @@ -Subproject commit c5afbe91d29c5e3be81d5125ddcdc276fd1f1322 diff --git a/.local/share/vim/pack/general/start/vim-codepainter b/.local/share/vim/pack/general/start/vim-codepainter @@ -1 +0,0 @@ -Subproject commit 1ae0ee4f48e7e196ef90bc84ecbc56cad231e9df diff --git a/.local/share/vim/pack/general/start/vim-commentary b/.local/share/vim/pack/general/start/vim-commentary @@ -1 +0,0 @@ -Subproject commit 349340debb34f6302931f0eb7139b2c11dfdf427 diff --git a/.local/share/vim/pack/general/start/vim-easymotion b/.local/share/vim/pack/general/start/vim-easymotion @@ -1 +0,0 @@ -Subproject commit d75d9591e415652b25d9e0a3669355550325263d diff --git a/.local/share/vim/pack/general/start/vim-fugitive b/.local/share/vim/pack/general/start/vim-fugitive @@ -1 +0,0 @@ -Subproject commit 6f07d7e6cd23b7a76dc461fdfb1984717d233806 diff --git a/.local/share/vim/pack/general/start/vim-ninja-feet b/.local/share/vim/pack/general/start/vim-ninja-feet @@ -1 +0,0 @@ -Subproject commit cb9b448dd468a338255aed474e6113ed115612c1 diff --git a/.local/share/vim/pack/general/start/vim-surround b/.local/share/vim/pack/general/start/vim-surround @@ -1 +0,0 @@ -Subproject commit f51a26d3710629d031806305b6c8727189cd1935 diff --git a/.local/share/vim/pack/general/start/vim-textobj-user b/.local/share/vim/pack/general/start/vim-textobj-user @@ -1 +0,0 @@ -Subproject commit 41a675ddbeefd6a93664a4dc52f302fe3086a933 diff --git a/.local/share/vim/pack/general/start/vim-textobj-xmlattr b/.local/share/vim/pack/general/start/vim-textobj-xmlattr @@ -1 +0,0 @@ -Subproject commit 694a297f1d75fd527e87da9769f3c6519a87ebb1