diff --git a/README.md b/README.md index b418424..64b81ab 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,11 @@ let g:fzf_commands_expect = 'alt-enter,ctrl-x' You can use autoload functions to define your own commands. ```vim +" git grep +command! -bang -nargs=* GGrep + \ call fzf#vim#grep('git grep --line-number '.shellescape(), 0, 0) + +" We use VimEnter event so that the code is run after fzf.vim is loaded autocmd VimEnter * command! Colors \ call fzf#vim#colors({'left': '15%', 'options': '--reverse --margin 30%,0'}) ``` diff --git a/doc/fzf-vim.txt b/doc/fzf-vim.txt index c4a0e56..2752ea5 100644 --- a/doc/fzf-vim.txt +++ b/doc/fzf-vim.txt @@ -183,7 +183,11 @@ Advanced customization using autoload functions~ You can use autoload functions to define your own commands. > - " Advanced customization using autoload functions + " git grep + command! -bang -nargs=* GGrep + \ call fzf#vim#grep('git grep --line-number '.shellescape(), 0, 0) + + " We use VimEnter event so that the code is run after fzf.vim is loaded autocmd VimEnter * command! Colors \ call fzf#vim#colors({'left': '15%', 'options': '--reverse --margin 30%,0'}) <