Skip to content

Instantly share code, notes, and snippets.

@ktnyt
Last active January 17, 2019 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktnyt/cc7784e890987fcdf07196f79ea6a47c to your computer and use it in GitHub Desktop.
Save ktnyt/cc7784e890987fcdf07196f79ea6a47c to your computer and use it in GitHub Desktop.
My kakoune config.
# 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