diff --git a/home/vim.nix b/home/vim.nix index 6d7ce0a..84a3379 100644 --- a/home/vim.nix +++ b/home/vim.nix @@ -17,14 +17,15 @@ in plugins = with pkgs.vimPlugins; [ ansible-vim bufexplorer - ctrlp direnv-vim + fzf-vim nerdtree vim-gitgutter vim-flake8 vim-fugitive vim-indent-guides vim-packer + vim-rooter gruvbox syntastic ]; @@ -67,22 +68,6 @@ autocmd BufWinLeave * call clearmatches() " Settings for CtrlP set wildignore+=*.swp,*.pyc,*.class,.tox -" Base of search is ordered as -" r - searching up from here to the nearest marker (.git, .hg, .svn, etc) -" a - dir of current file, unless that's a subdirectory of CWD -" c - dir of current file -let g:ctrlp_working_path_mode = 'arc' -let g:ctrlp_switch_buffer = 0 -let g:ctrlp_cmd = 'CtrlPMixed' -let g:ctrlp_show_hidden = 1 -let g:ctrlp_user_command = { - \'types': { - \1: ['.git', '${pkgs.git}/bin/git ls-files --cached --exclude-standard --others' ], - \}, - \'fallback': '${pkgs.findutils}/bin/find . -type f | ${pkgs.gnugrep}/bin/grep -v -e "\.tox/" -e "\.git/"', -\} -" let g:ctrpl_match_func = { 'match': 'pymatcher#PyMatch' } - " Settings for NerdTree let NERDTreeIgnore = ['\.pyc$', '\.o$', '\.class$'] " indent guides @@ -99,7 +84,14 @@ let g:diffget_upstream_map = 'gu' " Key mappings map \be map :NERDTreeToggle -map :CtrlP +silent !${pkgs.git}/bin/git rev-parse --is-inside-work-tree +if v:shell_error == 0 + map :GFiles --cached --others --exclude-standard + map :GFiles? +else + map :Files +endif +map :Files " Allows navigating splits map j map k @@ -165,6 +157,30 @@ endfunction command! -nargs=? -range=% Space2Tab call IndentConvert(,,0,) command! -nargs=? -range=% Tab2Space call IndentConvert(,,1,) command! -nargs=? -range=% RetabIndent call IndentConvert(,,&et,) + + +""""""""" +""" Unused, but kept in case I end up on a system where I can't use my preferred plugins +""""""""" + + + +" Base of search is ordered as +" r - searching up from here to the nearest marker (.git, .hg, .svn, etc) +" a - dir of current file, unless that's a subdirectory of CWD +" c - dir of current file +let g:ctrlp_working_path_mode = 'arc' +let g:ctrlp_switch_buffer = 0 +let g:ctrlp_cmd = 'CtrlPMixed' +let g:ctrlp_show_hidden = 1 +let g:ctrlp_user_command = { + \'types': { + \1: ['.git', '${pkgs.git}/bin/git ls-files --cached --exclude-standard --others' ], + \}, + \'fallback': '${pkgs.findutils}/bin/find . -type f | ${pkgs.gnugrep}/bin/grep -v -e "\.tox/" -e "\.git/"', +\} +" let g:ctrpl_match_func = { 'match': 'pymatcher#PyMatch' } +" map :CtrlP ''; }; }