103 lines
3.7 KiB
Plaintext
103 lines
3.7 KiB
Plaintext
# OPTIONS
|
|
|
|
set-option global startup_info_version 20260412
|
|
set-option global ui_options terminal_assistant=none
|
|
|
|
add-highlighter global/ number-lines -relative
|
|
|
|
# LOCAL
|
|
|
|
nop %sh{
|
|
mkdir -p "$kak_config/autoload"
|
|
ln -s "$kak_runtime/autoload" "$kak_config/autoload/stdlib"
|
|
}
|
|
|
|
declare-user-mode file-mode
|
|
declare-user-mode options-mode
|
|
|
|
map global -docstring "File" user 'f' ': enter-user-mode file-mode<ret>'
|
|
|
|
map global -docstring "Open (git)" file-mode 'a' ': file-open-git<ret>'
|
|
map global -docstring "Open (fd)" file-mode 'f' ': file-open<ret>'
|
|
|
|
map global -docstring "Options" user 'o' ': enter-user-mode options-mode<ret>'
|
|
|
|
map global -docstring "Light mode" options-mode 'l' ': colorscheme one-light<ret>'
|
|
map global -docstring "Dark mode" options-mode 'd' ': colorscheme one-darker<ret>'
|
|
|
|
define-command -override file-open %{
|
|
prompt -menu -shell-script-candidates %{ fd -t f } 'File: ' %{ edit -- %val{text} }
|
|
}
|
|
|
|
define-command -override file-open-git %{
|
|
prompt -menu -shell-script-candidates %{ git ls-files } 'File (git): ' %{ edit -- %val{text} }
|
|
}
|
|
|
|
# ODIN
|
|
|
|
hook global BufSetOption filetype=odin %{
|
|
set-option buffer formatcmd 'odinfmt -stdin'
|
|
}
|
|
|
|
# LSP
|
|
|
|
eval %sh{kak-lsp}
|
|
lsp-enable
|
|
|
|
set-option global modelinefmt "%opt{lsp_modeline} %opt{modelinefmt}"
|
|
|
|
map global user l ': enter-user-mode lsp<ret>' -docstring 'LSP mode'
|
|
|
|
map global goto d <esc>:lsp-definition<ret> -docstring 'LSP definition'
|
|
map global goto r <esc>:lsp-references<ret> -docstring 'LSP references'
|
|
map global goto y <esc>:lsp-type-definition<ret> -docstring 'LSP type definition'
|
|
|
|
map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
|
|
|
|
map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
|
|
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
|
|
map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
|
|
map global object t '<a-semicolon>lsp-object Class Interface Module Namespace Struct<ret>' -docstring 'LSP class or module'
|
|
map global object d '<a-semicolon>lsp-diagnostic-object error warning<ret>' -docstring 'LSP errors and warnings'
|
|
map global object D '<a-semicolon>lsp-diagnostic-object error<ret>' -docstring 'LSP errors'
|
|
|
|
# PLUGINS
|
|
|
|
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
|
|
|
plug-chain "andreyorst/plug.kak" noload %{
|
|
# noload to avoid removing by plug-clean
|
|
} plug "https://codeberg.org/raiguard/kak-one" theme config %{
|
|
# COLORSCHEME
|
|
colorscheme 'one-darker'
|
|
} plug "andreyorst/fzf.kak" config %{
|
|
# FZF
|
|
map global normal <c-p> ': fzf-mode<ret>'
|
|
} plug "h-youhei/kakoune-surround" config %{
|
|
# SURROUND
|
|
declare-user-mode surround
|
|
map global surround s ': surround<ret>' -docstring 'surround'
|
|
map global surround c ': change-surround<ret>' -docstring 'change'
|
|
map global surround d ': delete-surround<ret>' -docstring 'delete'
|
|
map global surround t ': select-surrounding-tag<ret>' -docstring 'select tag'
|
|
map global -docstring 'Surround' user 'S' ': enter-user-mode surround<ret>'
|
|
} plug "https://codeberg.org/raiguard/kak-harpoon" config %{
|
|
# HARPOON
|
|
harpoon-add-bindings
|
|
} plug https://git.sr.ht/~voroskoi/easymotion.kak config %{
|
|
# EASYMOTION
|
|
require-module easymotion
|
|
map global -docstring 'easy j' user <j> ': easymotion-j<ret>'
|
|
map global -docstring 'easy k' user <k> ': easymotion-k<ret>'
|
|
map global -docstring 'easy w' user <w> ': easymotion-w<ret>'
|
|
map global -docstring 'easy b'user <b> ': easymotion-b<ret>'
|
|
}
|
|
|
|
# FZF recent
|
|
|
|
hook global BufCreate [^*].* %{
|
|
nop %sh{
|
|
mru=~/.cache/kak-mru
|
|
echo "$kak_buffile" | awk '!seen[$0]++' - "$mru" | sponge "$mru"
|
|
}}
|