2018-11-11 10:41:15 +00:00
|
|
|
# ╭─────────────╥─────────────────────────╮
|
|
|
|
# │ Author: ║ File: │
|
|
|
|
# │ Andrey Orst ║ fzf-svn.kak │
|
|
|
|
# ╞═════════════╩═════════════════════════╡
|
|
|
|
# │ Submodule for Bzr support for fzf.kak │
|
|
|
|
# ╞═══════════════════════════════════════╡
|
|
|
|
# │ GitHub.com/andreyorst/fzf.kak │
|
|
|
|
# ╰───────────────────────────────────────╯
|
|
|
|
|
|
|
|
declare-option -docstring "command to provide list of files in GNU Bazaar repository to fzf. Arguments are supported
|
|
|
|
Supported tools:
|
|
|
|
<package>: <value>:
|
|
|
|
GNU Bazaar: ""bzr""
|
|
|
|
|
|
|
|
Default arguments:
|
|
|
|
""bzr ls -R --versioned -0""
|
|
|
|
" \
|
|
|
|
str fzf_bzr_command "bzr"
|
|
|
|
|
2019-03-26 17:34:01 +00:00
|
|
|
try %{ declare-user-mode fzf }
|
2018-11-11 10:41:15 +00:00
|
|
|
map global fzf-vcs -docstring "edit file from GNU Bazaar tree" 'b' '<esc>: fzf-bzr<ret>'
|
|
|
|
|
|
|
|
define-command -hidden fzf-bzr %{ evaluate-commands %sh{
|
2019-03-17 05:09:34 +00:00
|
|
|
current_path=$(pwd)
|
|
|
|
repo_root=$(bzr root)
|
2018-11-11 10:41:15 +00:00
|
|
|
case $kak_opt_fzf_bzr_command in
|
|
|
|
bzr)
|
|
|
|
cmd="bzr ls -R --versioned -0" ;;
|
|
|
|
bzr*)
|
|
|
|
cmd=$kak_opt_fzf_bzr_command ;;
|
|
|
|
esac
|
|
|
|
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
|
2019-03-26 12:25:13 +00:00
|
|
|
printf "%s\n" "fzf -kak-cmd %{cd $repo_root; edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ctrl-w $additional_flags} -post-action %{cd $current_path}"
|
2018-11-11 10:41:15 +00:00
|
|
|
}}
|
|
|
|
|