diff options
| author | Jake Koroman <jake@jakekoroman.com> | 2026-04-10 22:50:12 -0400 |
|---|---|---|
| committer | Jake Koroman <jake@jakekoroman.com> | 2026-04-10 22:50:12 -0400 |
| commit | bfd7be19d28cdbe32c81b47f64c88dbe6a2d713a (patch) | |
| tree | 66d83342aeaca4ed89c8c4899ee9377ee3f76c1b /kak/kakrc | |
| parent | 6e92faf0073c749a6a24a46d4d784c8a4db0b661 (diff) | |
kak: trim trailing whitespace before save.
Diffstat (limited to 'kak/kakrc')
| -rw-r--r-- | kak/kakrc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -19,6 +19,10 @@ hook global ModuleLoaded x11 %{ set global termcmd 'st -e sh -c' } +hook global BufWritePre .* %{ + jrk-trim-trailing-whitespace +} + define-command testcmd %{ prompt -file-completion 'What is your name? ' %{ evaluate-commands %sh{ @@ -39,6 +43,10 @@ define-command jrk-set-makecmd-and-make %{ } } +define-command jrk-trim-trailing-whitespace %{ + try %{ execute-keys -draft "%%s\h+$<ret>d" } +} + map -docstring 'yank to system clipboard' global user y '<a-|>xclip -selection clipboard<ret>' map -docstring 'paste from system clipboard' global user p '<!>xclip -selection clipboard -o<ret>' |
