kakrc + cambiarse a Kakoune

This commit is contained in:
Cat /dev/Nulo 2021-12-16 00:50:50 -03:00
parent 8562a445c7
commit 92a98d41b5
6 changed files with 168 additions and 1 deletions

View file

@ -0,0 +1,72 @@
evaluate-commands %sh{
black="rgb:000000"
dark_gray="rgb:333333"
gray="rgb:666666"
white="rgb:FFFFFF"
whiteish="rgb:DDDDDD"
pale_blue="rgb:BBCCEE"
pale_cyan="rgb:CCEEFF"
dark_blue="rgb:222255"
dark_cyan="rgb:225555"
dark_grey="rgb:555555"
vibrant_grey="rgb:BBBBBB"
cat <<EOF
# For Code
set-face global keyword Default
set-face global attribute Default
set-face global type Default
set-face global string ${gray}
set-face global value Default
set-face global meta Default
set-face global builtin Default
set-face global module Default
set-face global comment ${gray}+i
set-face global documentation comment
set-face global function Default
set-face global operator Default
set-face global variable Default
# For markup
set-face global title +b
set-face global header Default
set-face global block Default
set-face global mono Default
set-face global link +u
set-face global list Default
set-face global bullet +b
# Built-in faces
set-face global Default ${black},${white}
set-face global PrimarySelection ${black},${pale_blue}+fg
set-face global SecondarySelection ${black},${pale_cyan}+fg
set-face global PrimaryCursor ${white},${dark_blue}+fg
set-face global SecondaryCursor ${white},${dark_cyan}+fg
set-face global PrimaryCursorEol ${white},${dark_grey}+fg
set-face global SecondaryCursorEol ${white},${vibrant_grey}+fg
set-face global StatusLine ${black},${whiteish}
set-face global StatusLineMode ${black},${whiteish}
set-face global StatusLineInfo ${black},${whiteish}
set-face global StatusLineValue ${black},${whiteish}+b
set-face global StatusCursor PrimaryCursor
set-face global Prompt ${black},${whiteish}
set-face global MenuForeground ${whiteish},${black}
set-face global MenuBackground ${black},${whiteish}
set-face global MenuInfo +i
set-face global LineNumbers ${black},${whiteish}
set-face global LineNumbersWrapped ${black},${whiteish}+i
set-face global LineNumberCursor ${black},rgb:CCCCCC+b
set-face global MatchingChar ${black},${whiteish}+b
set-face global Whitespace Default
set-face global WrapMarker ${black},${whiteish}
set-face global Information ${black},${whiteish}
set-face global Error rgb:DD0000,${whiteish}
set-face global BufferPadding Default
EOF
}

87
.config/kak/kakrc Normal file
View file

@ -0,0 +1,87 @@
# add-highlighter global/ number-lines -relative -hlcursor
add-highlighter global/ wrap -word
add-highlighter global/search dynregex '%reg{/}' 0:MatchingChar
add-highlighter global/ show-matching
colorscheme grayscale-superiority
#source "%val{config}/todo-txt.kak"
# 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 '║'
# set global lsp_diagnostic_line_warning_sign '┊'
# set global lsp_hover_anchor true
# set global lsp_auto_highlight_references true
# #set global lsp_hover_max_lines 3
# hook global WinSetOption filetype=(go|javascript|typescript|zig) %{
# map buffer user r ': lsp-rename-prompt<ret>' -docstring "LSP Rename"
# map buffer user a ': lsp-code-actions<ret>' -docstring "LSP Code actions"
# map buffer user , ': lsp-hover<ret>' -docstring "LSP hover"
# map buffer user l ': enter-user-mode lsp<ret>' -docstring "LSP mode"
# #set buffer idle_timeout 200
# #lsp-inlay-diagnostics-enable buffer
# lsp-enable-window
# #lsp-auto-hover-enable
# lsp-auto-signature-help-enable
# }
# hook global KakEnd .* lsp-exit
hook global WinSetOption filetype=(javascript|typescript|json|css|html) %{
set-option buffer formatcmd %sh{ echo prettier --stdin-filepath $kak_buffile }
hook buffer BufWritePre .* format-buffer
}
source "%val{config}/plugins/zig.kak/rc/zig.kak"
hook global WinSetOption filetype=zig %{
set-option buffer formatcmd "zig fmt --stdin"
hook buffer BufWritePre .* format-buffer
}
#hook global WinSetOption filetype=zig %{ zig-auto-run buffer }
hook global KakBegin .* %{ set-option global termcmd "footclient sh -c" }
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<ret>"
map -docstring "comment" global user c ": comment-line<ret>"
map -docstring "stop searching" global user h ": set-register slash ''<ret>"
map -docstring "show whitespaces" global user s " :add-highlighter global/show-whitespaces show-whitespaces<ret>"
map -docstring "hide whitespaces" global user S " :remove-highlighter global/show-whitespaces<ret>"
map global insert '<c-w>' '<esc>b<a-c>'
# ------------
# Indentación
# ------------
source "%val{config}/plugins/smarttab.kak/rc/smarttab.kak"
hook global ModuleLoaded smarttab %{
set-option global softtabstop 4
}
# https://github.com/mawww/kakoune/issues/2108#issuecomment-721313321
define-command sleuth -docstring 'Heuristically set buffer options' %{
try %{
evaluate-commands -draft %{
# Search the first indent level
execute-keys 'gg' '/' '^\h+' '<ret>'
# Tab vs. Space
# https://youtu.be/V7PLxL8jIl8
try %{
execute-keys '<a-k>' '\t' '<ret>'
noexpandtab
set-option buffer indentwidth 0
} catch %{
expandtab
set-option buffer indentwidth %val{selection_length}
set-option buffer softtabstop %val{selection_length}
}
}
}
}
hook -group sleuth global BufOpenFile .* %{ sleuth }
hook -group sleuth global BufWritePost .* %{ sleuth }

@ -0,0 +1 @@
Subproject commit 1dd3f33c4f65da5c13aee5d44b2e77399595830f

@ -0,0 +1 @@
Subproject commit 06ec64885d7700be5c14c4adb2d36565bbdfc59d

6
.gitmodules vendored
View file

@ -34,3 +34,9 @@
[submodule ".config/nvim/pack/plugins/start/paige"]
path = .config/nvim/pack/plugins/start/paige
url = https://git.sr.ht/~leon_plickat/paige
[submodule ".config/kak/plugins/smarttab.kak"]
path = .config/kak/plugins/smarttab.kak
url = https://github.com/andreyorst/smarttab.kak
[submodule ".config/kak/plugins/zig.kak"]
path = .config/kak/plugins/zig.kak
url = https://gitea.nulo.in/Nulo/zig.kak

View file

@ -12,7 +12,7 @@ export PATH="$HOME/go/bin:$PATH"
export MOZ_ENABLE_WAYLAND=1
export EDITOR=nvim
export EDITOR=kak
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1