kak: Ordenar config y agregar varias cosas

This commit is contained in:
Cat /dev/Nulo 2022-03-13 17:51:05 -03:00
parent c7c5f72d49
commit cdabfe2db5

View file

@ -5,7 +5,11 @@ add-highlighter global/ show-matching
set global scrolloff 5,5 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{ eval %sh{
. ~/.config/river/colors . ~/.config/river/colors
@ -16,6 +20,10 @@ eval %sh{
fi fi
} }
# ------------
# Language Server Protocol
# ------------
eval %sh{kak-lsp --kakoune -s $kak_session} 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_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log"
set global lsp_diagnostic_line_error_sign '║' set global lsp_diagnostic_line_error_sign '║'
@ -33,6 +41,10 @@ hook global WinSetOption filetype=(zig|go) %{
} }
hook global KakEnd .* lsp-exit hook global KakEnd .* lsp-exit
# ------------
# Formateadores
# ------------
hook global WinSetOption filetype=(javascript|typescript|json|css) %{ hook global WinSetOption filetype=(javascript|typescript|json|css) %{
set-option buffer formatcmd %sh{ echo prettier --stdin-filepath $kak_buffile } set-option buffer formatcmd %sh{ echo prettier --stdin-filepath $kak_buffile }
hook buffer BufWritePre .* format-buffer hook buffer BufWritePre .* format-buffer
@ -48,10 +60,20 @@ hook global WinSetOption filetype=go %{
hook buffer BufWritePre .* format-buffer 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" } 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 "<a-|> wl-copy<ret>" map -docstring "yank the selection into the clipboard" global user y "<a-|> wl-copy<ret>"
map -docstring "paste the clipboard" global user p "<a-!> wl-paste --no-newline<ret>" map -docstring "paste the clipboard" global user p "<a-!> wl-paste --no-newline<ret>"
@ -63,6 +85,12 @@ map -docstring "hide whitespaces" global user S " :remove-highlighter global/sho
map global insert '<c-w>' '<esc>b<a-c>' map global insert '<c-w>' '<esc>b<a-c>'
# https://github.com/Gigahawk/nixdots/blob/c98340cc56c998ac52f62d0df49c541bafcaaad7/dotfiles/kakrc
# - to select inner object
# = to select outer object
map global normal -- - <a-i>
map global normal -- = <a-a>
# ------------ # ------------
# Indentación # Indentación
# ------------ # ------------
@ -72,6 +100,7 @@ hook global ModuleLoaded smarttab %{
set-option global softtabstop 4 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" source "%val{config}/sleuth.kak"
hook -group sleuth global BufOpenFile .* %{ sleuth } hook -group sleuth global BufOpenFile .* %{ sleuth }
hook -group sleuth global BufWritePost .* %{ sleuth } hook -group sleuth global BufWritePost .* %{ sleuth }
@ -79,6 +108,7 @@ hook -group sleuth global BufWritePost .* %{ sleuth }
# ------------ # ------------
# FZF # FZF
# ------------ # ------------
source "%val{config}/plugins/fzf.kak/rc/fzf.kak" source "%val{config}/plugins/fzf.kak/rc/fzf.kak"
evaluate-commands %sh{ evaluate-commands %sh{
find -L "$kak_config/plugins/fzf.kak/rc/modules/" -type f -name '*.kak' -exec printf 'source "%s"\n' {} \; 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-mode<ret>f'
map -docstring 'search buffers' global user b ': fzf-mode<ret>b' map -docstring 'search buffers' global user b ': fzf-mode<ret>b'
map -docstring 'grep files' global user g ': fzf-mode<ret>g' map -docstring 'grep files' global user g ': fzf-mode<ret>g'
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 # Buffer switching
# ------------ # ------------
@ -121,3 +145,14 @@ map global normal b ':pick-buffers<ret>' -docstring 'pick buffers'
map global normal B ':enter-user-mode -lock buffers<ret>' -docstring 'buffers (lock)…' map global normal B ':enter-user-mode -lock buffers<ret>' -docstring 'buffers (lock)…'
map global normal '<c-p>' '<tab>' -docstring 'jump forward' map global normal '<c-p>' '<tab>' -docstring 'jump forward'
# ------------
# Exportar archivos Markdown a PDF
# ------------
define-command exportmd %{
nop %sh{
cd "$(dirname "$kak_buffile")"
exportmd pdf "$kak_buffile"
}
}