1
0
Fork 0
This commit is contained in:
Andrey Orst 2019-12-19 12:03:23 +03:00
parent 2d3340ec55
commit 8a8414fb57
2 changed files with 6 additions and 6 deletions

View file

@ -15,7 +15,7 @@ Supported tools:
GNU Bazaar: ""bzr"" GNU Bazaar: ""bzr""
Default arguments: Default arguments:
'(cd $repo_root && bzr ls -R --versioned | awk \""{printf \\\""$repo_root/\\\"" \\\$0 \\\""\\\n\\\"" }\"")' '(cd $repo_root && bzr ls -R --versioned)'
" \ " \
str fzf_bzr_command "bzr" str fzf_bzr_command "bzr"
@ -24,11 +24,11 @@ map global fzf-vcs -docstring "edit file from GNU Bazaar tree" 'b' '<esc>: fzf-b
define-command -hidden fzf-bzr %{ evaluate-commands %sh{ define-command -hidden fzf-bzr %{ evaluate-commands %sh{
repo_root=$(bzr root) repo_root=$(bzr root)
case $kak_opt_fzf_bzr_command in case $kak_opt_fzf_bzr_command in
(bzr) cmd="(cd $repo_root && bzr ls -R --versioned | awk \"{printf \\\"$repo_root/\\\" \\\$0 \\\"\\\n\\\" }\")" ;; (bzr) cmd="(cd $repo_root && bzr ls -R --versioned)" ;;
(bzr*) cmd=$kak_opt_fzf_bzr_command ;; (*) cmd=$kak_opt_fzf_bzr_command ;;
esac esac
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map"
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}" printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -filter %{perl -pe \"if (/$kak_opt_fzf_window_map|$kak_opt_fzf_vertical_map|$kak_opt_fzf_horizontal_map|^$/) {} else {print \\\"$repo_root/\\\"}\"}"
}} }}
§ §

View file

@ -12,10 +12,10 @@ hook global ModuleLoaded fzf_vcs %§
declare-option -docstring "command to provide list of files in git tree to fzf. Arguments are supported declare-option -docstring "command to provide list of files in git tree to fzf. Arguments are supported
Supported tools: Supported tools:
<package>: <value>: <package>: <value>:
Git : ""git"" Git: ""git""
Default arguments: Default arguments:
'repo_root=$(git rev-parse --show-toplevel); git ls-tree --full-tree --name-only -r HEAD | awk ""{print \""$repo_root/\"" \$0}""' 'git ls-tree --full-tree --name-only -r HEAD'
" \ " \
str fzf_git_command "git" str fzf_git_command "git"