radio: files: kak: Update kakrc

impermanence
Luis Guilherme Coelho 2024-05-05 15:13:48 -03:00
parent 8cb5ee8e6c
commit 947da572ef
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 50 additions and 79 deletions

View File

@ -8,17 +8,17 @@ set-option -add global ui_options terminal_padding_char=
# Always keep two lines and two columns displayed around the cursor
set-option global scrolloff 2,2
# No assistant
# Assistant
set-option -add global ui_options terminal_assistant=cat
hook global ModuleLoaded x11 %{
set-option global termcmd "%sh{echo $TERMINAL} -e "
hook global ModuleLoaded wayland %{
set-option global termcmd "%sh{echo $TERMINAL}"
} # Set termcmd
# __________ Commands __________
define-command -override lf-open \
-docstring 'pick a file with lf' %{
terminal dash -c %{
wayland-terminal /bin/sh -c %{
# Local variables
kak_buffile=$1 kak_session=$2 kak_client=$3
@ -66,23 +66,7 @@ define-command -override radix \
execute-keys ":e %opt{radix}/"
}
define-command -override home \
-docstring 'edit home declaration' %{
edit "%opt{radix}/home-environments/%sh{whoami}.scm"
}
define-command -override system \
-docstring 'edit system declaration' %{
edit "%opt{radix}/operating-systems/%sh{hostname}.scm"
}
declare-option str radix_files "%opt{radix}/files"
define-command -override files \
-docstring 'edit dotfiles' %{
execute-keys ":e %opt{radix_files}/"
}
declare-option str radix_modules "%opt{radix}/modules/radix"
declare-option str radix_modules "%opt{radix}/radix"
define-command -override modules \
-docstring 'edit radix modules' %{
execute-keys ":e %opt{radix_modules}/"
@ -106,19 +90,43 @@ define-command -override home-services \
execute-keys ":e %opt{radix_home_services}/"
}
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}/"
}
define-command -override colorscheme-config \
-docstring 'edit colorscheme configuration file' %{
edit "%opt{radix_files}/kak/autoload/colorscheme.kak"
edit "%opt{home_files}/.config/kak/autoload/colorscheme.kak"
}
define-command -override config \
-docstring 'edit kakoune main configuration file' %{
edit "%opt{radix_files}/kak/kakrc"
edit "%opt{home_files}/.config/kak/kakrc"
}
define-command -override rss \
-docstring 'edit rss feeds file' %{
edit "%opt{radix_files}/newsraft/feeds"
edit "%opt{home_files}/.config/newsraft/feeds"
}
define-command -override remind \
@ -180,7 +188,7 @@ define-command -override -hidden edit-from-file %{
define-command -override -hidden spawn-terminal-from-file %{
set-register b "%sh{pwd}"
change-directory "%sh{dirname $kak_buffile}"
evaluate-commands "terminal %sh{echo $SHELL} -c"
evaluate-commands "wayland-terminal bin/sh -c"
change-directory "%reg{b}"
} # Spawn a terminal in the current buffer's file directory
@ -263,10 +271,6 @@ hook -group config global BufCreate 'kakrc' %{
set-option buffer filetype kak
} # Set kakrc's filetype to kak
hook -group config global BufCreate '.*\.(bash_profile|profile|bashrc|bash_aliases)' %{
set-option buffer filetype sh
} # Set filetype of bash configuration files to sh
hook global BufCreate '\*scratch\*' %{
execute-keys '%<a-d>'
} # Remove the *scratch* message
@ -275,14 +279,10 @@ hook global BufCreate .* %{
add-highlighter buffer/ number-lines -relative -hlcursor
} # Set relative line numbers and visual line break
hook global BufWritePost ".*/kakrc" %{
hook global BufWritePost ".*/.config/kak/kakrc" %{
source "%val{buffile}"
} # Source kakrc on save
hook global BufOpenFile '.*\.clj' %{
terminal dash -c "cd $(dirname $kak_buffile); lein repl"
} # Set defaults for clojure coding
hook global BufWritePost "%val{config}/autoload/colorscheme.kak" %{
source "%val{config}/autoload/colorscheme.kak"
evaluate-commands palette-gutter
@ -311,28 +311,12 @@ hook global InsertCompletionHide .* %{
map window insert <s-tab> <c-p>
} # Use tab for completion movement
try %{ declare-option str line_comment_token '' }
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 %{
#map buffer normal '<c-e>' ': echo %sh{ guile -c "(display $kak_reg_dot)" }<ret>'
set-option buffer indentwidth 2
set-option buffer line_comment_token ';;'
set-option buffer block_comment_tokens '#|' '|#'
evaluate-commands 'rainbow-enable'
} # Guile Scheme
hook -group config global BufSetOption filetype=clojure %{
set-option buffer indentwidth 2
set-option window formatcmd 'zprint'
set-option window lintcmd 'clj-kondo'
set-option buffer line_comment_t
set-option buffer block_comment_tokens '(comment' ')'
evaluate-commands 'rainbow-enable'
} # Clojure comment tokens
hook -group config global BufSetOption filetype=scheme %{
set-option buffer indentwidth 2
set-option window formatcmd 'guix style --whole-file'
@ -346,16 +330,6 @@ hook -group config global BufSetOption filetype=(c|cpp) %{
set-option buffer block_comment_tokens '/*' '*/'
} # C and C++ comment tokens
hook -group config global BufSetOption filetype=python %{
set-option buffer line_comment_token '#'
set-option buffer block_comment_tokens '"""' '"""'
} # Python comment token tokens
hook -group config global BufSetOption filetype=lua %{
set-option buffer line_comment_token '--'
set-option buffer block_comment_tokens '[[--' '--]]'
} # Lua comment tokens
hook -group config global BufSetOption filetype=(sh|dash) %{
set-option window formatcmd 'shfmt'
set-option window lintcmd 'shellharden'
@ -416,14 +390,8 @@ plug "NNBnh/coderun.kak" # Run files from within kakoune
plug "enricozb/wiki.kak" # Preview and interact with markdown
#plug "https://gitlab.com/john_t/org.kak/" # Org mode for kakoune
plug "https://gitlab.com/datensenke/prolog.kak/" # Prolog syntax highlight
plug "https://gitlab.com/Screwtapello/kakoune-texinfo.git" # TexInfo
#plug "alexherbo2/tmux.kak" # Tmux integration
plug "TeddyDD/kakoune-lf" # lf integration
plug "jpcornwell/kakoune-sokoban" # Sokoban because yes
@ -446,29 +414,32 @@ declare-option str-list rainbow_faces "rgb:a790d3" "rgb:6cdae0" "rgb:ff7f50" \
plug "alexherbo2/auto-pairs.kak" config %{
set-option global auto_pairs ( ) { } [ ] '"' '"' "'" "'" ` ` “ ” « »
hook -group config global BufSetOption filetype=scheme %{
set-option buffer auto_pairs { } '"' '"' ` ` “ ” « »
}
evaluate-commands enable-auto-pairs
} # Auto-pairing of characters
plug "eraserhd/parinfer-rust" config %{
hook global WinSetOption filetype=(clojure|lisp|scheme|racket) %{
parinfer-enable-window -smart
}
}
plug "Delapouite/kakoune-palette" config %{
hook global BufOpenFile .*colorscheme.kak %{
evaluate-commands palette-gutter
}
} # Preview face colors in kakoune
plug "kak-lsp/kak-lsp" do %{
cargo install --locked --force --path .
# optional: if you want to use specific language servers
mkdir -p ~/.config/kak-lsp
cp -n kak-lsp.toml ~/.config/kak-lsp/
} # Language server protocol
# __________ LSP __________
hook global BufSetOption filetype=(c|clojure|cpp|crystal|css|haskell|html|js|json|lua|python|scheme|sh|sql|latex|zig) %{
eval %sh{kak-lsp --kakoune -s $kak_session}
hook global BufSetOption filetype=(c|cpp|css|haskell|html|json|scheme|sh|latex|zig) %{
add-highlighter buffer/ column 80 StatusLine
hook global BufSetOption filetype=scheme %{
set-option buffer lsp_cmd 'guile-lsp-server'
}
hook global BufSetOption filetype=(c|clojure|cpp|crystal|css|haskell|html|js|json|lua|python|sh|latex|zig) %{
evaluate-commands lsp-enable
lsp-enable-window
}
# Latex