mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-01-30 14:45:30 +08:00
Do not override existing commands
So that we don't have to use VimEnter autocmd to override the commands
This commit is contained in:
@@ -162,8 +162,9 @@ You can use autoload functions to define your own commands.
|
||||
command! -bang -nargs=* GGrep
|
||||
\ call fzf#vim#grep('git grep --line-number '.shellescape(<q-args>), 0, <bang>0)
|
||||
|
||||
" We use VimEnter event so that the code is run after fzf.vim is loaded
|
||||
autocmd VimEnter * command! -bang Colors
|
||||
" Override Colors command. You can safely do this in your .vimrc as fzf.vim
|
||||
" will not override existing commands.
|
||||
command! -bang Colors
|
||||
\ call fzf#vim#colors({'left': '15%', 'options': '--reverse --margin 30%,0'}, <bang>0)
|
||||
|
||||
" Augmenting Ag command using fzf#vim#with_preview function
|
||||
@@ -173,7 +174,7 @@ autocmd VimEnter * command! -bang Colors
|
||||
"
|
||||
" :Ag - Start fzf with hidden preview window that can be enabled with "?" key
|
||||
" :Ag! - Start fzf in fullscreen and display the preview window above
|
||||
autocmd VimEnter * command! -bang -nargs=* Ag
|
||||
command! -bang -nargs=* Ag
|
||||
\ call fzf#vim#ag(<q-args>,
|
||||
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||
|
||||
Reference in New Issue
Block a user