From 63283d0a513113a92e3cf91ed747baa190733d25 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 7 Jul 2022 15:17:14 -0400 Subject: [PATCH] Some more small kak setups - Add kakoune-focus - Fix some kakrc comments --- home/kakoune/autoload/markdown.kak | 2 +- home/kakoune/kak.nix | 22 +++++++++++++++++++--- home/kakoune/kakrc | 6 +++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/home/kakoune/autoload/markdown.kak b/home/kakoune/autoload/markdown.kak index 4291885..fb10581 100644 --- a/home/kakoune/autoload/markdown.kak +++ b/home/kakoune/autoload/markdown.kak @@ -9,7 +9,7 @@ map -docstring "Toggle the checkboxes on the same line" global markdown-menu t " define-command -hidden markdown-toggle-checkbox %{ try %{ - execute-keys -draft "s^\s*- \[( |x)\]h: markdown-toggle-checkbox-selections" + execute-keys -draft "xs^\s*- \[( |x)\]h: markdown-toggle-checkbox-selections" } } diff --git a/home/kakoune/kak.nix b/home/kakoune/kak.nix index fa7c5cc..206d438 100644 --- a/home/kakoune/kak.nix +++ b/home/kakoune/kak.nix @@ -154,10 +154,11 @@ in define-command peneira-grep %{ peneira 'line: ' "rg -n ." %{ lua %arg{1} %{ - local file, line = arg[1]:match("([^:]+):(%d+):") - kak.edit(file, line) + local file, line = arg[1]:match("([^:]+):(%d+):") + kak.edit(file, line) } - } + } + } # A peneira menu declare-user-mode fuzzy-match-menu @@ -173,6 +174,21 @@ in map -docstring "Fuzzy matching" global user f ": enter-user-mode fuzzy-match-menu" ''; } + { + name = "01-kakoune-focus"; + src = pkgs.fetchFromGitHub { + owner = "caksoylar"; + repo = "kakoune-focus"; + rev = "949c0557cd4c476822acfa026ca3c50f3d38a3c0"; + sha256 = "sha256-ZV7jlLJQyL420YG++iC9rq1SMjo3WO5hR9KVvJNUiCs="; + }; + } + { + name = "02-kakoune-focus-config.kak"; + src = activationScript '' + map global user ': focus-toggle' -docstring "toggle selections focus" + ''; + } { name = "01-cargo.kak"; src = pkgs.fetchFromGitHub { diff --git a/home/kakoune/kakrc b/home/kakoune/kakrc index bc8d127..85a4fa8 100644 --- a/home/kakoune/kakrc +++ b/home/kakoune/kakrc @@ -64,12 +64,12 @@ define-command -params 0 -docstring "Copy line down" copyline %{ execute-keys -draft 'xy'%val{count}'P' } map global normal <+> -docstring "Copy line down" ': copyline' -define-command -params 0 -docstring "Delete current character" delete-one %{ +define-command -params 0 -docstring "Delete current pair of brackets" delete-current-brackets %{ execute-keys 'm' execute-keys -draft 'd' execute-keys 'H' } -map global normal D ": delete-one" +map global normal D ": delete-current-brackets" # Disable write-to # unalias global w @@ -125,7 +125,7 @@ hook global WinSetOption filetype=(rust) %{ lsp-inlay-hints-enable window } -hook global WinSetOption filetype=(rust|go|fsharp) %{ +hook global WinSetOption filetype=(rust|go|fsharp|haskell) %{ hook window -group semantic-tokens BufReload .* lsp-semantic-tokens hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens