2024-09-02 21:34:45 +00:00
|
|
|
#________ colorscheme _______
|
|
|
|
source "%val{config}/colorscheme.kak"
|
|
|
|
|
|
|
|
#________ options ___________
|
|
|
|
# keep status bar in the default place
|
2024-03-08 14:32:05 +00:00
|
|
|
set-option -add global ui_options terminal_status_on_top=false
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# set an invisible padding char
|
2024-03-08 14:32:05 +00:00
|
|
|
set-option -add global ui_options terminal_padding_char=
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# always keep two lines and two columns displayed around the cursor
|
2024-03-08 14:32:05 +00:00
|
|
|
set-option global scrolloff 2,2
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# assistant
|
2024-03-08 14:32:05 +00:00
|
|
|
set-option -add global ui_options terminal_assistant=cat
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# __________ commands __________
|
2024-03-08 14:32:05 +00:00
|
|
|
define-command -override lf-open \
|
|
|
|
-docstring 'pick a file with lf' %{
|
2024-09-02 21:34:45 +00:00
|
|
|
terminal /bin/sh -c %{
|
2024-03-08 14:32:05 +00:00
|
|
|
# Local variables
|
|
|
|
kak_buffile=$1 kak_session=$2 kak_client=$3
|
|
|
|
|
|
|
|
# Create temporary file for selection
|
|
|
|
lf_tmp=$(mktemp "${TMPDIR:-/tmp}"/lf-open.XXXXXXXXXX)
|
|
|
|
|
|
|
|
# Get working directory of current buffer
|
|
|
|
kak_pwd=$(dirname "${kak_buffile}")
|
|
|
|
|
|
|
|
# Pick a file with lf
|
|
|
|
$(lf -selection-path "${lf_tmp}" "${kak_pwd}")
|
|
|
|
|
|
|
|
# Get first line of selection file (ignoring multiple selections)
|
|
|
|
filename=$(head -n 1 "${lf_tmp}")
|
|
|
|
|
|
|
|
# Only echo a command back if there was a selection
|
|
|
|
if [ -n "$filename" ]; then
|
|
|
|
# Construct the command to pass to kakoune
|
|
|
|
kak_cmd="evaluate-commands -client $kak_client edit $filename"
|
|
|
|
|
|
|
|
# Echo the command back to the parent session
|
|
|
|
echo $kak_cmd | kak -p $kak_session
|
|
|
|
fi
|
|
|
|
} -- %val{buffile} %val{session} %val{client}
|
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override todo \
|
|
|
|
-docstring 'edit todo list' %{
|
2024-09-02 21:34:45 +00:00
|
|
|
edit '~/areas/meta/todo'
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override guix-todo \
|
|
|
|
-docstring 'edit todo list' %{
|
2024-09-02 21:34:45 +00:00
|
|
|
edit '~/projects/code/org/guix-todo/todo.org'
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str radix '~/projects/code/scm/radix'
|
|
|
|
define-command -override radix \
|
|
|
|
-docstring 'edit files in the radix git repository' %{
|
|
|
|
execute-keys ":e %opt{radix}/"
|
|
|
|
}
|
|
|
|
|
2024-05-05 18:13:48 +00:00
|
|
|
declare-option str radix_modules "%opt{radix}/radix"
|
2024-03-08 14:32:05 +00:00
|
|
|
define-command -override modules \
|
|
|
|
-docstring 'edit radix modules' %{
|
|
|
|
execute-keys ":e %opt{radix_modules}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str radix_services "%opt{radix_modules}/services"
|
|
|
|
define-command -override services \
|
|
|
|
-docstring 'edit radix services' %{
|
|
|
|
execute-keys ":e %opt{radix_services}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str radix_packages "%opt{radix_modules}/packages"
|
|
|
|
define-command -override packages \
|
|
|
|
-docstring 'edit radix packages' %{
|
|
|
|
execute-keys ":e %opt{radix_packages}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str radix_home_services "%opt{radix_modules}/home/services"
|
|
|
|
define-command -override home-services \
|
|
|
|
-docstring 'edit radix home services' %{
|
|
|
|
execute-keys ":e %opt{radix_home_services}/"
|
|
|
|
}
|
|
|
|
|
2024-05-05 18:13:48 +00:00
|
|
|
declare-option str zero '~/projects/code/scm/zero'
|
|
|
|
define-command -override zero \
|
|
|
|
-docstring 'edit files in the zero git repository' %{
|
|
|
|
execute-keys ":e %opt{zero}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str home "%opt{zero}/home-environments"
|
|
|
|
define-command -override home \
|
|
|
|
-docstring 'edit home declaration' %{
|
|
|
|
execute-keys ":e %opt{home}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str system "%opt{zero}/operating-systems"
|
|
|
|
define-command -override system \
|
|
|
|
-docstring 'edit system declaration' %{
|
|
|
|
execute-keys ":e %opt{system}/"
|
|
|
|
}
|
|
|
|
|
|
|
|
declare-option str home_files "%opt{home}/%sh{whoami}/files"
|
|
|
|
define-command -override files \
|
|
|
|
-docstring 'edit dotfiles' %{
|
|
|
|
execute-keys ":e %opt{home_files}/"
|
|
|
|
}
|
|
|
|
|
2024-03-08 14:32:05 +00:00
|
|
|
define-command -override colorscheme-config \
|
|
|
|
-docstring 'edit colorscheme configuration file' %{
|
2024-05-05 18:13:48 +00:00
|
|
|
edit "%opt{home_files}/.config/kak/autoload/colorscheme.kak"
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override config \
|
|
|
|
-docstring 'edit kakoune main configuration file' %{
|
2024-05-05 18:13:48 +00:00
|
|
|
edit "%opt{home_files}/.config/kak/kakrc"
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override rss \
|
|
|
|
-docstring 'edit rss feeds file' %{
|
2024-05-05 18:13:48 +00:00
|
|
|
edit "%opt{home_files}/.config/newsraft/feeds"
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override remind \
|
|
|
|
-docstring 'edit reminders' %{
|
|
|
|
execute-keys ': e /home/radio/.local/share/reminders/'
|
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override open-buffer-picker \
|
|
|
|
-docstring 'open-buffer-picker: Opens buffer picker.' %{
|
|
|
|
prompt buffer: -buffer-completion %{ buffer %val{text} }
|
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override toggle-readonly \
|
|
|
|
-docstring 'changes buffer readonly option current state' %{
|
|
|
|
set-option buffer readonly %sh{ "$kak_opt_readonly" && echo false || echo true }
|
|
|
|
}
|
|
|
|
|
|
|
|
define-command -override qalc \
|
|
|
|
-params .. %{echo %sh{qalc ${@}}} \
|
|
|
|
-docstring 'compute equation with Qalculate!'
|
|
|
|
complete-command qalc shell-script-candidates %{
|
|
|
|
{ echo $(qalc --list-functions | head -n -3)
|
|
|
|
echo $(qalc --list-variables | head -n -3) } | tr ' ' '\n' | sort | uniq
|
|
|
|
}
|
|
|
|
|
|
|
|
define-command diff-buffers -override -params 2 \
|
|
|
|
-docstring 'show the diff of two buffers'%{
|
|
|
|
evaluate-commands %sh{
|
|
|
|
file1=$(mktemp)
|
|
|
|
file2=$(mktemp)
|
|
|
|
echo "
|
|
|
|
evaluate-commands -buffer '$1' write -force $file1
|
|
|
|
evaluate-commands -buffer '$2' write -force $file2
|
|
|
|
edit! -scratch *diff-buffers*
|
|
|
|
set buffer filetype diff
|
|
|
|
set-register | 'diff -u $file1 $file2; rm $file1 $file2'
|
|
|
|
execute-keys !<ret>gg
|
|
|
|
"
|
2024-09-02 21:34:45 +00:00
|
|
|
}
|
|
|
|
}
|
2024-03-08 14:32:05 +00:00
|
|
|
complete-command diff-buffers buffer
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# __________ hidden commands __________
|
|
|
|
define-command -override -hidden edit-from-here %{
|
2024-03-08 14:32:05 +00:00
|
|
|
execute-keys ":edit %sh{dirname $kak_buffile}/"
|
2024-09-02 21:34:45 +00:00
|
|
|
} # edit a file, searching from current file's directory
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
define-command -override -hidden spawn-terminal-here %{
|
2024-03-08 14:32:05 +00:00
|
|
|
set-register b "%sh{pwd}"
|
|
|
|
change-directory "%sh{dirname $kak_buffile}"
|
2024-09-02 21:34:45 +00:00
|
|
|
evaluate-commands "terminal %sh{echo $SHELL}"
|
2024-03-08 14:32:05 +00:00
|
|
|
change-directory "%reg{b}"
|
|
|
|
} # Spawn a terminal in the current buffer's file directory
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# __________ mappings __________
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
## buffer navigation
|
|
|
|
try %{ declare-user-mode buffer }
|
|
|
|
map global normal <esc> ': enter-user-mode buffer<ret>' \
|
|
|
|
-docstring 'enter buffer user mode'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global buffer h ': buffer-previous<ret>' \
|
|
|
|
-docstring 'move to the previous buffer in the list'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global buffer l ': buffer-next<ret>' \
|
|
|
|
-docstring 'move to the next buffer in the list'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global buffer q ': delete-buffer<ret>' \
|
|
|
|
-docstring 'delete current buffer'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global buffer Q ': delete-buffer!<ret>' \
|
|
|
|
-docstring 'delete current buffer (force)'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global goto b '<a-;>: pick-buffers<ret>' \
|
|
|
|
-docstring 'buffer'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
## git operations
|
|
|
|
try %{ declare-user-mode git }
|
|
|
|
map global user g ': enter-user-mode git<ret>' \
|
|
|
|
-docstring 'enter git user mode'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global git l ': git log<ret>' \
|
|
|
|
-docstring 'log'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global git c ': git commit<ret>' \
|
|
|
|
-docstring 'commit'
|
|
|
|
|
|
|
|
map global git d ': git diff<ret>' \
|
|
|
|
-docstring 'diff'
|
|
|
|
|
|
|
|
map global git s ': git status<ret>' \
|
|
|
|
-docstring 'status'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global git h ': git show-diff<ret>' \
|
|
|
|
-docstring 'show diff'
|
|
|
|
|
|
|
|
map global git H ': git-hide-diff<ret>' \
|
|
|
|
-docstring 'hide diff'
|
|
|
|
|
|
|
|
## open selection operations
|
2024-03-08 14:32:05 +00:00
|
|
|
try %{ declare-user-mode open-sel }
|
|
|
|
map global user o ': enter-user-mode open-sel<ret>' \
|
|
|
|
-docstring 'enter open-sel user mode'
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global open-sel b '$ $BROWSER $kak_reg_dot & disown<ret>' \
|
|
|
|
-docstring "on %sh{echo $BROWSER}"
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global open-sel i '$ imv $kak_reg_dot & disown<ret>' \
|
|
|
|
-docstring 'on imv'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global open-sel s '$ sioyek $kak_reg_dot & disown<ret>' \
|
|
|
|
-docstring 'on sioyek'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global open-sel m '$ mpv $kak_reg_dot & disown<ret>' \
|
|
|
|
-docstring 'on mpv'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
## surrounding operations
|
|
|
|
map global object <ret> 'c\n,\n<ret>'\
|
|
|
|
-docstring 'newlines'
|
|
|
|
map global object <space> 'c<space>,<space><ret>'\
|
|
|
|
-docstring 'spaces'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
### operations relative to current file's directory
|
|
|
|
map global user <ret> ': spawn-terminal-here<ret>' \
|
|
|
|
-docstring "open a new terminal within the current file's directory"
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global user e ": edit-from-here<ret>" \
|
|
|
|
-docstring "edit a file, searching from current file's directory"
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
### comments
|
|
|
|
map global user c ': comment-line<ret>' \
|
|
|
|
-docstring 'comment-line'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global user C ': comment-block<ret>' \
|
|
|
|
-docstring 'comment-block'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
map global user d ': lf-open<ret>' \
|
|
|
|
-docstring 'pick a file with lf'
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
### entering user modes
|
|
|
|
map global user s ': enter-user-mode surround<ret>' \
|
|
|
|
-docstring 'enter surround user mode'
|
|
|
|
|
|
|
|
map global user l ': enter-user-mode lsp<ret>' \
|
|
|
|
-docstring 'enter lsp user mode'
|
|
|
|
|
|
|
|
### remind
|
|
|
|
map global user r ': remind<ret>' \
|
|
|
|
-docstring 'edit reminders'
|
|
|
|
|
|
|
|
# __________ hooks __________
|
2024-03-08 14:32:05 +00:00
|
|
|
hook -group config global BufCreate 'kakrc' %{
|
|
|
|
set-option buffer filetype kak
|
2024-09-02 21:34:45 +00:00
|
|
|
} # set kakrc's filetype to kak
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
hook global BufCreate '\*scratch\*' %{
|
|
|
|
execute-keys '%<a-d>'
|
2024-09-02 21:34:45 +00:00
|
|
|
add-highlighter buffer/ wrap -indent -word -marker '↩'
|
|
|
|
add-highlighter buffer/ show-whitespaces -indent '' -tab '→'
|
|
|
|
} # remove the *scratch* message, and set highlighters
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
hook global BufCreate .* %{
|
|
|
|
add-highlighter buffer/ number-lines -relative -hlcursor
|
2024-09-02 21:34:45 +00:00
|
|
|
} # set relative line numbers and visual line break
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-05-05 18:13:48 +00:00
|
|
|
hook global BufWritePost ".*/.config/kak/kakrc" %{
|
2024-03-08 14:32:05 +00:00
|
|
|
source "%val{buffile}"
|
2024-09-02 21:34:45 +00:00
|
|
|
} # source kakrc on save
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
hook global BufWritePost "%val{config}/colorscheme.kak" %{
|
|
|
|
source "%val{config}/colorscheme.kak"
|
2024-03-08 14:32:05 +00:00
|
|
|
evaluate-commands palette-gutter
|
2024-09-02 21:34:45 +00:00
|
|
|
} # automatically source colorscheme.kak on save
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
hook global BufOpenFile "%val{config}/colorscheme.kak" %{
|
2024-03-08 14:32:05 +00:00
|
|
|
evaluate-commands palette-gutter
|
2024-09-02 21:34:45 +00:00
|
|
|
} # display faces in the colorscheme file
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
hook global BufOpenFile .* %{
|
2024-05-30 19:15:28 +00:00
|
|
|
add-highlighter buffer/ wrap -word -marker '↩'
|
|
|
|
add-highlighter buffer/ show-whitespaces -indent '' -tab '→'
|
2024-09-02 21:34:45 +00:00
|
|
|
} # set highlighters for file buffers
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
hook global BufOpenFile .*\.typ %{
|
|
|
|
set-option buffer filetype typst
|
|
|
|
}
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
hook global InsertCompletionShow .* %{
|
|
|
|
map window insert <tab> <c-n>
|
|
|
|
map window insert <s-tab> <c-p>
|
|
|
|
}
|
|
|
|
hook global InsertCompletionHide .* %{
|
|
|
|
map window insert <tab> <c-n>
|
|
|
|
map window insert <s-tab> <c-p>
|
2024-09-02 21:34:45 +00:00
|
|
|
} # use tab for completion movement
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-05-05 18:13:48 +00:00
|
|
|
try %{ declare-option str line_comment_token '' }
|
2024-03-08 14:32:05 +00:00
|
|
|
hook -group config global BufSetOption filetype=kak %{
|
|
|
|
set-option buffer indentwidth 2
|
|
|
|
set-option buffer line_comment_token '#'
|
|
|
|
} # Kakscript comment tokens
|
|
|
|
|
|
|
|
hook -group config global BufSetOption filetype=scheme %{
|
|
|
|
set-option buffer indentwidth 2
|
|
|
|
set-option buffer line_comment_t ';;'
|
|
|
|
set-option buffer block_comment_tokens '#|' '|#'
|
|
|
|
} # Scheme comment tokens
|
|
|
|
|
|
|
|
hook -group config global BufSetOption filetype=(c|cpp) %{
|
|
|
|
set-option window formatcmd 'clazy'
|
|
|
|
set-option buffer line_comment_token '//'
|
|
|
|
set-option buffer block_comment_tokens '/*' '*/'
|
|
|
|
} # C and C++ comment tokens
|
|
|
|
|
|
|
|
hook -group config global BufSetOption filetype=(sh|dash) %{
|
|
|
|
set-option window formatcmd 'shfmt'
|
|
|
|
set-option window lintcmd 'shellharden'
|
|
|
|
set-option buffer line_comment_token '#'
|
|
|
|
set-option buffer block_comment_tokens "<<'####'" '###'
|
|
|
|
} # Shell comment tokens
|
|
|
|
|
|
|
|
hook -group config global BufSetOption filetype=zig %{
|
|
|
|
set-option buffer line_comment_token '//'
|
|
|
|
} # Zig comment tokens
|
|
|
|
|
|
|
|
hook global WinSetOption filetype=kak %{
|
|
|
|
hook global NormalIdle .* %{
|
|
|
|
evaluate-commands -save-regs 'a' %{
|
|
|
|
try %{
|
|
|
|
execute-keys -draft <a-i>w"ay
|
|
|
|
evaluate-commands %sh{ (
|
|
|
|
color="${kak_reg_a}"
|
|
|
|
inverted_color=$(echo "${color}" | perl -pe 'tr/0123456789abcdefABCDEF/fedcba9876543210543210/')
|
|
|
|
printf "%s\n" "evaluate-commands -client $kak_client %{ try %{
|
|
|
|
echo -markup %{{rgb:${inverted_color},rgb:${color}+b} #${color} }
|
|
|
|
}}" | kak -p $kak_session
|
|
|
|
) >/dev/null 2>&1 </dev/null &
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# __________ plugins __________
|
2024-03-08 14:32:05 +00:00
|
|
|
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
2024-09-02 21:34:45 +00:00
|
|
|
plug "andreyorst/plug.kak" noload # manually installed plugin manager
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# configure this
|
|
|
|
plug "occivink/kakoune-phantom-selection" # work on multiple selections, one at a time
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
plug "maximbaz/surround.kak" # easily surround selections with parentesis or quotes
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
plug "https://gitlab.com/Screwtapello/kakoune-texinfo" # read info pages inside kakoune
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
plug "https://gitlab.com/Screwtapello/kakoune-state-save" config %{
|
|
|
|
hook global KakBegin .* %{
|
|
|
|
evaluate-commands 'state-save-reg-load colon'
|
|
|
|
evaluate-commands 'state-save-reg-load pipe'
|
|
|
|
evaluate-commands 'state-save-reg-load slash'
|
|
|
|
}
|
|
|
|
|
|
|
|
hook global KakEnd .* %{
|
|
|
|
evaluate-commands 'state-save-reg-save colon'
|
|
|
|
evaluate-commands 'state-save-reg-save pipe'
|
|
|
|
evaluate-commands 'state-save-reg-save slash'
|
|
|
|
}
|
2024-09-02 21:34:45 +00:00
|
|
|
} # save and restore state between sessions
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# plug "https://codeberg.org/anemofilia/relapath.kak" demand relapath %{
|
|
|
|
# alias global cd relapath-change-directory
|
|
|
|
# alias global e relapath-edit
|
|
|
|
# alias global e! relapath-edit-bang
|
|
|
|
#
|
|
|
|
# alias global change-directory relapath-change-directory
|
|
|
|
# alias global edit relapath-edit
|
|
|
|
# alias global edit! relapath-edit-bang
|
|
|
|
# alias global rename-buffer relapath-rename-buffer
|
|
|
|
#
|
|
|
|
# relapath-modelinefmt-replace global
|
|
|
|
# } # no dereference symlinks
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
plug 'delapouite/kakoune-buffers' # ease navigation between opened buffers.
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
plug "https://gitlab.com/Screwtapello/kakoune-texinfo.git" # texinfo
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
plug "jpcornwell/kakoune-sokoban" # sokoban because yes
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
plug "lePerdu/kakboard" config %{
|
|
|
|
hook global WinCreate .* %{ kakboard-enable }
|
2024-09-02 21:34:45 +00:00
|
|
|
} # sync clipboards
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
plug "JJK96/kakoune-rainbow"
|
2024-09-02 21:34:45 +00:00
|
|
|
set-option global rainbow_opening "[[(]"
|
2024-03-08 14:32:05 +00:00
|
|
|
declare-option str-list rainbow_faces "rgb:a790d3" "rgb:6cdae0" "rgb:ff7f50" \
|
|
|
|
"rgb:ffea8c" "rgb:83dcaf" "rgb:eba4d4" \
|
|
|
|
"rgb:8b5be7"
|
2024-09-02 21:34:45 +00:00
|
|
|
# add coloring to matching parenthesis
|
2024-03-08 14:32:05 +00:00
|
|
|
|
|
|
|
plug "alexherbo2/auto-pairs.kak" config %{
|
2024-09-02 21:34:45 +00:00
|
|
|
set-option global auto_pairs ( ) { } [ ] '"' '"' "'" "'" ` `
|
|
|
|
hook -group config global BufSetOption filetype=latex %{
|
|
|
|
set-option buffer auto_pairs ( ) [ ] { } '"' '"' $ $
|
|
|
|
}
|
2024-05-05 18:13:48 +00:00
|
|
|
hook -group config global BufSetOption filetype=scheme %{
|
2024-09-02 21:34:45 +00:00
|
|
|
set-option buffer auto_pairs ( ) [ ] { } '"' '"'
|
|
|
|
}
|
|
|
|
hook -group config global BufSetOption filetype=typst %{
|
|
|
|
set-option buffer auto_pairs ( ) [ ] { } '"' '"' $ $ * *
|
2024-05-05 18:13:48 +00:00
|
|
|
}
|
2024-03-08 14:32:05 +00:00
|
|
|
evaluate-commands enable-auto-pairs
|
2024-09-02 21:34:45 +00:00
|
|
|
} # auto-pairing of characters
|
2024-05-05 18:13:48 +00:00
|
|
|
|
2024-03-08 14:32:05 +00:00
|
|
|
plug "Delapouite/kakoune-palette" config %{
|
|
|
|
hook global BufOpenFile .*colorscheme.kak %{
|
|
|
|
evaluate-commands palette-gutter
|
|
|
|
}
|
2024-09-02 21:34:45 +00:00
|
|
|
} # preview face colors in kakoune
|
2024-03-08 14:32:05 +00:00
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# __________ lsp __________
|
2024-05-05 18:13:48 +00:00
|
|
|
eval %sh{kak-lsp --kakoune -s $kak_session}
|
|
|
|
hook global BufSetOption filetype=(c|cpp|css|haskell|html|json|scheme|sh|latex|zig) %{
|
2024-03-08 14:32:05 +00:00
|
|
|
add-highlighter buffer/ column 80 StatusLine
|
2024-05-05 18:13:48 +00:00
|
|
|
hook global BufSetOption filetype=scheme %{
|
|
|
|
set-option buffer lsp_cmd 'guile-lsp-server'
|
|
|
|
}
|
|
|
|
lsp-enable-window
|
2024-03-08 14:32:05 +00:00
|
|
|
}
|
|
|
|
|
2024-09-02 21:34:45 +00:00
|
|
|
# latex
|
2024-03-08 14:32:05 +00:00
|
|
|
set-option -add global lsp_server_configuration texlab.build.onSave=true
|
|
|
|
set-option -add global lsp_server_configuration texlab.build.forwardSearchAfter=true
|
|
|
|
set-option -add global lsp_server_configuration texlab.build.args=["-pdf","-new-viewer-","-pdflatex\=pdflatex","-silent","-shell-escape","%f"]
|