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

33 lines
1.4 KiB
Text
Raw Normal View History

2018-11-11 10:41:15 +00:00
# ╭─────────────╥─────────────────────────╮
# │ Author: ║ File: │
# │ Andrey Orst ║ fzf-svn.kak │
# ╞═════════════╩═════════════════════════╡
# │ Submodule for Git support for fzf.kak │
# ╞═══════════════════════════════════════╡
# │ GitHub.com/andreyorst/fzf.kak │
# ╰───────────────────────────────────────╯
declare-option -docstring "command to provide list of files in git tree to fzf. Arguments are supported
Supported tools:
<package>: <value>:
Git : ""git""
Default arguments:
2018-11-24 18:58:23 +00:00
""git ls-tree --full-tree --name-only -r HEAD""
2018-11-11 10:41:15 +00:00
" \
str fzf_git_command "git"
map global fzf-vcs -docstring "edit file from Git tree" 'g' '<esc>: fzf-git<ret>'
define-command -hidden fzf-git %{ evaluate-commands %sh{
case $kak_opt_fzf_git_command in
git)
2018-11-24 18:58:23 +00:00
cmd="git ls-tree --full-tree --name-only -r HEAD" ;;
2018-11-11 10:41:15 +00:00
git*)
cmd=$kak_opt_fzf_git_command ;;
esac
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
2018-11-22 12:36:11 +00:00
printf "%s\n" "fzf %{edit} %{$cmd} %{-m --expect ctrl-w $additional_flags}"
2018-11-11 10:41:15 +00:00
}}