source "%val{config}/load.kak" # -------------------------------------------------- # PLUGINS source "%val{config}/bundle/kak-bundle/rc/kak-bundle.kak" bundle-noload kak-bundle https://codeberg.org/jdugan6240/kak-bundle # bundle auto-pairs.kak "https://github.com/alexherbo2/auto-pairs.kak" %{ # enable-auto-pairs # } bundle kak-ansi "https://github.com/eraserhd/kak-ansi" %{ hook global BufSetOption filetype=make ansi-enable hook global BufCreate \*frun\* ansi-enable } bundle kak-fastbuild "https://codeberg.org/raiguard/kak-fastbuild" bundle kak-harpoon "https://codeberg.org/raiguard/kak-harpoon" %{ harpoon-add-bindings } bundle kak-mark "https://codeberg.org/raiguard/kak-mark" %{ set-face global MarkedPrimaryCursor ,,magenta+ua set-face global MarkedPrimarySelection ,,magenta+ua set-face global MarkedSecondaryCursor ,,cyan+ua set-face global MarkedSecondarySelection ,,cyan+ua } bundle kak-mirror "https://codeberg.org/raiguard/kak-mirror" %{ map global normal = ':enter-user-mode -lock mirror' -docstring 'mirror lock' } bundle kak-move-lines "https://codeberg.org/raiguard/kak-move-lines" %{ map global normal ':move-lines-down %val{count}' map global normal ':move-lines-up %val{count}' } bundle kak-live-grep "https://codeberg.org/raiguard/kak-live-grep" %{ map global user / ":live-grep" -docstring "live grep" hook global User ColorschemeLoaded %{ set-face global LiveGrepMatch ",,rgb:%opt{orange}+u" } } bundle kak-lsp "https://github.com/kak-lsp/kak-lsp" %{ set-option global lsp_auto_highlight_references true set-option global lsp_hover_max_lines 1000 set-option global lsp_hover_anchor true set-option global lsp_snippet_support false # This breaks my muscle memory map global lsp m ":lsp-show-message-request-next" map global normal "'" ":enter-user-mode lsp" map global object a 'lsp-object' -docstring 'LSP any symbol' map global object 'lsp-object' -docstring 'LSP any symbol' map global object f 'lsp-object Function Method' -docstring 'LSP function or method' map global object t 'lsp-object Class Interface Struct' -docstring 'LSP class interface or struct' map global object d 'lsp-diagnostic-object --include-warnings' -docstring 'LSP errors and warnings' map global object D 'lsp-diagnostic-object' -docstring 'LSP errors' lsp-inlay-diagnostics-enable global lsp-auto-signature-help-enable # Custom status line declare-option -hidden str lsp_modeline_progress "" define-command -hidden -params 6 -override lsp-handle-progress %{ set-option global lsp_modeline_progress %sh{ if ! "$6"; then echo "$2${5:+" ($5%)"}${4:+": $4"}" fi } } } bundle-install-hook kak-lsp %{ cargo install --force --path . } bundle kak-rainbower "https://github.com/crizan/kak-rainbower" %{ set-option global rainbow_mode 0 set-option global rainbow_check_templates Y hook global WinCreate .* %{ rainbow-enable-window } } bundle kak-replace-mode "https://codeberg.org/raiguard/kak-replace-mode" %{ map global normal ":enter-replace-mode" } bundle kakoune-focus "https://github.com/caksoylar/kakoune-focus" %{ map global user ':focus-toggle' -docstring "toggle selections focus" } bundle kakoune-gdb "https://github.com/occivink/kakoune-gdb" %{ define-command tmux-gdb -params 1.. %{ tmux-terminal-impl 'split-window -v -l 25%' %arg{@} } # define-command custom-gdb-session-connect %{ # alias window terminal tmux-gdb # gdb-session-connect # unalias window terminal # osc-yank "new-ui mi3 %opt{gdb_dir}/pty" # gdb-enable-autojump # } # define-command -override -params .. custom-gdb-session-new %{ # alias window terminal tmux-gdb # gdb-session-new %arg{@} # unalias window terminal # gdb-enable-autojump # trigger-user-hook GDBPostInit # } # map global normal ':prompt -menu -shell-script-candidates %{ fd --type f --hidden ".*" bin } file: %{ custom-gdb-session-new %val{text} }' -docstring "new GDB session" # map global normal ":custom-gdb-session-connect" -docstring "connect to GDB session" map global normal ":gdb-toggle-breakpoint" -docstring "GDB toggle breakpoint" map global normal ":gdb-next" -docstring "GDB next" map global normal ":gdb-step" -docstring "GDB step" map global normal ":gdb-continue" -docstring "GDB continue" } bundle kakoune-grep-write "https://github.com/JacobTravers/kakoune-grep-write" %{ hook global WinSetOption filetype=(grep|lsp-goto) %{ alias buffer w grep-write } } bundle kakoune-sort-selections "https://github.com/occivink/kakoune-sort-selections" bundle kakoune-state-save "https://gitlab.com/Screwtapello/kakoune-state-save" %{ hook global KakBegin .* %{ state-save-reg-load @ } hook global KakEnd .* %{ state-save-reg-save @ } } bundle grep-expand.kak "https://github.com/JacobTravers/grep-expand.kak" bundle smarttab.kak "https://github.com/andreyorst/smarttab.kak" %{ hook global BufCreate .* %{ expandtab set-option buffer tabstop 4 set-option buffer softtabstop 4 set-option buffer indentwidth 4 } } bundle-theme kak-tokyo-night "https://codeberg.org/raiguard/kak-tokyo-night" bundle kak-search-highlight "https://codeberg.org/ficd/kak-search-highlight" %{ require-module search-highlight hook global User ColorschemeLoaded %{ set-option global search_highlight_face ",,rgb:%opt{orange}+ua" } hook global WinCreate .* %{ search-highlight-enable } } bundle secure-local-kakrc "https://codeberg.org/ficd/secure-local-kakrc" %{ require-module local-kakrc } # -------------------------------------------------- # GENERAL # Colorscheme colorscheme tokyo-night-night set-face global DiagnosticError default set-face global DiagnosticWarning default set-face global DiagnosticInfo default set-face global DiagnosticHint default set-face global InlayDiagnosticError "rgb:%opt{red}+d" set-face global InlayDiagnosticWarning "rgb:%opt{yellow}+d" set-face global InlayDiagnosticInfo "rgb:%opt{blue}+d" set-face global InlayDiagnosticHint +d@comment trigger-user-hook ColorschemeLoaded # General highlighters add-highlighter global/ number-lines -relative -separator " " -hlcursor add-highlighter global/ show-matching add-highlighter global/ line '%val{cursor_line}' SubBg add-highlighter global/ show-whitespaces -indent │ -tab "│" -tabpad " " -spc " " -lf " " -nbsp " " # UI settings set-option global ui_options terminal_assistant=off terminal_set_title=false terminal_info_max_width=100 terminal_info_inline_borders=true terminal_scroll_bar=true set-option global startup_info_version 10000000000000 # Don't show changelog set-option global scrolloff 5,5 # Scroll bar set-face global ScrollBarGutter ",rgb:%opt{subbg}" set-face global ScrollBarHandle +r@Default # Auto-reload please set-option global autoreload yes # Use ripgrep instead of grep set-option global grepcmd 'rg -Hn --no-heading --sort path --vimgrep' # More lenient make errors set-option global make_error_pattern "^\h*(?:\w:)?([^:\n]+):(\d+):(?:(\d+):)? (?:fatal )?(?:(error|warning|info|hint|note):)?([^\n]+)?" # Conveniently edit config define-command edit-kakrc %{ e ~/.config/kak/kakrc } # Convenient wrap highlighter define-command addwrap %{ add-highlighter window/wrap wrap -word -indent } # Remove trailing whitespace on save hook -group auto-trim-whitespace global BufWritePre .* %{ try %{ execute-keys -draft \%s\h+$d } } # Automatically parse modelines hook global BufOpenFile .* modeline-parse alias global terminal-floating terminal alias global terminal-overlay terminal # Add extra sway commands hook global ModuleLoaded wayland %{ set-option global termcmd 'foot sh -c' } hook global ModuleLoaded sway %{ define-command -params .. terminal-floating %{ set-option window termcmd 'foot -a foot.floating sh -c' terminal %arg{@} unset-option window termcmd } define-command -params .. -command-completion splith %{ nop %sh{ swaymsg splith } new %arg{@} } define-command -params .. -command-completion splitv %{ nop %sh{ swaymsg splitv } new %arg{@} } alias global terminal-overlay terminal-floating } # Add extra tmux commands hook global ModuleLoaded tmux %{ alias global terminal tmux-terminal-horizontal define-command -params .. terminal-floating %{ tmux-terminal-impl 'display-popup -E' %arg{@} } define-command -params .. terminal-overlay %{ tmux-terminal-window %arg{@} } define-command splitv %{ alias local terminal tmux-terminal-vertical new } define-command splith %{ alias local terminal tmux-terminal-horizontal new } } # -------------------------------------------------- # MAPPINGS # NORMAL # Comment map global normal "#" ":comment-line" map global normal "" ":comment-block" # Go to file (basic fuzzy finder) map global user f ':prompt -shell-script-candidates %{ fd --type f } file: %{ edit %val{text} }' -docstring "file" # Go to buffer map global user b ':prompt -buffer-completion buffer: %{ buffer %val{text} }' -docstring "buffer" # Pick a file with NNN map global normal ':terminal-overlay "%val{config}/nnn-pick.sh" "%val{buffile}" "%val{client}" "%val{session}"' # Pipe the primary selection to a command and echo the output to the statusline map global normal ':prompt -shell-completion echo-pipe: %{ echo %sh{ printf "%s" "$kak_selection" | $kak_text }}' # Search case-insensitive by default map global normal "/" "/(?i)" map global normal "?" "?(?i)" map global normal "" "(?i)" map global normal "" "(?i)" # Always select entire lines map global normal J "Jx" map global normal K "Kx" # Select inner line map global normal X x_ # Select all occurances of current selection in file map global normal "" "*s" -docstring "Select all matching in file" map global normal ":osc-yank" define-command -hidden osc-yank -params .. \ -docstring "yank argument or selections to terminal clipboard using OSC 52" %{ nop %sh{ if [ $# = 0 ]; then eval set -- "$kak_quoted_selections" fi copy=$1 shift for sel; do copy=$(printf '%s\n%s' "$copy" "$sel") done encoded=$(printf %s "$copy" | base64 | tr -d '\n') if [ -n "$TMUX" ]; then printf "\e]52;c;%s\a" "$encoded" > "$(tmux display-message -p '#{client_tty}')" else printf "\e]52;c;%s\a" "$encoded" > "/proc/$kak_client_pid/fd/0" fi } } map global normal ':prompt -menu -shell-script-candidates %{ fd --type f --hidden ".*" bin } file: %{ terminal lldb %val{text} }' -docstring "new LLDB session" # Jumps centered please map global normal vv map global normal vv # INSERT # Delete words in insert mode map global insert "hBd" # USER map global user n ':new edit %val{bufname}' -docstring "new window" map global user d ':osc-yank "b %val{buffile}:%val{cursor_line}"' -docstring "lldb breakpoint" # Sort declare-user-mode sort map global user s ":enter-user-mode sort" -docstring "sort..." map global sort l "|sort" -docstring "lines" map global sort s ":sort-selections" -docstring "selections" map global sort c "|sort|sed -E -e 's/,?$/,/' -e '$s/,$//'" -docstring "comma-aware lines" # Toggle declare-user-mode toggle map global user t ":enter-user-mode toggle" -docstring "toggle..." map global toggle i ':show-tab-info' -docstring "tab settings" define-command show-tab-info %{ info -title "tab settings" "tabstop: %opt{tabstop} softtabstop: %opt{softtabstop} indentwidth: %opt{indentwidth}" } map global toggle s ':show-session-info' -docstring "session info" define-command -hidden show-session-info %{ info -title "session info" "%val{client}/%val{session} %sh{pwd}" } # Git declare-user-mode git map global user g ":enter-user-mode git" -docstring "git..." map global git b ":git blame" -docstring "blame" map global git d ":git diff" -docstring "diff" map global git g ":terminal-overlay lazygit -p %sh{echo $PWD}" -docstring "lazygit" map global git u ":terminal-overlay gitu" -docstring "gitu" map global git f ":git-file-history" -docstring "file history" map global git l ":git-line-history" -docstring "line history" define-command -hidden git-line-history %{ git log "-L%val{cursor_line},+1:%val{buffile}" } define-command -hidden git-file-history %{ git log "%val{buffile}" } map global git o ":git-open-on-github" -docstring "open on GitHub" define-command git-open-on-github %{ nop %sh{ gh browse "$kak_bufname:$kak_cursor_line" & } } # Wrap paragraphs map global user w ":wrap-paragraph" -docstring "wrap paragraph" define-command wrap-paragraph %{ execute-keys "p|fold -s -w %opt{autowrap_column}|sed 's/\s*$//g'" } # IDE declare-user-mode ide map global user i ":enter-user-mode ide" -docstring "ide..." map global ide t ':set-option global toolsclient %val{client}' -docstring "set toolsclient" map global ide j ':set-option global jumpclient %val{client}' -docstring "set jumpclient" map global ide d ':set-option global docsclient %val{client}' -docstring "set docsclient" # Other map global user e ":edit -scratch" -docstring "scratch buffer" evaluate-commands %sh{ if [ -f "justfile" ]; then echo " hook global ModuleLoaded make %{ set-option global makecmd just alias global just make } " fi } # -------------------------------------------------- # FILETYPE HOOKS # Default window settings hook global BufCreate .* %{ editorconfig-load # Show and automatically update git diff on write evaluate-commands %sh{ branch=$(git -C "${kak_buffile%/*}" rev-parse --abbrev-ref HEAD 2>/dev/null) if [ -n "$branch" ]; then printf %s\\n " git show-diff hook buffer BufWritePost .* %{ git update-diff } hook buffer BufReload .* %{ git update-diff } " fi } } hook global BufSetOption filetype=(c|cpp) %{ set-option buffer lsp_servers %{ [clangd] filetypes = ["c", "cpp"] root_globs = ["compile_commands.json", ".clangd", ".git", ".hg"] command = "clangd" # args = ["--limit-references=0", "--header-insertion=never", "--pch-storage=memory"] args = ["--limit-references=0", "--header-insertion=never"] } map buffer user a ":clangd-switch-source-header" } hook global WinSetOption filetype=(c|cpp) %{ # Better highlighting add-highlighter -override "shared/%opt{filetype}/code/operator" regex (\+|-|\*|&|=|\\|\?|%|\^|\|-|!|\||->|<|>|\^|/|~|\[|\]) 0:operator add-highlighter -override "shared/%opt{filetype}/code/constant" regex \b([A-Z0-9_]*)\b 1:value add-highlighter -override "shared/%opt{filetype}/code/functioncall" regex \b([a-zA-Z0-9_]*)\( 1:function add-highlighter -override "shared/%opt{filetype}/code/illegal_operator" regex \b(and|or|not)\b 0:+r@operator # Factorio doc comments remove-highlighter "shared/%opt{filetype}/line_comment" add-highlighter "shared/%opt{filetype}/line_comment" region //[^\?] (? set-option buffer filetype factorio-changelog } } hook global BufSetOption filetype=factorio-changelog %{ add-highlighter buffer/changelog_date regex ^(Date):\s(.*?)$ 1:type 2:function add-highlighter buffer/changelog_entry regex ^(\s\s)*(-)\s(.*?)$ 2:value 3:string add-highlighter buffer/changelog_section regex "^\s*(Balancing|Bugfixes|Changes|Circuit Network|Combat Balancing|Compatibility|Control|Debug|Ease Of Use|Features|Graphics|Gui|Info|Locale|Major Features|Minor Features|Modding|Optimizations|Other|Scripting|Sounds|Translation):" 1:type add-highlighter buffer/changelog_separator regex ^-+$ 0:keyword add-highlighter buffer/changelog_version regex ^(Version):\s(\d+\.\d+\.\d+)$ 1:type 2:value } hook global BufCreate (.*locale/.*/.*\.cfg) %{ set-option buffer filetype factorio-locale } hook global BufSetOption filetype=factorio-locale %{ require-module conf add-highlighter buffer/conf ref conf add-highlighter buffer/locale_macro regex __[^\n]*?__ 0:meta add-highlighter buffer/locale_rich_text regex \[(achievement|armor|color|entity|fluid|font|gps|item|item-group|recipe|special-item|technology|tile|tooltip|train|train-stop|virtual-signal)=.*?\] 0:function add-highlighter buffer/locale_rich_text_close regex \[/(achievement|armor|color|entity|fluid|font|gps|item|item-group|recipe|special-item|technology|tile|tooltip|train|train-stop|virtual-signal)\] 0:function } hook global BufSetOption filetype=(git-commit|mail) %{ set-option buffer autowrap_column 72 set-option buffer autowrap_format_paragraph true autowrap-enable } hook global BufCreate .*[.](glsl|vert|tesc|tese|geom|frag|comp) %{ set-option buffer filetype glsl } hook global BufSetOption filetype=glsl %{ add-highlighter buffer/glsl regions add-highlighter buffer/glsl/code default-region group add-highlighter buffer/glsl/line_comment region '//' $ fill comment add-highlighter buffer/glsl/comment region '/\*' '\*/' fill comment add-highlighter buffer/glsl/code/operator regex (\+|-|\*|&|=|\\|\?|%|\^|\|-|!|\||->|<|>|\^|/|~|\[|\]) 0:operator add-highlighter buffer/glsl/code/function_call regex \b([a-zA-Z0-9_]*)\h*\( 1:function add-highlighter buffer/glsl/code/constant regex \b([A-Z0-9_]*)\b 1:value add-highlighter buffer/glsl/code/types regex \b(void|bool|int|uint|float|double|(b|i|u|d)?vec(2|3|4)|mat(2|3|4)|mat(2|3|4)x(2|3|4)|sampler(1|2|3)D)\b 1:type add-highlighter buffer/glsl/code/keyword regex \b(out|in|uniform|layout|if|else|for|struct|return)\b 1:keyword add-highlighter buffer/glsl/code/macro regex (#version) 1:meta add-highlighter buffer/glsl/code/export regex \b(gl_Position)\b 1:string } hook global BufSetOption filetype=go %{ noexpandtab set-option buffer indentwidth 0 set-option buffer tabstop 4 set-option buffer softtabstop 4 hook buffer BufWritePre .* lsp-formatting-sync map buffer user a :go-alternative-file -docstring "alternative file" } hook global BufSetOption filetype=hare %{ noexpandtab set-option buffer tabstop 8 set-option buffer softtabstop 0 set-option buffer indentwidth 0 } hook global BufSetOption filetype=java %{ set-option buffer tabstop 4 set-option buffer softtabstop 4 set-option buffer indentwidth 4 hook global BufWritePre .*\.java lsp-formatting-sync add-highlighter -override shared/java/code/operator regex (=|==|&&|\|\||\+|-|/|\*|\+=|-=|\*=|/=|!|<=|>=|<|>) 1:operator } hook global BufSetOption filetype=json %{ set-option buffer formatcmd 'jq .' } hook global BufSetOption filetype=lua %{ set-option buffer lsp_servers %exp{ # [luapls] # filetypes = ["lua"] # root_globs = [".git/", ".luarc.json", ".editorconfig", ".kakrc"] # command = "/home/rai/dev/personal/luapls/luapls" # args = ["lsp", "3"] # settings_section = "luapls" # [luapls.settings.luapls] # roots = ["demo.lua"] [emmylua_ls] filetypes = ["lua"] root_globs = [".git/", ".luarc.json", ".editorconfig", ".kakrc"] command = "emmylua_ls" # [luals] # filetypes = ["lua"] # root_globs = [".git/", ".luarc.json", ".editorconfig", ".kakrc"] # command = "/home/rai/.local/opt/lua-language-server/bin/lua-language-server" # args = ["--logpath=/home/rai/.local/state/lua-language-server/log"] # [luals.settings.Lua] # diagnostics.disable = ["lowercase-global"] # diagnostics.severity = { unused-local = "Error", undefined-global = "Error", undefined-field = "Error" } # hover.expandAlias = false # hover.previewFields = 0 # semantic.enable = false # telemetry.enable = false # workspace.userThirdParty = ["/home/rai/dev/luals"] # [fmtk-locale] # filetypes = ["factorio-locale", "lua"] # root_globs = ["info.json"] # command = "fmtk" # args = ["lsp", "--stdio"] # [fmtk-changelog] # filetypes = ["factorio-changelog", "lua"] # root_globs = ["info.json"] # command = "fmtk" # args = ["lsp", "--stdio"] } set-option buffer formatcmd "stylua -" # Only auto-format if it is our own Factorio project evaluate-commands %sh{ if [ -f "info.json" ] && [ $(jq -r ".author" < info.json) = "raiguard" ]; then echo "hook buffer BufWritePre .* format" fi } } hook global WinSetOption filetype=lua %{ # Highlight EmmyLua annotations add-highlighter window/emmylua_direct regex "---\s*(@(?:alias|as|class|enum|generic|return|type|overload))\s+([^\n]*)" 1:attribute 2:type add-highlighter window/emmylua_labeled regex "---\s*(@(?:alias|cast|field|param))\s+([a-zA-Z0-9_\?]*) ([^\n]*)" 1:attribute 2:variable 3:type add-highlighter window/emmylua_enum_variant regex '---\s*\|\s*("[^\n]*")' 1:string } hook global WinSetOption filetype=makefile %{ noexpandtab set-option window indentwidth 0 } hook global WinSetOption filetype=odin %{ noexpandtab # Better highlighting add-highlighter -override "shared/odin/code/operator" regex (\+|-|\*|&|=|\\|\?|%|\^|\|-|!|\||->|<|>|\^|/|~|\[|\]|:=) 0:operator add-highlighter -override "shared/odin/code/constant" regex \b([A-Z0-9_]*)\b 1:value add-highlighter -override "shared/odin/code/functioncall" regex \b([a-zA-Z0-9_]*)\( 1:function } hook global WinSetOption filetype=python %{ set-option window tabstop 4 set-option window softtabstop 4 set-option window indentwidth 4 set-option window formatcmd "autopep8 -" add-highlighter -override shared/python/code/functioncall regex '\b([a-zA-Z0-9_]*)\h*\(' 1:function } hook global WinSetOption filetype=rust %{ lsp-inlay-hints-enable window set-option window tabstop 4 set-option window softtabstop 4 set-option window indentwidth 4 # hook window BufWritePre .* lsp-formatting-sync } # TODO: Create a kak plugin for this filetype hook global BufCreate .+\.scd %{ set-option buffer filetype scdoc } hook global WinSetOption filetype=scdoc %{ noexpandtab set-option window autowrap_format_paragraph true autowrap-enable add-highlighter window/scdoc_header regex "^##?\s*.*?$" 0:+b add-highlighter window/scdoc_bold regex "\*.*?\*" 0:+b add-highlighter window/scdoc_underline regex "\b_.*?_\b" 0:+u } hook global WinSetOption filetype=zig %{ set-option window tabstop 4 set-option window softtabstop 4 set-option window indentwidth 4 } hook global ModuleLoaded zig %{ add-highlighter shared/zig/code/function_call regex \b([a-zA-Z0-9]+)\( 1:function add-highlighter shared/zig/code/builtin_function regex (@[a-zA-Z0-9]+)\( 1:builtin } hook global WinCreate '/tmp/\.nnn.*' %{ hook -once window WinDisplay .* %{ execute-keys '%^#;' add-highlighter window/nnn_sources regex '^#.*?\n' 0:+d@comment } } # -------------------------------------------------- # TODO Mode # Highlight TODO and other related comment tags hook global WinSetOption comment_line=(.*) %{ add-highlighter -override window/todo regex "\Q%val{hook_param_capture_1}\E\h*(TODO(?: (raiguard|branch))?:)[^\n]*" 1:string add-highlighter -override window/fixme regex "\Q%val{hook_param_capture_1}\E\h*((?:FIXME|XXX)(?: (raiguard|branch))?:)[^\n]*" 1:Error } map global toggle t ":grep '(BUG|FIXME|TODO|TEMPORARY):'" -docstring "TODOs" # -------------------------------------------------- # MODELINE # Git branch declare-option -hidden str modeline_git_branch hook global WinDisplay .* %{ set-option window modeline_git_branch %sh{ branch=$(git -C "${kak_buffile%/*}" rev-parse --abbrev-ref HEAD 2>/dev/null) if [ -n "$branch" ]; then printf "$branch " fi } } set-option global modelinefmt '{keyword}%opt{lsp_modeline_breadcrumbs}%opt{lsp_modeline_code_actions}%opt{lsp_modeline_progress}%opt{lsp_modeline_message_requests} {StatusLine}{string}%opt{modeline_git_branch}{type}%sh{ [ -n "$kak_opt_filetype" ] && echo "$kak_opt_filetype " }{default}%val{bufname}{{context_info}}{default} {{mode_info}} {meta}%val{cursor_line}:%val{cursor_char_column}' # -------------------------------------------------- # OTHER # Enable LSP # This has to be after filetype hooks in order to load those filetypes' LSP configurations. lsp-enable # Wrapper commands define-command -params .. -docstring "fmm []: fmm utility wrapper" fmm %{ fifo -name *fmm* -scroll -- fmm %arg{@} set-option buffer filetype make set-option buffer jump_current_line 0 } define-command -params .. -docstring "frun []: frun utility wrapper" frun %{ fifo -name *frun* -scroll -- frun %arg{@} set-option buffer filetype grep set-option buffer jump_current_line 0 } # Quickly test faces declare-option range-specs test_ranges define-command add-test-face -params 1 %{ set-option -add window test_ranges "%val{selection_desc}|%arg{1}" add-highlighter -override window/test_ranges ranges test_ranges } alias global tface add-test-face define-command run-selected-commands %{ evaluate-commands -itersel -draft %exp{ %val{selection} } } source "%val{config}/delete-all-buffers.kak" source "%val{config}/detect-indentation.kak" source "%val{config}/jump-stack.kak" hook global BufOpenFile ".*" %{ detect-indent-style } local-kakrc-load-if-trusted loadg filetypes *