1
0
Fork 0
This commit is contained in:
Andrey Orst 2019-09-09 18:20:42 +03:00
parent 2494c9c8b5
commit b257db0bf8
2 changed files with 6 additions and 9 deletions

View file

@ -15,21 +15,20 @@ Supported tools:
GNU Bazaar: ""bzr""
Default arguments:
""bzr ls -R --versioned -0""
'(cd $repo_root && bzr ls -R --versioned | awk \""{printf \\\""$repo_root/\\\"" \\\$0 \\\""\\\n\\\"" }\"")'
" \
str fzf_bzr_command "bzr"
map global fzf-vcs -docstring "edit file from GNU Bazaar tree" 'b' '<esc>: fzf-bzr<ret>'
define-command -hidden fzf-bzr %{ evaluate-commands %sh{
current_path=$(pwd)
repo_root=$(bzr root)
case $kak_opt_fzf_bzr_command in
(bzr) cmd="bzr ls -R --versioned -0" ;;
(bzr) cmd="(cd $repo_root && bzr ls -R --versioned | awk \"{printf \\\"$repo_root/\\\" \\\$0 \\\"\\\n\\\" }\")" ;;
(bzr*) cmd=$kak_opt_fzf_bzr_command ;;
esac
[ ! -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 %{cd $repo_root; edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -post-action %{cd $current_path}"
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}"
}}
§

View file

@ -15,21 +15,19 @@ Supported tools:
Mercurial SCM: ""hg""
Default arguments:
""hg locate -f -0 -I .hg locate -f -0 -I .""
""hg locate -f""
" \
str fzf_hg_command "hg"
map global fzf-vcs -docstring "edit file from mercurial tree" 'h' '<esc>: fzf-hg<ret>'
define-command -hidden fzf-hg %{ evaluate-commands %sh{
current_path=$(pwd)
repo_root=$(hg root)
case $kak_opt_fzf_hg_command in
(hg) cmd="hg locate -f -0 -I .hg locate -f -0 -I ." ;;
(hg) cmd="hg locate -f" ;;
(hg*) cmd=$kak_opt_fzf_hg_command ;;
esac
[ ! -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 %{cd $repo_root; edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -post-action %{cd $current_path}"
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}"
}}
§