Skip to content
Myr

[vim] Ignore 'dir' option if empty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This makes it easier to override FZF command like follows: autocmd VimEnter * command! -nargs=? -bang -complete=dir FZF call fzf#run({ \ 'sink': 'tabe', \ 'dir': <q-args>, \ 'options': '-m', \ 'tmux_height': empty('<bang>') ? '40%' : '' })

authored by Junegunn Choi · committed by Junegunn Choi · parent d1387bf · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:plugin/fzf.vim+2 added-2 removed
111 unmodified lines
112 \ min([&lines, get(a:dict, 'tmux_height', get(a:dict, 'tmux', 0))]) >= s:min_tmux_height113endfunction114115function! s:pushd(dict)116 if has_key(a:dict, 'dir')116 if !empty(get(a:dict, 'dir', ''))117 let a:dict.prev_dir = getcwd()118 execute 'chdir '.s:escape(a:dict.dir)119 endif120endfunction
36 unmodified lines
157endfunction158159function! s:execute_tmux(dict, command, temps)160 let command = s:env_var('FZF_DEFAULT_OPTS').s:env_var('FZF_DEFAULT_COMMAND').a:command161 if has_key(a:dict, 'dir')161 if !empty(get(a:dict, 'dir', ''))162 let command = 'cd '.s:escape(a:dict.dir).' && '.command163 endif164165 let splitopt = '-v'
84 unmodified lines