Skip to content

Commit

Permalink
2024-11-18 17:20:04
Browse files Browse the repository at this point in the history
  • Loading branch information
alexherbo2 committed Dec 31, 2024
1 parent 99cd857 commit f11f0b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .config/kak/kakrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set-option global tree_sitter_command kak-tree-sitter
set-option global tree_sitter_args -dks --init %val{session}

# Status line
set-option global modelinefmt '{{mode_info}} {{context_info}} %val{bufname}:%val{cursor_line}:%val{cursor_char_column}'
set-option global modelinefmt '{{mode_info}} {{context_info}} %val{bufname}:%val{cursor_line}:%val{cursor_char_column} %val{client}@%val{session}'

# Highlight various characters
add-highlighter global/characters regex '[–—−×]' '0:cyan+f'
Expand Down
18 changes: 15 additions & 3 deletions .local/share/kak/autoload/core/config.kak
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ define-command open_kakrc %{
edit "%val{config}/kakrc"
}

define-command open_shared_kakrc %{
edit "%val{runtime}/kakrc"
}

define-command load_local_kakrc %{
evaluate-commands %sh{
if [ -f '.kakrc' -a -r '.kakrc' ]
Expand All @@ -17,20 +21,28 @@ define-command open_config -params 1 -docstring 'open config' %{

complete-command -menu open_config shell-script-candidates %{
find -L "$kak_config/kakrc" "$kak_runtime/kakrc" -type f -name 'kakrc'
find -L "$kak_config/autoload" "$kak_config/colors" "$kak_runtime/autoload" "$kak_runtime/colors" -type f -name '*.kak'
find -L "$kak_config/autoload" "$kak_runtime/autoload" -type f -name '*.kak'
}

alias global config open_config

define-command grep_config -params 1 -docstring 'grep config' %{
grep %arg{1} "%val{config}/kakrc" "%val{runtime}/kakrc" "%val{config}/autoload" "%val{config}/colors" "%val{runtime}/autoload" "%val{runtime}/colors"
grep %arg{1} "%val{config}/kakrc" "%val{runtime}/kakrc" "%val{config}/autoload" "%val{runtime}/autoload"
}

complete-command grep_config shell-script-candidates %{
{
find -L "$kak_config/kakrc" "$kak_runtime/kakrc" -type f -name 'kakrc'
find -L "$kak_config/autoload" "$kak_config/colors" "$kak_runtime/autoload" "$kak_runtime/colors" -type f -name '*.kak'
find -L "$kak_config/autoload" "$kak_runtime/autoload" -type f -name '*.kak'
} |
xargs grep -o -h -w '[[:alpha:]][[:alnum:]_-]\+' -- |
sort -u
}

define-command explore_config %{
explore %val{config}
}

define-command explore_shared_config %{
explore %val{runtime}
}

0 comments on commit f11f0b5

Please sign in to comment.