diff --git a/rc/modules/fzf-cd.kak b/rc/modules/fzf-cd.kak index 4b75a45..fb19ade 100644 --- a/rc/modules/fzf-cd.kak +++ b/rc/modules/fzf-cd.kak @@ -8,6 +8,8 @@ # │ GitHub.com/andreyorst/fzf.kak │ # ╰──────────────────────────────────────╯ +hook global ModuleLoaded fzf %§ + declare-option -docstring "command to provide list of directories to fzf. Default value: find: (echo .. && find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type d -print) @@ -29,7 +31,6 @@ str cd_preview_command "tree -d {}" declare-option -docstring 'maximum amount of previewed directories' \ int fzf_preview_dirs '300' -hook global ModuleLoaded fzf %§ map global fzf -docstring "change directory" 'c' ': fzf-cd' diff --git a/rc/modules/fzf-ctags.kak b/rc/modules/fzf-ctags.kak index 04ed073..70c1f2f 100644 --- a/rc/modules/fzf-ctags.kak +++ b/rc/modules/fzf-ctags.kak @@ -7,12 +7,13 @@ # ╞════════════════════════════════════════╡ # │ GitHub.com/andreyorst/fzf.kak │ # ╰────────────────────────────────────────╯ + +hook global ModuleLoaded fzf %§ + declare-option -docstring "file that should be used by fzf-tag to provide tags. Default value: tags" \ str fzf_tag_file_name "tags" -hook global ModuleLoaded fzf %§ - map global fzf -docstring "find tag" 't' ': fzf-tag' # this huge try block defines filetype aware filter mappings for separate fzf-ctags mode diff --git a/rc/modules/fzf-file.kak b/rc/modules/fzf-file.kak index f819255..a72243c 100644 --- a/rc/modules/fzf-file.kak +++ b/rc/modules/fzf-file.kak @@ -8,6 +8,8 @@ # │ GitHub.com/andreyorst/fzf.kak │ # ╰──────────────────────────────────────╯ +hook global ModuleLoaded fzf %§ + declare-option -docstring "command to provide list of files to fzf. Arguments are supported Supported tools: : : @@ -24,7 +26,11 @@ Default arguments: " \ str fzf_file_command "find" -hook global ModuleLoaded fzf %§ +declare-option -docstring 'allow showing preview window while searching for file +Default value: + true +' \ +bool fzf_file_preview true map global fzf -docstring "open file" 'f' ': fzf-file' @@ -54,7 +60,8 @@ $kak_opt_fzf_vertical_map: open file in vertical split" printf "%s\n" "info -title 'fzf file' '$message$tmux_keybindings'" [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -preview -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}" + [ "$kak_opt_fzf_file_preview" = "true" ] && preview_flag="-preview" + printf "%s\n" "fzf $preview_flag -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}" }} § diff --git a/rc/modules/fzf-project.kak b/rc/modules/fzf-project.kak index 8aa11b2..ce96a53 100644 --- a/rc/modules/fzf-project.kak +++ b/rc/modules/fzf-project.kak @@ -8,11 +8,11 @@ # │ GitHub.com/andreyorst/fzf.kak │ # ╰──────────────────────────────────────╯ +hook global ModuleLoaded fzf %§ + declare-option -docstring "file where saved projects are stored" str fzf_project_file "%val{config}/.fzf-projects" declare-option -docstring %sh{ printf "%s\n" "use '~/' instead of '${HOME}'" } bool fzf_project_use_tilda false -hook global ModuleLoaded fzf %§ - map global fzf -docstring "open project" 'p' ': fzf-project' try %{ declare-user-mode fzf-project } diff --git a/rc/modules/sk-grep.kak b/rc/modules/sk-grep.kak index 89f5261..d0e9002 100644 --- a/rc/modules/sk-grep.kak +++ b/rc/modules/sk-grep.kak @@ -8,6 +8,8 @@ # │ GitHub.com/andreyorst/fzf.kak │ # ╰──────────────────────────────────────╯ +hook global ModuleLoaded fzf %§ + declare-option -docstring "what command to use to provide list of grep search matches. Grep output must follow the format of 'filename:line-number:text' @@ -17,8 +19,6 @@ str fzf_sk_grep_command 'grep -RHn' declare-option -hidden str fzf_sk_first_file '' -hook global ModuleLoaded fzf %§ - evaluate-commands %sh{ if [ -n "$(command -v sk)" ]; then printf "%s\n" "map global fzf -docstring %{Interactive grep with skim} 'g' ': fzf-sk-grep'"