# ──────────────────────────────────────────────────────────────────────────────
hook global BufOpenFile .* %{
modeline-parse
- editorconfig-load
+ # editorconfig-load ## fucks up linters. disable for now
}
hook global BufCreate [^*].* %{
set window formatcmd 'npx prettier --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=css %{
- set window formatcmd 'npx prettier --parser css'
+ set-option window lintcmd "npx stylelint --formatter unix --stdin-filename='%val{buffile}'"
}
hook global WinSetOption filetype=scss %{
- set window formatcmd 'npx prettier --parser scss'
+ set window formatcmd 'npx prettier --parser scss --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=less %{
- set window formatcmd 'npx prettier --parser less'
+ set window formatcmd 'npx prettier --parser less --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=html %{
- set window formatcmd 'npx prettier --parser html'
+ set window formatcmd 'npx prettier --parser html --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=json %{
- set window formatcmd 'npx prettier --parser json'
+ set-option window lintcmd %{ run() { cat -- "$1" | jq 2>&1 | awk -v filename="$1" '/ at line [0-9]+, column [0-9]+$/ { line=$(NF - 2); column=$NF; sub(/ at line [0-9]+, column [0-9]+$/, ""); printf "%s:%d:%d: error: %s", filename, line, column, $0; }'; } && run }
}
hook global WinSetOption filetype=md %{
- set window formatcmd 'npx prettier --parser md'
+ set window formatcmd 'npx prettier --parser md --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=sh %{
# needs shfmt: $ go install mvdan.cc/sh/v3/cmd/shfmt@latest
set-option window lintcmd "shellcheck -fgcc -Cnever"
}
hook global WinSetOption filetype=yaml %{
- set window formatcmd 'npx prettier --parser yaml'
+ set window formatcmd 'npx prettier --parser yaml --stdin-filepath $kak_buffile<ret><space>;'
set-option window lintcmd %{
run() {
# change [message-type] to message-type:
# ──────────────────────────────────────────────────────────────────────────────
# Shades of green/yellow for insert mode.
hook global ModeChange (push|pop):.*:insert %{
- set-face window StatusLine black,rgb:800000
+ set-face window StatusLine black,rgb:a1163d
}
# Undo colour changes when we leave insert mode.
# language config
# ──────────────────────────────────────────────────────────────────────────────
-import languagecmd
+# import languagecmd
add_newline = false
format = """\
-${custom.kakbuflist}\
${custom.kaklsp_progress}\
${custom.kakcursor}\
${custom.kakposition}\
${custom.kakmode}\
${custom.kakcontext}\
-$directory\
-${custom.kakfile}\
${custom.kakfiletype}\
+${custom.kakbuflist}\
+${directory}\
+${custom.kakfile}\
${custom.kaklsp_err}\
${custom.kaklsp_warn}\
${custom.kaklsp_hint}\
${custom.kaklsp_code_actions}\
-$package\
-$git_branch\
-$git_commit\
-$git_state\
-$git_status\
+${package}\
+${git_branch}\
+${git_commit}\
+${git_state}\
+${git_status}\
${custom.kaksession}\
-$memory_usage\
-$battery\
-$time\
${custom.kaktime}
"""
[git_commit]
format = '[\($hash$tag\)]($style)'
style = 'fg:blue dimmed'
-commit_hash_length = 7
+commit_hash_length = 6
only_detached = false
tag_symbol = ' 笠'
tag_disabled = false
disabled = false
[git_status]
-format = '[\[$all_status$ahead_behind\]]($style)[ ]($style)'
+format = '[\[$all_status$ahead_behind\]]($style)[]($style)'
style = 'fg:cyan dimmed bold'
stashed = '\$'
ahead = '⇡${count}'
[directory]
format = '[]($style)[$read_only]($read_only_style)[$path]($style)'
-truncation_length = 3
-truncate_to_repo = false
+truncation_length = 8
+truncate_to_repo = true
fish_style_pwd_dir_length = 0
use_logical_path = true
style = 'bg:blue fg:black'
disabled = false
[directory.substitutions]
-"~/dotfiles" = " "
+"dotfiles/config/dot-config" = "config"
+"dotfiles/local/dot-local" = "local"
"~/.config" = " "
"~/.workspace/rust" = ""
"~/.workspace/docker" = " "
[custom.kaksession]
description = 'The current Kakoune session'
format = '[]($style)[ %val{client}:%val{session} ]($style)[]($style inverted)'
-style = 'bg:yellow fg:black italic'
+style = 'bg:yellow fg:black'
when = ''
shell = ['true']
-disabled = true
+disabled = false
[custom.kakcursor]
description = 'The current Kakoune cursor position'
format = '[%val{cursor_line}:%val{cursor_char_column}]($style)'
-style = 'fg:bright-white'
+style = 'fg:white'
when = ''
shell = ['true']
disabled = false
[custom.kakcontext]
description = 'The current Kakoune context'
-format = ' {{context_info}}'
+format = ' {{context_info}} '
when = ''
shell = ['true']
disabled = false
[custom.kakfiletype]
description = 'The current buffer filetype'
-format = '\[%opt{filetype}\] '
+format = '[%opt{filetype}]($style) '
+style = 'fg:13'
when = ''
shell = ['true']
-disabled = true
+disabled = false
[custom.kakposition]
description = 'Relative position of the cursor inside the buffer'
-format = '[ $output]($style)[ ]($style)'
-style = 'white'
+format = '[ $output]($style) '
+style = 'bright-white'
command = 'echo -n $(($kak_cursor_line * 100 / $kak_buf_line_count))%'
when = '[ -n "$kak_cursor_line" ]'
shell = ['sh']
[custom.kaktime]
description = "Alternate time segment using kakoune evaluation"
-format = "[]($style)[ %sh{date +%T} ]($style)"
+format = "[]($style)[ %sh{date +%H:%M} ]($style)"
style = "fg:black bg:bright-green"
when = ''
shell = ['true']
-disabled = true
+disabled = false
[custom.kaklsp_err]
description = "Show errors number from kak-lsp if any"
[custom.kaklsp_hint]
description = "Show hints number from kak-lsp if any"
format = "[ ﯦ %opt{lsp_diagnostic_hint_count}]($style)"
-style = "white bold"
+style = "yellow bold"
when = '[ -n "$kak_opt_lsp_diagnostic_hint_count" -a "$kak_opt_lsp_diagnostic_hint_count" -ne 0 ]'
shell = ['sh']
disabled = false
[custom.kaklsp_code_actions]
-description = "Show lsp code actions"
+description = "Show lsp code actions if any"
format = "[ %opt{lsp_modeline_code_actions} ]($style)"
style = "yellow bold"
when = '[ -n "$kak_opt_lsp_modeline_code_actions" ]'
[custom.kakbuflist]
description = "Open buffers"
-format = "[ $output ]($style)"
-style = "fg:white"
+format = '[]($style inverted)[$output]($style)[]($style inverted)'
+style = 'bg:8 fg:0'
when = 'true'
shell = ['sh']
-command = 'kks get -s ${kak_session##*/} %val{buflist} | grep -vE "(\*debug\*|${kak_buffile##*/})" | paste -s -d "|" '
+command = 'kks get -s ${kak_session##*/} %val{buflist} | grep -vE "(\*scratch\*|\*debug\*|${kak_buffile##*/})" | rev | cut -d"/" -f1 | rev | paste -s -d "|" '
disabled = false