2018-11-11 10:41:15 +00:00
|
|
|
# ╭─────────────╥─────────────────────────╮
|
|
|
|
# │ Author: ║ File: │
|
|
|
|
# │ Andrey Orst ║ fzf-svn.kak │
|
|
|
|
# ╞═════════════╩═════════════════════════╡
|
2018-11-22 12:36:11 +00:00
|
|
|
# │ Submodule for Svn support for fzf.kak │
|
2018-11-11 10:41:15 +00:00
|
|
|
# ╞═══════════════════════════════════════╡
|
|
|
|
# │ GitHub.com/andreyorst/fzf.kak │
|
|
|
|
# ╰───────────────────────────────────────╯
|
|
|
|
|
|
|
|
declare-option -docstring "command to provide list of files in svn repository to fzf. Arguments are supported
|
|
|
|
Supported tools:
|
|
|
|
<package>: <value>:
|
|
|
|
Subversion: ""svn""
|
|
|
|
|
|
|
|
Default arguments:
|
2019-03-17 05:09:34 +00:00
|
|
|
""svn list -R $(svn info | awk -F': ' '/Working Copy Root Path: .*/ {print $2}') | grep -v '$/'""
|
2018-11-11 10:41:15 +00:00
|
|
|
" \
|
|
|
|
str fzf_svn_command "svn"
|
|
|
|
|
2019-05-09 15:12:06 +00:00
|
|
|
hook global ModuleLoad fzf_vcs %§
|
2018-11-11 10:41:15 +00:00
|
|
|
map global fzf-vcs -docstring "edit file from Subversion tree" 's' '<esc>: fzf-svn<ret>'
|
|
|
|
|
|
|
|
define-command -hidden fzf-svn %{ evaluate-commands %sh{
|
2019-03-17 05:09:34 +00:00
|
|
|
current_path=$(pwd)
|
|
|
|
repo_root=$(svn info | awk -F': ' '/Working Copy Root Path: .*/ {print $2}')
|
2018-11-11 10:41:15 +00:00
|
|
|
case $kak_opt_fzf_svn_command in
|
|
|
|
svn)
|
2019-03-17 05:09:34 +00:00
|
|
|
cmd="svn list -R $repo_root | grep -v '$/'" ;;
|
2018-11-11 10:41:15 +00:00
|
|
|
svn*)
|
|
|
|
cmd=$kak_opt_fzf_svn_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
|
|
|
}}
|
|
|
|
|
2019-05-09 15:12:06 +00:00
|
|
|
§
|