Last active
January 17, 2019 09:00
-
-
Save ktnyt/cc7784e890987fcdf07196f79ea6a47c to your computer and use it in GitHub Desktop.
My kakoune config.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generic Settings | |
hook global InsertChar k %{ try %{ | |
exec -draft hH <a-k>jk<ret> d | |
exec <esc> | |
}} | |
hook global WinDisplay .* info-buffers | |
hook global WinCreate ^[^*]+$ %{ add-highlighter window/ number-lines -separator ' ' } | |
# Mappings | |
map global normal 0 <a-i> | |
map global normal <c-l> vv | |
map global normal = :format<ret> -docstring 'format buffer' | |
## Buffers | |
map global normal ^ ':info-buffers<ret>' -docstring 'show buffers' | |
map global normal <c-o> ':edit<space>' | |
map global normal <ret> ':enter-buffers-mode<ret>' | |
map global normal <c-x> ':delete-buffer<ret>' | |
map global normal <c-a> ':buffer-first<ret>' | |
map global normal <c-e> ':buffer-last<ret>' | |
map global normal <c-p> ':buffer-previous<ret>' | |
map global normal <c-n> ':buffer-next<ret>' | |
# Editor config | |
hook global BufOpenFile .* %{ editorconfig-load } | |
hook global BufNewFile .* %{ editorconfig-load } | |
# Language specific hooks | |
## C++ | |
hook global WinSetOption filetype=(c|cpp) %{ | |
clang-enable-autocomplete | |
clang-enable-diagnostics | |
alias window lint clang-parse | |
alias window lint-next-error clang-diagnostics-next | |
set window formatcmd 'clang-format' | |
} | |
# Completion | |
hook global InsertCompletionShow .* %{ map window insert <tab> <c-n>; map window insert <s-tab> <c-p> } | |
hook global InsertCompletionHide .* %{ unmap window insert <tab> <c-n>; unmap window insert <s-tab> <c-p> } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment