]> Freerunner's - dotfiles.git/commitdiff
kak: update config
authorAndre Ramnitz <tux.rising@gmail.com>
Wed, 27 Dec 2023 00:02:46 +0000 (01:02 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Sun, 18 Aug 2024 16:18:52 +0000 (18:18 +0200)
config/kak/kakrc
config/kak/plugins/bookmarks.kak

index dea2afaadfe753518671cb4938187d3306dd4cc5..f73aa4494cf89404a98e10f27aee9e734f864079 100644 (file)
@@ -20,7 +20,6 @@ plug "andreyorst/plug.kak" noload
        hook global WinSetOption filetype=(c|cpp) smarttab
     }
     plug "whereswaldon/shellcheck.kak"
-    plug "occivink/kakoune-filetree"
     plug "occivink/kakoune-sudo-write"
     plug "occivink/kakoune-find"
     plug "foot.kak"
@@ -56,7 +55,7 @@ hook global WinCreate [^*].* %{
     hook -once window WinDisplay .* %{
         hook window WinResize [0-9]*\.[0-9]* %{
             set-option window scrolloff %sh{
-                printf '%u,%u' "$(($kak_window_height / 6))" "$(($kak_window_width / 8))"
+                printf '%u,%u' "$(($kak_window_height / 5))" "$(($kak_window_width / 8))"
             }
         }
     }
@@ -124,29 +123,40 @@ define-command -hidden -params 2 inc %{ try %{
 map global normal '#' :comment-line<ret> -docstring 'comment line'
 map global normal '<a-#>' :comment-block<ret> -docstring 'comment block'
 map global goto m '<esc>m;' -docstring 'matching char'
-map -docstring 'select lines downwards' global normal X T<ret>Lx
-# see #inc
 map global normal <c-a> ': inc %val{count} +<ret>'
 map global normal <c-x> ': inc %val{count} -<ret>'
-map global normal Q q # map q to Q 
-#map global normal q -docstring 'tabs mode' ': enter-user-mode tabs<ret>' # map q to tabs mode
-
 
 # default user mode
 # ──────────────────────────────────────────────────────────────────────────────
-map global user -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
-map global user -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
+map global user -docstring 'Buffer mode' b ':enter-user-mode buffermode<ret>'
+map global user -docstring 'Selection mode' s ':enter-user-mode selectionmode<ret>'
+#map global user -docstring 'bookMarks mode' m ':enter-user-mode bookmarks<ret>'
+
 map global user -docstring 'edit kakrc' e ': e ~/.config/kak/kakrc<ret>'
-map global user -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections<ret>'
-map global user -docstring 'clean tabs and trailing whitespace in the buffer' C ': clean-buffer<ret>'
-map global user -docstring 'buffer backward' b ': buffer-previous<ret>'
-map global user -docstring 'buffer forward' n ': buffer-next<ret>'
-map global user -docstring 'lint-buffer' L ': buffer *lint-output*<ret>'
-map global user -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -relative -hlcursor<ret>'
-map global user -docstring 'relative line numbers disable' R ': remove-highlighter window/nl<ret>'
-map global user -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
-map global user -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
 
+# buffer user mode
+# ──────────────────────────────────────────────────────────────────────────────
+declare-user-mode buffermode
+map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
+map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
+map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*<ret>'
+map global buffermode -docstring 'buffer picker' l ': connect terminal-popup kcr fzf buffers<ret>'
+map global buffermode -docstring 'Next buffer ' n ': buffer-next<ret>'
+map global buffermode -docstring 'Previous buffer' p ': buffer-previous<ret>'
+map global buffermode -docstring 'clean tabs and trailing whitespace in the buffer' c ': clean-buffer<ret>'
+map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
+map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
+
+# selection user mode
+# ──────────────────────────────────────────────────────────────────────────────
+declare-user-mode selectionmode
+map global selectionmode -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections<ret>'
+
+# window user mode
+# ──────────────────────────────────────────────────────────────────────────────
+declare-user-mode windowmode
+map global windowmode -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -relative -hlcursor<ret>'
+map global windowmode -docstring 'relative line numbers disable' R ': remove-highlighter window/nl<ret>'
 
 # terminal config (via foot.kak)
 # ──────────────────────────────────────────────────────────────────────────────
index 2e92602eef5ed1717660689765b93583eecce099..d2269398466268ef4393b9f71c3d247623292007 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2e92602eef5ed1717660689765b93583eecce099
+Subproject commit d2269398466268ef4393b9f71c3d247623292007