1
0
Fork 0
fzf.kak/rc/modules/VCS/fzf-hg.kak

32 lines
1,004 B
Text
Raw Normal View History

2021-03-19 18:00:49 +00:00
# Author: Andrey Listopadov
# Submodule for Hg support for fzf.kak
# https://github.com/andreyorst/fzf.kak
2018-11-11 10:41:15 +00:00
2021-03-19 18:00:49 +00:00
hook global ModuleLoaded fzf-vcs %{
map global fzf-vcs -docstring "edit file from mercurial tree" 'h' '<esc>: require-module fzf-hg; fzf-hg<ret>'
}
provide-module fzf-hg %§
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:
2019-09-09 15:20:42 +00:00
""hg locate -f""
2018-11-11 10:41:15 +00:00
" \
str fzf_hg_command "hg"
define-command -hidden fzf-hg %{ evaluate-commands %sh{
case $kak_opt_fzf_hg_command in
2019-09-09 15:20:42 +00:00
(hg) cmd="hg locate -f" ;;
2019-07-07 08:27:37 +00:00
(hg*) cmd=$kak_opt_fzf_hg_command ;;
2018-11-11 10:41:15 +00:00
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"
2019-09-09 15:20:42 +00:00
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}"
2018-11-11 10:41:15 +00:00
}}
2019-05-09 15:12:06 +00:00
§