diff --git a/.config/kak/kakrc b/.config/kak/kakrc index e31f1cc..2b63d2c 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -5,7 +5,11 @@ add-highlighter global/ show-matching set global scrolloff 5,5 -set-option global ui_options terminal_assistant=off +set global ui_options terminal_assistant=off +set -add global ui_options terminal_status_on_top=true + +# case insensitive search +map global normal / /(?i) eval %sh{ . ~/.config/river/colors @@ -16,6 +20,10 @@ eval %sh{ fi } +# ------------ +# Language Server Protocol +# ------------ + eval %sh{kak-lsp --kakoune -s $kak_session} set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log" set global lsp_diagnostic_line_error_sign '║' @@ -33,6 +41,10 @@ hook global WinSetOption filetype=(zig|go) %{ } hook global KakEnd .* lsp-exit +# ------------ +# Formateadores +# ------------ + hook global WinSetOption filetype=(javascript|typescript|json|css) %{ set-option buffer formatcmd %sh{ echo prettier --stdin-filepath $kak_buffile } hook buffer BufWritePre .* format-buffer @@ -48,10 +60,20 @@ hook global WinSetOption filetype=go %{ hook buffer BufWritePre .* format-buffer } -source "%val{config}/plugins/zig.kak/rc/zig.kak" -#hook global WinSetOption filetype=zig %{ zig-auto-run buffer } +# ------------ +# Usar Foot +# ------------ hook global KakBegin .* %{ set-option global termcmd "footclient sh -c" } +define-command fzf-terminal -params 1.. -shell-completion %{ + set-option global termcmd "footclient --app-id=fzf sh -c" + wayland-terminal %arg{@} + set-option global termcmd "footclient sh -c" +} + +# ------------ +# Keybindings genericas +# ------------ map -docstring "yank the selection into the clipboard" global user y " wl-copy" map -docstring "paste the clipboard" global user p " wl-paste --no-newline" @@ -63,6 +85,12 @@ map -docstring "hide whitespaces" global user S " :remove-highlighter global/sho map global insert '' 'b' +# https://github.com/Gigahawk/nixdots/blob/c98340cc56c998ac52f62d0df49c541bafcaaad7/dotfiles/kakrc +# - to select inner object +# = to select outer object +map global normal -- - +map global normal -- = + # ------------ # Indentación # ------------ @@ -72,6 +100,7 @@ hook global ModuleLoaded smarttab %{ set-option global softtabstop 4 } +# Sleuth es un "plugin" que detecta la identación del archivo y configura el editor para usarlo por defecto. source "%val{config}/sleuth.kak" hook -group sleuth global BufOpenFile .* %{ sleuth } hook -group sleuth global BufWritePost .* %{ sleuth } @@ -79,6 +108,7 @@ hook -group sleuth global BufWritePost .* %{ sleuth } # ------------ # FZF # ------------ + source "%val{config}/plugins/fzf.kak/rc/fzf.kak" evaluate-commands %sh{ find -L "$kak_config/plugins/fzf.kak/rc/modules/" -type f -name '*.kak' -exec printf 'source "%s"\n' {} \; @@ -97,12 +127,6 @@ map -docstring 'search files' global user f ': fzf-modef' map -docstring 'search buffers' global user b ': fzf-modeb' map -docstring 'grep files' global user g ': fzf-modeg' -define-command fzf-terminal -params 1.. -shell-completion %{ - set-option global termcmd "footclient --app-id=fzf sh -c" - wayland-terminal %arg{@} - set-option global termcmd "footclient sh -c" -} - # ------------ # Buffer switching # ------------ @@ -121,3 +145,14 @@ map global normal b ':pick-buffers' -docstring 'pick buffers' map global normal B ':enter-user-mode -lock buffers' -docstring 'buffers (lock)…' map global normal '' '' -docstring 'jump forward' + +# ------------ +# Exportar archivos Markdown a PDF +# ------------ + +define-command exportmd %{ + nop %sh{ + cd "$(dirname "$kak_buffile")" + exportmd pdf "$kak_buffile" + } +}