5 Commits 545065d39b ... 9fa511df88

Author SHA1 Message Date
  Adam 9fa511df88 remove GNU from wob 3 years ago
  Adam bac1ce2e03 tidy up aliases 3 years ago
  Adam 41c3c8cf68 add smart home behaviour in kakoune 3 years ago
  Adam 08a9c40324 change spellchecker in kakoune 3 years ago
  Adam 0b7eb54d22 add kakboard to kakoune 3 years ago
4 changed files with 42 additions and 13 deletions
  1. 33 10
      .config/kak/kakrc
  2. 1 1
      .config/sh/aliases
  3. 1 1
      .config/sh/functions
  4. 7 1
      .config/sway/sway_startup.sh

+ 33 - 10
.config/kak/kakrc

@@ -25,6 +25,22 @@ plug "andreyorst/smarttab.kak" %{
 		smarttab
 	}
 }
+plug "lePerdu/kakboard" %{
+	hook global WinCreate .* %{ kakboard-enable }
+}
+plug "dmerejkowsky/kak-spell" config %{
+	  declare-user-mode kak-spell
+  map global user s ': enter-user-mode -lock kak-spell<ret>' -docstring 'enter spell user mode'
+  map global kak-spell a ': kak-spell-add<ret>' -docstring 'add the selection to the user dict'
+  map global kak-spell d ': kak-spell-disable<ret>' -docstring 'clear spelling highlighters'
+  map global kak-spell e ': kak-spell-enable en_GB<ret> :kak-spell <ret>' -docstring 'enable spell check in English'
+  map global kak-spell f ': kak-spell-enable pl_PL<ret> :kak-spell <ret>' -docstring 'run spell check in Polish'
+  map global kak-spell l ': kak-spell-list <ret>' -docstring 'list spelling errors in a buffer'
+  map global kak-spell n ': kak-spell-next<ret>' -docstring 'go to next spell error'
+  map global kak-spell p ': kak-spell-previous<ret>' -docstring 'go to next spell error'
+  map global kak-spell r ': kak-spell-replace<ret>' -docstring 'suggest a list of replacements'
+  map global kak-spell x ': kak-spell-remove<ret>' -docstring 'remove the selection from the user dict'
+}
 
 evaluate-commands %sh{
 	if command -v kak-lsp > /dev/null 2>&1
@@ -74,14 +90,26 @@ set-face global StatusLineValue blue,cyan
 # todo hook global ModeChange ".*:normal" %{ face ...  }
 # todo hook global ModeChange ".*:insert" %{ face ...  }
 
+declare-option str spell
+
+set-option global ui_options ncurses_assistant=cat
+
+define-command gohome %{
+	eval -itersel %{
+	  try %{
+	    exec -draft %{ <a-h><a-k>\A\h+.\z<ret> }
+	    exec gh
+	  } catch %{
+	    exec gi
+	  }
+	}
+}
+
 map global normal <c-a-c> ':comment-line<ret>'
 map global normal <c-a-t> 'be :ctags-search<ret>'
-map global user P '!wl-paste<ret>' -docstring 'paste from OS'
-map global user p '<a-!>wl-paste<ret>' -docstring 'paste up from OS'
 map global goto t '\:buffer-next<ret>' -docstring 'next buffer'
-
-declare-option str spell
-set-option global ui_options ncurses_assistant=cat
+map global normal <home> :gohome<ret>
+map global normal <end> gl
 
 hook global NormalIdle .* %{ evaluate-commands %sh{
 		fmt=""
@@ -134,11 +162,6 @@ hook global BufWritePost .* %{ evaluate-commands %sh{
 		then
 			echo "git show-diff"
 		fi
-		if [ -n "$kak_opt_spell" ]; then
-			echo "spell $kak_opt_spell"
-		else
-			echo "spell-clear"
-		fi
 		if [ -n "$kak_opt_lintcmd" ]; then
 			echo 'lint'
 		fi

+ 1 - 1
.config/sh/aliases

@@ -14,7 +14,7 @@ alias df="df -h --output=source,fstype,used,avail,pcent,target"
 # doas
 alias connmanctl="doas connmanctl"
 alias android-studio="doas android-studio"
-alias thumb="doas thumb"
+alias thumb="doas ~/.local/bin/thumb"
 alias laptop_mode="doas laptop_mode"
 alias rfkill="doas rfkill"
 

+ 1 - 1
.config/sh/functions

@@ -190,7 +190,7 @@ entry() {
 	then
 		printf "=== %s\n\n\n" "$date_short" > "$date_full.asciidoc"
 	fi
-	kak -e "set buffer spell en-GB" "$date_full.asciidoc"
+	kak -e "kak-spell-enable en_GB" "$date_full.asciidoc"
 	cd - >/dev/null || exit 1
 }
 

+ 7 - 1
.config/sway/sway_startup.sh

@@ -13,7 +13,13 @@ pgrep battery_notify || ~/.local/bin/battery_notify &
 swaybg -i "$HOME/Pictures/wallpapers/$(hostname).webp" -m fill &
 
 test ! -e /tmp/wob.sock && mkfifo /tmp/wob.sock
-pgrep wob || (tail -f /tmp/wob.sock | wob -a bottom &)
+(if ! pgrep wob
+then
+	while true
+	do
+		cat -u /tmp/wob.sock
+	done | wob -a bottom &
+fi) &
 
 # pgrep gammastep || gammastep &