]> Freerunner's - dotfiles.git/commitdiff
kak: update config
authorAndre Ramnitz <tux.rising@gmail.com>
Tue, 22 Oct 2024 21:38:07 +0000 (23:38 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Tue, 22 Oct 2024 21:38:07 +0000 (23:38 +0200)
dot-config/kak/kakrc

index 782c0936f130b3f15aba97061d2dcc5ab1304c2e..a18467463d05dd47414a18116cb700e38467adbb 100644 (file)
@@ -11,6 +11,7 @@ def import -override -params 1 %{
     source %sh{echo ${kak_config}/$1.kak}
 }
 
+
 # Clipboard (wayland) integration
 # ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 hook global NormalKey y %{ nop %sh{
@@ -20,10 +21,6 @@ hook global NormalKey y %{ nop %sh{
 
 # run on file open
 # ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-hook global BufOpenFile .* %{
-    modeline-parse
-}
-
 hook global BufCreate [^*].* %{
      nop %sh{
          mru=~/.cache/kak-mru
@@ -35,6 +32,10 @@ hook global WinCreate ^[^*]+$ %{
     editorconfig-load # needs editorconfig-core-c with use-flag "+cli" on Gentoo
 }
 
+hook global BufOpenFile .* %{
+    modeline-parse
+}
+
 # dynamic scrolloff
 # ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 hook global WinCreate [^*].* %{
@@ -94,26 +95,26 @@ hook global BufSetOption filetype=(js|javascript) %{
     set-option buffer formatcmd "prettier --stdin-filepath=%val{buffile}"
 }
 hook global WinSetOption filetype=scss %{
-    set window formatcmd 'npx prettier --parser scss --stdin-filepath $kak_buffile<ret><space>;'
+    set-option buffer formatcmd 'npx prettier --parser scss --stdin-filepath=%val{buffile}'
 }
 hook global WinSetOption filetype=less %{
-    set window formatcmd 'npx prettier --parser less --stdin-filepath $kak_buffile<ret><space>;'
+    set-option buffer formatcmd 'npx prettier --parser less --stdin-filepath=%val{buffile}'
 }
 hook global WinSetOption filetype=html %{
-    set window formatcmd 'npx prettier --parser html --stdin-filepath $kak_buffile<ret><space>;'
+    set-option buffer formatcmd 'npx prettier --parser html --stdin-filepath=%val{buffile}'
 }
 hook global WinSetOption filetype=md %{
-    set window formatcmd 'npx prettier --parser md --stdin-filepath $kak_buffile<ret><space>;'
+    set-option buffer formatcmd 'npx prettier --parser md --stdin-filepath=%val{buffile}'
 }
 hook global WinSetOption filetype=sh %{
     # needs shfmt: $ go install mvdan.cc/sh/v3/cmd/shfmt@latest
     set-option buffer formatcmd "shfmt -i 4 -ci -sr -"
 }
 hook global WinSetOption filetype=yaml %{
-    set window formatcmd 'npx prettier --parser yaml --stdin-filepath $kak_buffile<ret><space>;'
+    set-option buffer formatcmd "npx prettier --parser yaml --stdin-filepath=%val{buffile}"
 }
 hook global WinSetOption filetype=(json|jsonc) %{
-    set-option window formatcmd "jq --indent %opt{tabstop} ."
+    set-option buffer formatcmd "jq --indent %opt{tabstop} ."
 }
 
 # Enable some code linters
@@ -173,7 +174,7 @@ add-highlighter global/ number-lines -hlcursor -min-digits 3
 
 # Different Cursor color in insert mode
 # ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-# Shades of green/yellow for insert mode.
+# Recolor the status line on insert mode.
 hook global ModeChange (push|pop):.*:insert %{
     set-face window StatusLine black,yellow
     set-face window StatusLineInfo blue,black