summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-10-12 18:51:27 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-10-12 18:51:27 +0100
commit7a2afbcf489c40c1f7aa6a331dcd4ce11d0cfbcc (patch)
tree0293d1c5c60ab375c2bc5b242c1d58500e572950
parentff27b385d28e2afedc092e17c8e2b32e6c42fdd0 (diff)
Add support for a ctagsfiles option that lists all tags to read from
Results from all tags will be merged Fixes #22
-rw-r--r--rc/ctags.kak9
1 files changed, 8 insertions, 1 deletions
diff --git a/rc/ctags.kak b/rc/ctags.kak
index 8d9d96cd..4d84aad7 100644
--- a/rc/ctags.kak
+++ b/rc/ctags.kak
@@ -3,13 +3,20 @@
# This script requires the readtags command available in ctags source but
# not installed by default
+decl str-list ctagsfiles 'tags'
+
def -shell-params \
-shell-completion 'readtags -p "$1" | cut -f 1 | sort | uniq' \
-docstring 'jump to tag definition' \
tag \
%{ %sh{
export tagname=${1:-${kak_selection}}
- readtags ${tagname} | awk -F '\t|\n' -e '
+ (
+ IFS=':'
+ for tags in ${kak_opt_ctagsfiles}; do
+ readtags -t "${tags}" ${tagname}
+ done
+ ) | awk -F '\t|\n' -e '
/[^\t]+\t[^\t]+\t\/\^.*\$\// {
re=$0; sub(".*\t/\\^", "", re); sub("\\$/.*", "", re); gsub("(\\{|\\}).*$", "", re);
out = out " %{" $2 " [" re "]} %{try %{ edit %{" $2 "}; exec %{/\\Q" re "<ret>vc} } catch %{ echo %{unable to find tag} } }"