printf %s "$kak_main_reg_dquote" | xsel --input --clipboard
}}
+# Kakoune shell integration, see https://github.com/kkga/kks
+eval %sh{ kks init }
+
+# Enable PLUGin manager
+# ─────────────────────
+source "%val{config}/plugins/plug.kak/rc/plug.kak"
+plug "andreyorst/plug.kak" noload
+
+ plug "andreyorst/powerline.kak" defer powerline_base16 %{
+ powerline-theme base16
+ } config %{
+ powerline-start
+ }
+
+ plug "Ersikan/bookmarks.kak" %{
+ hook global WinCreate .* bookmarks-enable
+ }
+
+ plug "andreyorst/smarttab.kak" defer smarttab %{
+ # when 'backspace' is pressed, 4 spaces are deleted at once
+ set-option global softtabstop 4
+ } config %{
+ hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|py|sh|perl) expandtab
+ hook global WinSetOption filetype=(makefile|gas) noexpandtab
+ hook global WinSetOption filetype=(c|cpp) smarttab
+ }
+ plug "whereswaldon/shellcheck.kak"
+ plug "kakounedotcom/prelude.kak"
+ plug "occivink/sudo-write.kak"
+ plug "foot.kak"
+
# Look and Feel
# ─────────────
add-highlighter global/trailing-whitespace regex '\h+$' 0:Error # trailing whitespaces in red
execute-keys l
}}
-# File management
-# ───────────────
-# nnn
-declare-option str kak_open "%val{config}/kak_open"
-define-command nnn -docstring "open nnn" -params .. %{
- terminal sh -c "NNN_OPENER=%opt{kak_open} KAK_SESSION=%val{session} KAK_CLIENT=%val{client} nnn %arg{@}"
-}
-complete-command nnn file
-# broot
-define-command broot -docstring "open broot" -params .. %{
- terminal sh -c "EDITOR=%opt{kak_open} KAK_SESSION=%val{session} KAK_CLIENT=%val{client} broot %arg{@}"
-}
-complete-command broot file
-# fuzzy finders
-define-command find -docstring "find files" -params 1 %{ edit %arg{1} }
-complete-command find shell-script-candidates %{ find . -type f }
-alias global f find
# Various mappings
# ────────────────
map global normal <c-a> ': inc %val{count} +<ret>'
map global normal <c-x> ': inc %val{count} -<ret>'
-# User modes
+# 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 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
map global user -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
-# Enable PLUGin manager
-# ─────────────────────
-source "%val{config}/plugins/plug.kak/rc/plug.kak"
-plug "andreyorst/plug.kak" noload
-
- plug "andreyorst/powerline.kak" defer powerline_base16 %{
- powerline-theme base16
- } config %{
- powerline-start
- }
-
- plug "Ersikan/bookmarks.kak" %{
- hook global WinCreate .* bookmarks-enable
- }
-
- plug "andreyorst/smarttab.kak" defer smarttab %{
- # when 'backspace' is pressed, 4 spaces are deleted at once
- set-option global softtabstop 4
- } config %{
- hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|py|sh|perl) expandtab
- hook global WinSetOption filetype=(makefile|gas) noexpandtab
- hook global WinSetOption filetype=(c|cpp) smarttab
- }
- plug "whereswaldon/shellcheck.kak"
- plug "kakounedotcom/prelude.kak"
- plug "occivink/sudo-write.kak"
-
-# PLUGin ends
+# kks user mode
+declare-user-mode kks
+map global normal <c-p> -docstring 'kks mode' ': enter-user-mode kks<ret>'
+map global kks f -docstring 'files' ': kks-connect terminal-popup kks-files<ret>'
+map global kks F -docstring 'files (all)' ': kks-connect terminal-popup kks-files -HI<ret>'
+map global kks g -docstring 'git files' ': kks-connect terminal-popup kks-git-files<ret>'
+map global kks b -docstring 'buffers' ': kks-connect terminal-popup kks-buffers<ret>'
+map global kks / -docstring 'live grep' ': kks-connect terminal-popup kks-grep<ret>'
+map global kks l -docstring 'lines in buffer' ': kks-connect terminal-popup kks-lines<ret>'
+map global kks r -docstring 'recent files' ': kks-connect terminal-popup kks-mru<ret>'
+map global kks <a-f> -docstring 'filetypes' ': kks-connect terminal-popup kks-filetypes<ret>'
+
+set-option global foot_normal_cmd 'foot'
+set-option global foot_popup_cmd 'foot'
+set-option global foot_popup_flags '--app-id=popup'
+set-option global foot_panel_cmd 'foot'