Created
September 20, 2023 09:41
-
-
Save jiangyinzuo/d9c985999f76864ac192edfdacdadcce to your computer and use it in GitHub Desktop.
FZF + Z vimscript
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
function Z(query, sink) | |
let l:cmd = "awk -f " . $VIMRC_ROOT . "/z.awk regex=" . a:query . " ~/.z " | |
call fzf#run(fzf#wrap({'source': l:cmd, 'sink': a:sink, 'options': ['--query', a:query, '--prompt', 'Z ' . a:sink . '>', '--color', 'hl:148,hl+:190']})) | |
endfunction | |
command! -bang -nargs=? Z call Z(<q-args>, 'cd') | |
command! -bang -nargs=? TZ call Z(<q-args>, 'tcd') | |
command! -bang -nargs=? LZ call Z(<q-args>, 'lcd') | |
command! -bang -nargs=? Zex call Z(<q-args>, 'Ex') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment