From 5a819bfd400d787eab2a4c9ce5d6fcf4ceeb0c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sat, 21 Jan 2023 16:24:40 -0300 Subject: [PATCH] kakoune: add spellchecking --- user/kak/plug.kak | 2 +- user/kak/usermode.kak | 9 +++++++++ user/kakoune.nix | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/user/kak/plug.kak b/user/kak/plug.kak index 5f595a2..9cd6bea 100644 --- a/user/kak/plug.kak +++ b/user/kak/plug.kak @@ -23,7 +23,7 @@ plug 'alexherbo2/auto-pairs.kak' config %{ } plug 'lelgenio/kakoune-mirror-colemak' config %{ - map global user "s" ': enter-user-mode mirror' + map global user "s" ': enter-user-mode mirror' -docstring 'mirror mode' } plug 'delapouite/kakoune-palette' diff --git a/user/kak/usermode.kak b/user/kak/usermode.kak index 875dfc2..1e42712 100644 --- a/user/kak/usermode.kak +++ b/user/kak/usermode.kak @@ -35,6 +35,15 @@ map global find 'm' ': find_git_modified' -docstring 'git modified files' map global find 'c' ': find_dir' -docstring 'change dir' map global find 'd' ': find_delete' -docstring 'file to delete' +map global user 'S' ': find_spell' -docstring 'pick language for spellchecking' + +define-command -override -hidden find_spell \ +%{ evaluate-commands %sh{ + for line in `aspell dump dicts | wdmenu -i -p "Language: "`; do + echo "spell '$line'" + done +} } + define-command -override -hidden find_file \ %{ evaluate-commands %sh{ for line in `fd --strip-cwd-prefix -tf -HE .git | wdmenu -i -p "File: "`; do diff --git a/user/kakoune.nix b/user/kakoune.nix index fa475ad..ab2d57a 100644 --- a/user/kakoune.nix +++ b/user/kakoune.nix @@ -130,6 +130,10 @@ in { kak-lsp kak-pager kak-man-pager + + aspell + aspellDicts.en + aspellDicts.pt_BR ]; home.activation = { update_kakoune = lib.hm.dag.entryAfter [ "writeBoundary" ] ''