diff --git a/README.md b/README.md
index e825e45..ac324e7 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,9 @@ In this mode new mappings are available:
- V - Explicitly select which vcs command to run
- s - Search over buffer contents and jump to result line
- t - Browse ctags tags
+ fzf.kak supports filtering tags on per language basis. For each filetype
+ press alt+filter key specified in the info box to
+ reload fzf buffer with the desired filter.
You can set your own mapping to invoke `fzf-mode`:
diff --git a/rc/fzf.kak b/rc/fzf.kak
index babfc46..7e15997 100644
--- a/rc/fzf.kak
+++ b/rc/fzf.kak
@@ -250,27 +250,6 @@ define-command -hidden fzf-bzr %{ evaluate-commands %sh{
eval echo 'fzf \"edit \$1\" \"$cmd\" \"-m --expect ctrl-w $additional_flags\"'
}}
-define-command -hidden fzf-tag %{ evaluate-commands %sh{
- case $kak_opt_fzf_tag_command in
- readtags)
- cmd="readtags -l | cut -f1" ;;
- readtags*)
- cmd=$kak_opt_fzf_tag_command ;;
- *)
- echo "echo -markup '{Information}$kak_opt_fzf_tag_command is not supported by the script. fzf.kak may not work as you expect."
- cmd=$kak_opt_fzf_tag_command ;;
- esac
- title="fzf tag"
- [ ! -z "${kak_client_env_TMUX}" ] && additional_keybindings="
-: open tag in horizontal split
-: open tag in vertical split"
- message="Jump to a symbol''s definition.: open tag in new buffer.
-: open tag in new window $additional_keybindings"
- echo "info -title '$title' '$message'"
- [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
- eval echo 'fzf \"ctags-search \$1\" \"$cmd\" \"--expect ctrl-w $additional_flags\"'
-}}
-
define-command -hidden fzf-cd %{
evaluate-commands %sh{
title="fzf change directory"
@@ -330,11 +309,13 @@ define-command -hidden fzf -params 2..3 %{ evaluate-commands %sh{
fi
if [ ! -z "${kak_client_env_TMUX}" ]; then
+ [ -z "${items_command##*Q*}" ] && items_command=$(echo $items_command | sed 's:$kind \(\w\):\$kind \"\1\":')
cmd="$preview_pos $items_command | fzf-tmux -d $kak_opt_fzf_tmux_height --expect ctrl-q $additional_flags > $tmp"
elif [ ! -z "${kak_opt_termcmd}" ]; then
path=$(pwd)
additional_flags=$(echo $additional_flags | sed 's:\$pos:\\\\\\\$pos:')
- cmd="$kak_opt_termcmd \"sh -c \\\"sh=$(command -v sh); SHELL=\\\$sh; export SHELL; cd $path && $preview_pos $items_command | fzf --expect ctrl-q $additional_flags > $tmp\\\"\""
+ [ -z "${items_command##*Q*}" ] && items_command=$(echo $items_command | sed 's:$kind \(\w\):\\\\\\$kind \\\\\\\"\1\\\\\\\":')
+ cmd="$kak_opt_termcmd \"sh -c \\\"sh=$(command -v sh); SHELL=\\\$sh; export SHELL; cd $path && $preview_pos $items_command | fzf --expect ctrl-q $additional_flags > $tmp\\\"\"
else
echo "fail termcmd option is not set"
exit
@@ -347,13 +328,16 @@ define-command -hidden fzf -params 2..3 %{ evaluate-commands %sh{
read action
if [ "${callback% *}" != "change-directory" ]; then
case $action in
- "ctrl-w")
+ ctrl-w)
wincmd="x11-new "
[ ! -z "${kak_client_env_TMUX}" ] && wincmd="tmux-new-window " ;;
- "ctrl-s")
+ ctrl-s)
wincmd="tmux-new-vertical " ;;
- "ctrl-v")
+ ctrl-v)
wincmd="tmux-new-horizontal " ;;
+ alt-*)
+ kind="${action##*-}"
+ callback="fzf-tag $kind" ;;
*)
wincmd= ;;
esac
@@ -422,3 +406,1196 @@ define-command -hidden fzf-buffer %{ evaluate-commands %sh{
) > /dev/null 2>&1 < /dev/null &
}}
+declare-option -hidden -docstring "Set of mappings for Ada filetype" \
+str fzf_tag_ada "
+: package specifications
+: packages
+: types
+: subtypes
+: record type components
+: enum type literals
+: variables
+: generic formal parameters
+: constants
+: user defined exceptions
+: subprogram specifications
+: subprograms
+: task specifications
+: tasks
+: protected data specifications
+: protected data
+: task/protected data entries
+: labels
+: loop/declare identifiers
+: (ctags internal use)"
+
+declare-option -hidden -docstring "Set of mappings for Ant filetype" \
+str fzf_tag_ant "
+: projects
+: targets
+: properties(global)
+: antfiles"
+
+declare-option -hidden -docstring "Set of mappings for Asciidoc filetype" \
+str fzf_tag_asciidoc "
+: chapters
+: sections
+: level : sections
+: level : sections
+: level : sections
+: level : sections
+: anchors"
+
+declare-option -hidden -docstring "Set of mappings for Asm filetype" \
+str fzf_tag_asm "
+: defines
+: labels
+: macros
+: types (structs and records)
+: sections"
+
+declare-option -hidden -docstring "Set of mappings for Asp filetype" \
+str fzf_tag_asp "
+: constants
+: classes
+: functions
+: subroutines
+: variables"
+
+declare-option -hidden -docstring "Set of mappings for Autoconf filetype" \
+str fzf_tag_autoconf "
+: packages
+: templates
+: autoconf macros
+: options specified with --with-...
+: options specified with --enable-...
+: substitution keys
+: automake conditions
+: definitions"
+
+declare-option -hidden -docstring "Set of mappings for AutoIt filetype" \
+str fzf_tag_autoit "
+: functions
+: regions
+: global variables
+: local variables
+: included scripts"
+
+declare-option -hidden -docstring "Set of mappings for Automake filetype" \
+str fzf_tag_automake "
+: directories
+: programs
+: manuals
+: ltlibraries
+: libraries
+: scripts
+: datum
+: conditions"
+
+declare-option -hidden -docstring "Set of mappings for Awk filetype" \
+str fzf_tag_awk "
+: functions"
+
+declare-option -hidden -docstring "Set of mappings for Basic filetype" \
+str fzf_tag_basic "
+: constants
+: functions
+: labels
+: types
+: variables
+: enumerations"
+
+declare-option -hidden -docstring "Set of mappings for BETA filetype" \
+str fzf_tag_beta "
+: fragment definitions
+: slots (fragment uses)
+: patterns (virtual or rebound)"
+
+declare-option -hidden -docstring "Set of mappings for Clojure filetype" \
+str fzf_tag_clojure "
+: functions
+: namespaces"
+
+declare-option -hidden -docstring "Set of mappings for CMake filetype" \
+str fzf_tag_cmake "
+: functions
+: macros
+: targets
+: variable definitions
+: options specified with -D
+: projects
+: regex"
+
+declare-option -hidden -docstring "Set of mappings for C filetype" \
+str fzf_tag_c "
+: macro definitions
+: enumerators (values inside an enumeration)
+: function definitions
+: enumeration names
+: included header files
+: struct, and union members
+: structure names
+: typedefs
+: union names
+: variable definitions"
+
+declare-option -hidden -docstring "Set of mappings for C++ filetype" \
+str fzf_tag_cpp "
+: macro definitions
+: enumerators (values inside an enumeration)
+: function definitions
+: enumeration names
+: included header files
+: class, struct, and union members
+: structure names
+: typedefs
+: union names
+: variable definitions
+: classes
+: namespaces"
+
+declare-option -hidden -docstring "Set of mappings for CPreProcessor filetype" \
+str fzf_tag_cpreprocessor "
+: macro definitions
+: included header files"
+
+declare-option -hidden -docstring "Set of mappings for CSS filetype" \
+str fzf_tag_css "
+: classes
+: selectors
+: identities"
+
+declare-option -hidden -docstring "Set of mappings for C# filetype" \
+str fzf_tag_csharp "
+: classes
+: macro definitions
+: enumerators (values inside an enumeration)
+: events
+: fields
+: enumeration names
+: interfaces
+: methods
+: namespaces
+: properties
+: structure names
+: typedefs"
+
+declare-option -hidden -docstring "Set of mappings for Ctags filetype" \
+str fzf_tag_ctags "
+: language definitions
+: kind definitions"
+
+declare-option -hidden -docstring "Set of mappings for Cobol filetype" \
+str fzf_tag_cobol "
+: paragraphs
+: data items
+: source code file
+: file descriptions (FD, SD, RD)
+: group items
+: program ids
+: sections
+: divisions"
+
+declare-option -hidden -docstring "Set of mappings for CUDA filetype" \
+str fzf_tag_cuda "
+: macro definitions
+: enumerators (values inside an enumeration)
+: function definitions
+: enumeration names
+: included header files
+: struct, and union members
+: structure names
+: typedefs
+: union names
+: variable definitions"
+
+declare-option -hidden -docstring "Set of mappings for D filetype" \
+str fzf_tag_d "
+: aliases
+: classes
+: enumeration names
+: enumerators (values inside an enumeration)
+: function definitions
+: interfaces
+: class, struct, and union members
+: mixins
+: modules
+: namespaces
+: structure names
+: templates
+: union names
+: variable definitions
+: version statements"
+
+declare-option -hidden -docstring "Set of mappings for Diff filetype" \
+str fzf_tag_diff "
+: modified files
+: newly created files
+: deleted files
+: hunks"
+
+declare-option -hidden -docstring "Set of mappings for DTD filetype" \
+str fzf_tag_dtd "
+: entities
+: parameter entities
+: elements
+: attributes
+: notations"
+
+declare-option -hidden -docstring "Set of mappings for DTS filetype" \
+str fzf_tag_dts "
+: phandlers
+: labels
+: regex"
+
+declare-option -hidden -docstring "Set of mappings for DosBatch filetype" \
+str fzf_tag_dosbatch "
+: labels
+: variables"
+
+declare-option -hidden -docstring "Set of mappings for Eiffel filetype" \
+str fzf_tag_eiffel "
+: classes
+: features"
+
+declare-option -hidden -docstring "Set of mappings for Elm filetype" \
+str fzf_tag_elm "
+: Module
+: Renamed Imported Module
+: Port
+: Type Definition
+: Type Constructor
+: Type Alias
+: Functions"
+
+declare-option -hidden -docstring "Set of mappings for Erlang filetype" \
+str fzf_tag_erlang "
+: macro definitions
+: functions
+: modules
+: record definitions
+: type definitions"
+
+declare-option -hidden -docstring "Set of mappings for Falcon filetype" \
+str fzf_tag_falcon "
+: classes
+: functions
+: class members
+: variables
+: imports"
+
+declare-option -hidden -docstring "Set of mappings for Flex filetype" \
+str fzf_tag_flex "
+: functions
+: classes
+: methods
+: properties
+: global variables
+: mxtags"
+
+declare-option -hidden -docstring "Set of mappings for Fortran filetype" \
+str fzf_tag_fortran "
+: block data
+: common blocks
+: entry points
+: enumerations
+: functions
+: interface contents, generic names, and operators
+: type and structure components
+: labels
+: modules
+: type bound procedures
+: namelists
+: enumeration values
+: programs
+: subroutines
+: derived types and structures
+: program (global) and module variables
+: submodules"
+
+declare-option -hidden -docstring "Set of mappings for Fypp filetype" \
+str fzf_tag_fypp "
+: macros"
+
+declare-option -hidden -docstring "Set of mappings for Gdbinit filetype" \
+str fzf_tag_gdbinit "
+: definitions
+: toplevel variables"
+
+declare-option -hidden -docstring "Set of mappings for Go filetype" \
+str fzf_tag_go "
+: packages
+: functions
+: constants
+: types
+: variables
+: structs
+: interfaces
+: struct members
+: struct anonymous members
+: unknown
+: name for specifying imported package"
+
+declare-option -hidden -docstring "Set of mappings for HTML filetype" \
+str fzf_tag_html "
+: named anchors
+: H1 headings
+: H2 headings
+: H3 headings"
+
+declare-option -hidden -docstring "Set of mappings for Iniconf filetype" \
+str fzf_tag_iniconf "
+: sections
+: keys"
+
+declare-option -hidden -docstring "Set of mappings for ITcl filetype" \
+str fzf_tag_itcl "
+: classes
+: methods
+: object-specific variables
+: common variables
+: procedures within the class namespace"
+
+declare-option -hidden -docstring "Set of mappings for Java filetype" \
+str fzf_tag_java "
+: annotation declarations
+: classes
+: enum constants
+: fields
+: enum types
+: interfaces
+: methods
+: packages"
+
+declare-option -hidden -docstring "Set of mappings for JavaProperties filetype" \
+str fzf_tag_javaproperties "
+: keys"
+
+declare-option -hidden -docstring "Set of mappings for JavaScript filetype" \
+str fzf_tag_javascript "
+: functions
+