# source /home/joe/.config/kak/plugins/plug.kak/rc/plug.kak colorscheme gruvbox-dark # ranger-open-on-edit-directory set-option global tabstop 4 hook global WinCreate .* %{ auto-pairs-enable } hook global BufCreate .*Fastfile %{ set buffer filetype ruby } # Plugins # plug "andreyorst/plug.kak" noload # plug "danr/kakoune-easymotion" # plug "h-youhei/kakoune-surround" # plug "Delapouite/kakoune-i3" # plug "lexherbo2/auto-pairs.kak" # plug "Delapouite/kakoune-buffers" # plug "Screwtapello/kakoune-cargo" # Highlighters addhl global/ number-lines -relative -hlcursor -separator ' ' # Custom Mappings map global normal ':ranger' -docstring 'NERDTree style open ranger' map global normal , -docstring 'leader' map global normal , ':enter-user-modeeasymotion' map global user -docstring 'clear multiple selections' # Surround declare-user-mode surround map global normal \' ':enter-user-modesurround' map global surround s ':surround' -docstring 'Add Surround' map global surround c ":change-surround" -docstring 'Change Surround' map global surround d ':delete-surround' -docstring 'Delete Surround' # Map macros here map global normal ^ q map global normal Q def -params 1 extend-line-down %{ exec "%arg{1}X" } def -params 1 extend-line-up %{ exec "%arg{1}K" try %{ exec -draft ';\n' exec X } exec '' } map global normal x ':extend-line-down %val{count}' map global normal X ':extend-line-up %val{count}' # Clipboard hooks hook global NormalKey y|d|c %{ nop %sh{ printf %s "$kak_main_reg_dquote" | xsel --input --clipboard }} map global normal P '!xsel --output --clipboard' map global normal p 'xsel --output --clipboard' map global normal ': select-block' declare-user-mode window map global normal ':enter-user-modewindow' # i3wm map global window h ':i3-new-left' map global window j ':i3-new-down' map global window k ':i3-new-up' map global window l ':i3-new-right' # Comment with map global normal  ':comment-line' -docstring 'comment line' # Increase/Decrease Count # define-command -hidden -params 2 inc %{ # evaluate-commands %sh{ # if [ "$1" = 0 ] # then # count=1 # else # count="$1" # fi # printf '%s%s\n' 'exec h"_xs\dna' "$2($count)|bch" # } # } # map global normal ':inc %val{count} +' # map global normal ':inc %val{count} -' # Experimental Word Lock # source ./word-mode.kak map global normal w e map global normal W E map global normal map global normal map global normal e w map global normal E '"_s.w' map global normal map global normal '"_s.' def -hidden select-next-subword %{ exec /[A-Z][a-z]+|[A-Z]+|[a-z]+ } def -hidden extend-next-subword %{ exec ?[A-Z][a-z]+|[A-Z]+|[a-z]+ } def -hidden select-prev-subword %{ exec [A-Z][a-z]+|[A-Z]+|[a-z]+ } def -hidden extend-prev-subword %{ exec [A-Z][a-z]+|[A-Z]+|[a-z]+ } map global normal q :select-next-subword -docstring 'select to next subword' map global normal Q :extend-next-subword -docstring 'extend to next subword' map global normal :select-prev-subword -docstring 'select to previous subword' map global normal :extend-prev-subword -docstring 'extend to previous subword' # Buffers map global user b ':enter-buffers-mode' -docstring 'buffers…' map global user B ':info-buffers' -docstring 'buffer list'