Last active
April 18, 2017 02:48
-
-
Save mgamba/3288c5d23862c5a923cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"vim tab mapping for default autocomplete | |
:function AutoComplete() | |
: if len(matchstr(getline('.')[col('.')-2], "[^ \t\n]*$")) > 0 | |
: return "\<C-N>" | |
: else | |
: return "\<TAB>" | |
: endif | |
:endfunction | |
inoremap <silent> <TAB> <C-R>=AutoComplete()<CR> | |
"add git grep to vim | |
function! GitGrep(search_token) | |
:cgete system('git grep -n ' . a:search_token) | |
:copen | |
endfunction | |
command! -nargs=1 GitGrep call GitGrep("<args>") | |
:nnoremap <S-f> :GitGrep | |
:nnoremap <S-Right> :cnext<CR> | |
:nnoremap <S-Left> :cprev<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment