AutoYADM commit: 2025-06-17 20:47:57
This commit is contained in:
parent
1f952af0ed
commit
80c399ee03
16 changed files with 476 additions and 131 deletions
|
@ -2,22 +2,101 @@
|
|||
# Author: Daniel Fichtinger <daniel@ficd.ca>
|
||||
# See README.md for explanations.
|
||||
|
||||
evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session }
|
||||
evaluate-commands %sh{kak-popup init}
|
||||
colorscheme ashen
|
||||
require-module hop-kak
|
||||
require-module fishr
|
||||
# TODO: refactor config s.t. everything defined in autoload
|
||||
# provides a module
|
||||
# Then, use an environment variable to determine whether
|
||||
# we're on a server. If we are, we don't load a bunch of
|
||||
# the modules. This lets us keep a unified config without requiring
|
||||
# all dependencies to be installed.
|
||||
|
||||
declare-option -hidden bool on_server %sh{
|
||||
if [ -z "$KAK_ON_SERVER" ]; then
|
||||
printf 'false'
|
||||
else
|
||||
printf 'true'
|
||||
fi
|
||||
}
|
||||
|
||||
define-command -override true nop
|
||||
define-command -override false fail
|
||||
|
||||
try %{
|
||||
%opt{on_server}
|
||||
colorscheme ashen-local
|
||||
} catch %{
|
||||
evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session }
|
||||
evaluate-commands %sh{kak-popup init}
|
||||
colorscheme ashen
|
||||
require-module hop-kak
|
||||
require-module fishr
|
||||
require-module title-bar
|
||||
require-module notes
|
||||
require-module plugins
|
||||
require-module yazi
|
||||
require-module luar
|
||||
set-option global luar_interpreter luajit
|
||||
# only set to foot if we are on wayland
|
||||
hook global ModuleLoaded wayland %{
|
||||
set-option global termcmd 'footclient dash -c'
|
||||
}
|
||||
# needed for tree-sitter to respect show-matching
|
||||
define-command -override tree-sitter-user-after-highlighter %{
|
||||
add-highlighter -override buffer/show-matching show-matching
|
||||
}
|
||||
|
||||
# manually requiring needed for some reason 😢
|
||||
require-module peneira
|
||||
|
||||
declare-user-mode peneira
|
||||
map -docstring %{
|
||||
Picker mode
|
||||
} global user f ': enter-user-mode peneira<ret>'
|
||||
map -docstring 'pick file' global peneira f ': peneira-files<ret>'
|
||||
map -docstring 'pick unopened file' global peneira F ': peneira-files -hide-opened<ret>'
|
||||
map -docstring %{
|
||||
pick line in buffer
|
||||
} global peneira '/' ': peneira-lines<ret>'
|
||||
define-command -override -hidden consume %{
|
||||
nop %sh{
|
||||
niri msg action consume-or-expel-window-left
|
||||
}
|
||||
}
|
||||
|
||||
define-command terminal-consume %{
|
||||
terminal dash -c 'niri msg action consume-or-expel-window-left; exec fish'
|
||||
}
|
||||
|
||||
alias global tc terminal-consume
|
||||
|
||||
define-command -docstring %{
|
||||
Create a new client in vertial split
|
||||
} new-consume %{
|
||||
new consume
|
||||
}
|
||||
|
||||
alias global nc new-consume
|
||||
alias global n new
|
||||
define-command -docstring 'open popup shell' popup-shell %{
|
||||
popup fish
|
||||
}
|
||||
alias global pp popup-shell
|
||||
|
||||
map -docstring 'popup shell' global user . ': popup-shell<ret>'
|
||||
|
||||
try %{
|
||||
evaluate-commands %sh{kak-lsp-diags}
|
||||
map -docstring 'enable diagnostic hover' global ui "'" ': lsp-diag-hover-enable<ret>'
|
||||
map -docstring 'disable diagnostic hover' global ui '"' ': lsp-diag-hover-disable<ret>'
|
||||
}
|
||||
}
|
||||
|
||||
require-module surround
|
||||
require-module ficgrep
|
||||
require-module byline
|
||||
require-module spell
|
||||
require-module title-bar
|
||||
require-module notes
|
||||
set-option global scrolloff 3,3
|
||||
require-module ui-mode
|
||||
|
||||
require-module luar
|
||||
set-option global luar_interpreter luajit
|
||||
|
||||
|
||||
try %{
|
||||
|
@ -27,24 +106,11 @@ try %{
|
|||
# disable clippy
|
||||
set-option -add global ui_options terminal_assistant=none
|
||||
|
||||
# only set to foot if we are on wayland
|
||||
hook global ModuleLoaded wayland %{
|
||||
set-option global termcmd 'footclient dash -c'
|
||||
}
|
||||
|
||||
# This gets overridden by editorconfig but we set sane default anyways
|
||||
set-option global tabstop 4
|
||||
set-option global indentwidth 4
|
||||
|
||||
# needed for tree-sitter to respect show-matching
|
||||
define-command -override tree-sitter-user-after-highlighter %{
|
||||
add-highlighter -override buffer/show-matching show-matching
|
||||
# try %{
|
||||
# remove-highlighter window/bracket
|
||||
# remove-highlighter window/regex-escaped
|
||||
# }
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=kak %{
|
||||
# make brackets gray a-la Ashen
|
||||
add-highlighter window/bracket regex [\[\]\(\)\{\}]{1} 0:rgb:737373
|
||||
|
@ -121,18 +187,6 @@ define-command -docstring "New terminal in cwd" cwd-terminal %{
|
|||
# make easy to open new shell
|
||||
alias global t cwd-terminal
|
||||
|
||||
# manually requiring needed for some reason 😢
|
||||
require-module peneira
|
||||
|
||||
declare-user-mode peneira
|
||||
map -docstring %{
|
||||
Picker mode
|
||||
} global user f ': enter-user-mode peneira<ret>'
|
||||
map -docstring 'pick file' global peneira f ': peneira-files<ret>'
|
||||
map -docstring 'pick unopened file' global peneira F ': peneira-files -hide-opened<ret>'
|
||||
map -docstring %{
|
||||
pick line in buffer
|
||||
} global peneira '/' ': peneira-lines<ret>'
|
||||
|
||||
map global normal <backspace> '"_'
|
||||
define-command goto-debug %{
|
||||
|
@ -155,26 +209,6 @@ map -docstring 'execute selection' global debug x ': exec-selection<ret>'
|
|||
define-command repl %{
|
||||
new %{ edit -scratch; set buffer filetype kak }
|
||||
}
|
||||
define-command -override -hidden consume %{
|
||||
nop %sh{
|
||||
niri msg action consume-or-expel-window-left
|
||||
}
|
||||
}
|
||||
|
||||
define-command terminal-consume %{
|
||||
terminal dash -c 'niri msg action consume-or-expel-window-left; exec fish'
|
||||
}
|
||||
|
||||
alias global tc terminal-consume
|
||||
|
||||
define-command -docstring %{
|
||||
Create a new client in vertial split
|
||||
} new-consume %{
|
||||
new consume
|
||||
}
|
||||
|
||||
alias global nc new-consume
|
||||
alias global n new
|
||||
|
||||
# jumplist
|
||||
|
||||
|
@ -184,13 +218,6 @@ map -docstring 'save to jumplist' global normal <c-v> <c-s>
|
|||
# selection saving
|
||||
map -docstring 'add selection' global normal Y <a-Z>a
|
||||
|
||||
define-command -docstring 'open popup shell' popup-shell %{
|
||||
popup fish
|
||||
}
|
||||
alias global pp popup-shell
|
||||
|
||||
map -docstring 'popup shell' global user . ': popup-shell<ret>'
|
||||
|
||||
# hook -once global ClientCreate .* %{
|
||||
# evaluate-commands %sh{
|
||||
# if [ "$kak_buflist" != "*debug* *scratch*" ]; then
|
||||
|
@ -202,8 +229,3 @@ map -docstring 'popup shell' global user . ': popup-shell<ret>'
|
|||
# }
|
||||
# }
|
||||
|
||||
try %{
|
||||
evaluate-commands %sh{kak-lsp-diags}
|
||||
map -docstring 'enable diagnostic hover' global ui "'" ': lsp-diag-hover-enable<ret>'
|
||||
map -docstring 'disable diagnostic hover' global ui '"' ': lsp-diag-hover-disable<ret>'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue