2018-11-11 10:41:15 +00:00
|
|
|
# ╭─────────────╥────────────────────────╮
|
|
|
|
# │ Author: ║ File: │
|
|
|
|
# │ Andrey Orst ║ fzf-svn.kak │
|
|
|
|
# ╞═════════════╩════════════════════════╡
|
|
|
|
# │ Submodule for Hg support for fzf.kak │
|
|
|
|
# ╞══════════════════════════════════════╡
|
|
|
|
# │ GitHub.com/andreyorst/fzf.kak │
|
|
|
|
# ╰──────────────────────────────────────╯
|
|
|
|
|
2019-06-30 09:45:39 +00:00
|
|
|
hook global ModuleLoaded fzf_vcs %§
|
2019-05-20 10:35:10 +00:00
|
|
|
|
2018-11-11 10:41:15 +00:00
|
|
|
declare-option -docstring "command to provide list of files in mercurial repository to fzf. Arguments are supported
|
|
|
|
Supported tools:
|
|
|
|
<package>: <value>:
|
|
|
|
Mercurial SCM: ""hg""
|
|
|
|
|
|
|
|
Default arguments:
|
|
|
|
""hg locate -f -0 -I .hg locate -f -0 -I .""
|
|
|
|
" \
|
|
|
|
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{
|
2019-03-17 05:09:34 +00:00
|
|
|
current_path=$(pwd)
|
|
|
|
repo_root=$(hg root)
|
2018-11-11 10:41:15 +00:00
|
|
|
case $kak_opt_fzf_hg_command in
|
|
|
|
hg)
|
|
|
|
cmd="hg locate -f -0 -I .hg locate -f -0 -I ." ;;
|
|
|
|
hg*)
|
|
|
|
cmd=$kak_opt_fzf_hg_command ;;
|
|
|
|
esac
|
2019-05-13 18:34:46 +00:00
|
|
|
[ ! -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}"
|
2018-11-11 10:41:15 +00:00
|
|
|
}}
|
|
|
|
|
2019-05-09 15:12:06 +00:00
|
|
|
§
|