dotfiles

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

commit b51ce9a900960b9ed213387b75e27fb7fdf49973
parent 27bdf8bca13c1b77a76c81b89ddb5563567988a2
Author: bharatvaj.ph <bharatvaj.ph@zohocorp.com>
Date:   Fri, 22 Apr 2022 23:57:01 +0530

Use augroup for loading plugins in vim

This change has significant startup time improvements

Remove GREP_OPTIONS from .profile as it is deprecated

NOTE
----
The plugins are not loading automatically. Fix it in the upcoming commits.

Diffstat:
M.config/alacritty/alacritty.yml | 16++++++++++------
M.config/vim/vimrc | 125+++++++++++++++++++++++++++++++++++++++----------------------------------------
M.profile | 1-
3 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml @@ -1,7 +1,11 @@ -font: - size: 16 -shell: - program: /usr/local/bin/bash - args: - - --login +mouse: + hide_when_typing: true + +import: + - ~/.config/alacritty/theme.yml + - ~/.config/alacritty/font.yml +live_config_reload: true + +shell: + program: cmd diff --git a/.config/vim/vimrc b/.config/vim/vimrc @@ -1,33 +1,9 @@ -" Use XDG Paths for vim -set runtimepath^=$XDG_CONFIG_HOME/vim -set runtimepath+=$XDG_DATA_HOME/vim -set runtimepath+=$XDG_CONFIG_HOME/vim/after - -set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim -set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_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') - if !has('nvim') | set viminfofile=$XDG_CACHE_HOME/vim/viminfo | endif " General - -"Adapted from https://jeffkreeftmeijer.com/vim-number/ -:set number -:augroup numbertoggle -: autocmd! -: autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif -: autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif -:augroup END - -set mouse=a -syntax on +set number +set mouse= +set nocursorline set exrc " Disable auto fixing end of line @@ -50,40 +26,61 @@ set expandtab " Netrw customization let g:netrw_banner = 0 -" Hard vim -for key in ['<Up>', '<Down>', '<Left>', '<Right>'] - exec 'noremap' key '<Nop>' - exec 'inoremap' key '<Nop>' - exec 'cnoremap' key '<Nop>' -endfor - -" Plugin Management -"let data_dir = has('nvim') ? stdpath('data') . '/site' : "${XDG_DATA_HOME}/vim" -"if empty(glob(data_dir . '/autoload/plug.vim')) -" silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -"endif -call plug#begin($XDG_DATA_HOME."/vim/plugged") - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' - Plug 'cdelledonne/vim-cmake' - Plug 'editorconfig/editorconfig-vim' - Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-surround' -call plug#end() - -" Plugin customizations -" fzf -" BUG remove bashism -" TODO - Files are repeated twice in some cases -command! GFAll call fzf#run(fzf#wrap({'source': "comm <(git ls-files --exclude-standard --cached --cached --recurse-submodules) <(git ls-files --exclude-standard --cached --others) | awk '{$1=$1;print}'"})) - -" Plugin Keybindings -nmap <leader>f :GFAll<cr> -nmap <leader>F :Files<cr> -nnoremap <leader>t :tabnew<cr> -nnoremap <leader>p :Rg<cr> -nnoremap <leader>s :source ~/.config/vim/vimrc<cr> - -" Theming Begin -" Theming End +" Visual Tweaks +hi VertSplit term=NONE cterm=NONE gui=NONE + +"TODO use inverse colors from fg and bg instead of hardcoding black and white values +hi LineNr ctermbg=Black ctermfg=White + +" Prominent Cursor Line +hi CursorLineNr ctermbg=White ctermfg=Black + +" Disable status +set laststatus=1 +set nowrapscan +set lazyredraw +set ttyfast + +" Plugins +source $XDG_CONFIG_HOME/vim/plugin/plugin.vim + +" Keybindings +source $XDG_CONFIG_HOME/vim/keybindings/keybindings.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 + set runtimepath^='$XDG_CONFIG_HOME/vim' + 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') + packadd vim-surround +endfunction + +augroup user_cmds + autocmd! + autocmd VimEnter * call timer_start(20, function('s:load_plugins')) +augroup END + +if has("win32") + if executable("pwsh") + set shell=pwsh + set shellcmdflag=-ExecutionPolicy\ RemoteSigned\ -Command + set shellquote=\" + " shellxquote must be a literal space character. + set shellxquote= + endif +endif + +set path+=** diff --git a/.profile b/.profile @@ -1,4 +1,3 @@ -export GREP_OPTIONS='--color=auto' export GREP_COLOR='1;35;40' # XDG