kakoune: add ctags file and project 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 %val{buffile}<ret>'
|
||||||
map global -docstring 'Open (nnn)' file-mode 'N' ': nnn-open .<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 '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
|
declare-user-mode git-mode
|
||||||
map global -docstring 'Git' user 'g' ': enter-user-mode git-mode<ret>'
|
map global -docstring 'Git' user 'g' ': enter-user-mode git-mode<ret>'
|
||||||
@@ -120,6 +122,22 @@ define-command -override git-hide-diff %{
|
|||||||
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 %{
|
||||||
|
git ls-files | xargs ctags -uo - -x | awk '{ print $1 ":" $2 ":" $3 ":" $4 }'
|
||||||
|
} 'Project symbols: ' %{
|
||||||
|
evaluate-commands %sh{ printf '%s\n' $kak_text | awk -F ':' '{ print "edit --", $4, $3 "; execute-keys /\\b" $1 "\\b<ret>" }' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F'
|
set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F'
|
||||||
|
|
||||||
# CHANGE STATUS BAR COLOR IN INSERT MODE
|
# CHANGE STATUS BAR COLOR IN INSERT MODE
|
||||||
|
|||||||
Reference in New Issue
Block a user