Use an alias for the :alt command defined in cpp.kak
This commit is contained in:
parent
185b980718
commit
13ce49009d
|
@ -65,12 +65,16 @@ hook global WinSetOption filetype=cpp %[
|
||||||
hook window InsertChar \n -group cpp-indent _cpp_indent_on_new_line
|
hook window InsertChar \n -group cpp-indent _cpp_indent_on_new_line
|
||||||
hook window InsertChar \{ -group cpp-indent _cpp_indent_on_opening_curly_brace
|
hook window InsertChar \{ -group cpp-indent _cpp_indent_on_opening_curly_brace
|
||||||
hook window InsertChar \} -group cpp-indent _cpp_indent_on_closing_curly_brace
|
hook window InsertChar \} -group cpp-indent _cpp_indent_on_closing_curly_brace
|
||||||
|
|
||||||
|
alias window alt cpp-alternative-file
|
||||||
]
|
]
|
||||||
|
|
||||||
hook global WinSetOption filetype=(?!cpp).* %{
|
hook global WinSetOption filetype=(?!cpp).* %{
|
||||||
rmhl cpp
|
rmhl cpp
|
||||||
rmhooks window cpp-indent
|
rmhooks window cpp-indent
|
||||||
rmhooks window cpp-hooks
|
rmhooks window cpp-hooks
|
||||||
|
|
||||||
|
unalias window alt cpp-alternative-file
|
||||||
}
|
}
|
||||||
|
|
||||||
def -hidden _cpp_insert_include_guards %{
|
def -hidden _cpp_insert_include_guards %{
|
||||||
|
@ -81,7 +85,7 @@ hook global BufNew .*\.(h|hh|hpp|hxx|H) _cpp_insert_include_guards
|
||||||
|
|
||||||
decl str-list alt_dirs ".;.."
|
decl str-list alt_dirs ".;.."
|
||||||
|
|
||||||
def alt -docstring "Jump to the alternate file (header/implementation)" %{ %sh{
|
def cpp-alternative-file -docstring "Jump to the alternate file (header/implementation)" %{ %sh{
|
||||||
alt_dirs=$(echo ${kak_opt_alt_dirs} | sed -e 's/;/ /g')
|
alt_dirs=$(echo ${kak_opt_alt_dirs} | sed -e 's/;/ /g')
|
||||||
file=$(basename ${kak_buffile})
|
file=$(basename ${kak_buffile})
|
||||||
dir=$(dirname ${kak_buffile})
|
dir=$(dirname ${kak_buffile})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user