From 071d83c73d2839f37f9ad2c85fe3a49b623e5ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Sun, 9 Aug 2026 23:10:58 +0200 Subject: [PATCH] kakoune: change cursor on insert instead of mode line, add pickers --- kakoune/.config/kak/kakrc | 53 +++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/kakoune/.config/kak/kakrc b/kakoune/.config/kak/kakrc index 87b326a..092822b 100644 --- a/kakoune/.config/kak/kakrc +++ b/kakoune/.config/kak/kakrc @@ -192,16 +192,25 @@ define-command -override ctags-project-fossil-symbols %{ set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F' -# CHANGE STATUS BAR COLOR IN INSERT MODE +# CHANGE CURSOR IN INSERT MODE -hook global ModeChange push:.*:insert %{ - set-face window StatusLine 'default,rgb:04785d' - set-option window idle_timeout 500 +hook global ModeChange (push|pop):.*:insert %{ + set-face window PrimarySelection rgb:000000,green+F + set-face window SecondarySelection rgb:000000,blue+F + set-face window PrimaryCursor rgb:000000,bright-green+bF + set-face window SecondaryCursor rgb:000000,bright-blue+bF + set-face window PrimaryCursorEol rgb:000000,bright-red+bF + set-face window SecondaryCursorEol rgb:000000,bright-yellow+bF } -hook global ModeChange pop:insert:.* %{ - unset-face window StatusLine - unset-option window idle_timeout +# Undo colour changes when we leave insert mode. +hook global ModeChange (push|pop):insert:.* %{ + unset-face window PrimarySelection + unset-face window SecondarySelection + unset-face window PrimaryCursor + unset-face window SecondaryCursor + unset-face window PrimaryCursorEol + unset-face window SecondaryCursorEol } # ODIN @@ -270,6 +279,36 @@ bundle match 'https://github.com/kmafeni04/match.kak' %{ map global match U ': match-surround-redo' -docstring "Redo" } +# PICKERS + +bundle pickers https://codeberg.org/kmafeni04/pickers.kak %{ + declare-user-mode pickers + map global user u ':enter-user-mode pickers' -docstring 'pickers mode' + map global pickers b ':pickers-buffer' -docstring 'Open fuzzy buffer picker' + map global pickers i ':pickers-buffer-info' -docstring 'Show currently open buffers' + map global pickers a ':pickers-buffer-alternate' -docstring 'Switch to previously opened buffer' + map global pickers f ':pickers-file' -docstring 'Open fuzzy file picker in git root or current working directory' + map global pickers n ':pickers-file /home/lupan/notes/' -docstring 'Open fuzzy file picker in notes directory' + map global pickers o ':pickers-file-cbd' -docstring "Open fuzzy file picker in current buffer's directory" + map global pickers g ':pickers-grep' -docstring "Open grep picker in git root" + map global pickers G "/y:pickers-grep" -docstring "Open grep picker in git root with selection as init" + map global pickers ':pickers-grep-cbd' -docstring "Open grep picker in buffer's directory" + map global pickers "/y:pickers-grep-cbd" -docstring "Open grep picker in buffer's directory with selection as init" + + hook global WinCreate \*pickers-grep\* %{ + map window normal ':pickers-grep-open' + map window normal "%%s)" -docstring "Select all matched grep text" + alias window write pickers-grep-write + alias window w pickers-grep-write + } + hook global WinCreate \*pickers-file\* %{ + map window normal ':pickers-file-open' + } + hook global WinCreate \*pickers-buffer\* %{ + map window normal ':pickers-buffer-open' + } +} + # HARPOON bundle kak-harpoon 'https://codeberg.org/raiguard/kak-harpoon' %{