Skip to content

Instantly share code, notes, and snippets.

@akkartik
Created December 22, 2016 04:09
Show Gist options
  • Save akkartik/4150524bb0ad059ac4f315ffebbe74fb to your computer and use it in GitHub Desktop.
Save akkartik/4150524bb0ad059ac4f315ffebbe74fb to your computer and use it in GitHub Desktop.
My Kakoune config after 2 days of use
set global tabstop 2
set global indentwidth 2
# simulate Vim's autochdir
# since we're always running in client mode, since Kakoune doesn't do windows
# https://www.reddit.com/r/kakoune/comments/5dgpze/vimlike_autochdir_option
set global autochdir true
# simulate Vim's expandtab (poorly)
map global insert <tab> '<space><space>'
# simulate Vim's textwidth (but hardcoded to some value)
hook global BufNew .* autowrap-enable
## some Vim-like keybindings
# ctrl-w in insert mode: delete word before cursor
# not exactly like in Vim; when cursor was at end of line, positions cursor *before* preceding delimiter
map global insert <c-w> '<a-;>b<a-;>d'
# ctrl-u in insert mode: delete to start of line
# not exactly like in Vim; when cursor was at end of line, deletes line entirely and you need to hit 'enter' again
map global insert <c-u> '<left><a-;>Gh<a-;>d'
# ctrl-k in insert mode: delete to end of line
# not exactly like in Vim; when cursor was at start of line, deletes character at cursor
map global insert <c-k> '<a-;>Gl<a-;>d<right>'
## replace alt- chords for some important keys
# text object selection
map global user i <a-i>
map global user a <a-a>
map global user x <a-x>
# swap cursor and anchor
map global user ';' '<a-;>'
# join next line
map global user j <a-j>
# repeat last f
map global user . <a-.>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment