kakoune: add ctags-file-symbols
This commit is contained in:
@@ -27,6 +27,8 @@ map global -docstring 'Open (recent)' file-mode 'r' ': file-open-recent<ret>'
|
||||
map global -docstring 'Open (nnn)' file-mode 'n' ': nnn-open %val{buffile}<ret>'
|
||||
map global -docstring 'Open (nnn)' file-mode 'N' ': nnn-open .<ret>'
|
||||
map global -docstring 'Open/create in dir' file-mode 'c' ': open-create-in-dir<ret>'
|
||||
map global -docstring 'ctags file symbols' file-mode 's' ': ctags-file-symbols<ret>'
|
||||
map global -docstring 'ctags project symbols' file-mode 'p' ': ctags-project-symbols<ret>'
|
||||
|
||||
declare-user-mode git-mode
|
||||
map global -docstring 'Git' user 'g' ': enter-user-mode git-mode<ret>'
|
||||
@@ -120,6 +122,23 @@ define-command -override git-hide-diff %{
|
||||
git hide-diff
|
||||
}
|
||||
|
||||
define-command -override ctags-file-symbols %{
|
||||
prompt -menu -shell-script-candidates %{
|
||||
ctags -uo - -x $kak_buffile | awk '{ print $1 ":" $2 ":" $3 }'
|
||||
} 'File symbols: ' %{
|
||||
evaluate-commands %sh{ printf '%s\n' $kak_text | awk -F ':' '{ print "execute-keys", $3, "g", "/\\b" $1 "\\b<ret>" }' }
|
||||
}
|
||||
}
|
||||
|
||||
define-command -override ctags-project-symbols %{
|
||||
prompt -menu -shell-script-candidates %{
|
||||
ctags -uo - -x $(git ls-files | grep $(printf "%s\n" $kak_buffile | awk -F '.' '{print "\\." $NF}')) | awk '{ print $1 ":" $2 ":" $3 ":" $4 }'
|
||||
} 'File symbols: ' %{
|
||||
edit -- %sh{ printf '%s\n' $kak_text | awk -F ':' '{ print $4 }' } %sh{ printf '%s\n' $kak_text | awk -F ':' '{ print $3 }' }
|
||||
evaluate-commands %sh{ printf '%s\n' $kak_text | awk -F ':' '{ print "execute-keys /\\b" $1 "\\b<ret>" }' }
|
||||
}
|
||||
}
|
||||
|
||||
set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F'
|
||||
|
||||
# CHANGE STATUS BAR COLOR IN INSERT MODE
|
||||
|
||||
Reference in New Issue
Block a user