Created
April 23, 2019 15:29
-
-
Save clementd-fretlink/2db93d6692136b75492b2795b304a4d3 to your computer and use it in GitHub Desktop.
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
set-option global startup_info_version 0 | |
set-option global ui_options ncurses_assistant=none | |
add-highlighter global/ number-lines | |
colorscheme zenburn | |
source ~/.config/kak/fuzzy.kak | |
source ~/.config/kak/purescript.kak | |
source ~/.config/kak/dhall.kak | |
## Editor config | |
hook global BufCreate .* %{editorconfig-load} | |
## LSP SETUP | |
eval %sh{kak-lsp --kakoune -s $kak_session } | |
nop %sh{ (kak-lsp -s $kak_session -vvv ) > /dev/null 2>&1 < /dev/null & } | |
# display info inline | |
set global lsp_hover_anchor true | |
# Quick access for common commands | |
map -docstring "query type under cursor" global user t :lsp-hover<ret> | |
map -docstring "jump to another buffer" global user b :fuzzy-buffer<ret> | |
map -docstring "jump to another file" global user e :fuzzy-edit<ret> | |
map -docstring "jump to last buffer" global user , ga | |
map -docstring "save current buffer" global user n :w<ret> | |
map -docstring "save all buffers" global user N :write-all<ret> | |
map -docstring "quit" global user q :q<ret> | |
map -docstring "save all buffers and quit" global user Q :write-all-quit<ret> | |
# Use rg instead of grep -rHn | |
set-option global grepcmd rg | |
# Haskell: use stylish-haskell as formatter | |
hook global BufWritePre .*[.](hs) %{ | |
set-option buffer formatcmd stylish-haskell | |
format | |
} | |
hook global BufWritePost .* %{ | |
git show-diff # ToDo put show-diff only on WinOpen and use update-diff on BufWritePost | |
} | |
# Old habits die hard | |
alias global x write-quit | |
alias global xa write-all-quit | |
# Try reading project-specific config files | |
try %{ source .kakrc.local } | |
map -docstring "hardwrap current selection" global user f "|fmt -w%opt{autowrap_column}<ret>" | |
# Enable soft-wrapping | |
add-highlighter global/ wrap -word -indent -width 180 -marker ' ↪ ' | |
# Display hidden chars | |
add-highlighter global/ show-whitespaces -lf ' ' -only-trailing | |
add-highlighter global/ show-whitespaces -spc ' ' # display non-trailing tabs and nbsps | |
hook global NormalKey y|d|c %{ nop %sh{ | |
#printf %s "$kak_reg_dquote" | sed "s/''/'/g" | sed "s/\(^'\|'$\)//g" | xsel --input --primary | |
printf %s "$kak_main_reg_dquote" | xsel --input --primary | |
}} | |
# Use tab to cycle through completion results | |
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> } | |
# use spaces instead of tabs | |
map global insert <tab> '<a-;><gt>' | |
map global insert <s-tab> '<a-;><lt>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment