From 1ccf3d5c1d2ee7ff8ec97488c0b15b8316fb29f9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 12 Jun 2026 20:33:09 +0530 Subject: Clipboard actions + grep selection --- autoload/system.kak | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'autoload/system.kak') diff --git a/autoload/system.kak b/autoload/system.kak index 6ad122a..bb11f4f 100644 --- a/autoload/system.kak +++ b/autoload/system.kak @@ -7,17 +7,28 @@ map global user Z ': wq' -docstring 'Save and quit' map global normal 15j -docstring '15 down' map global normal 15k -docstring '15 up' +# Clipboard stuff map global user y " xclip -selection clipboard" -docstring "yank the selection into the clipboard" +map global user p " xclip -selection clipboard -o" -docstring "paste from clipboard after selection" +map global user P "! xclip -selection clipboard -o" -docstring "paste from clipboard before selection" +# System mode declare-user-mode system map global user q ': enter-user-mode system' -docstring 'System mode' map global system o ':info %opt{}' -docstring 'Print opt' map global system v ':info %val{}' -docstring 'Print value' map global system d ': buffer *debug*' -docstring 'Switch to debug buffer' map global system f ':set buffer filetype ' -docstring 'Set filetype' +# Path +map global system p ': info %sh{realpath -s --relative-to="$PWD" "$kak_buffile"}' -docstring 'Print relative file path' +map global system P ': info %sh{realpath -s "$kak_buffile"}' -docstring 'Print absolute file path' +map global system y ': info %sh{realpath -s --relative-to="$PWD" "$kak_buffile" | xclip -selection clipboard}' -docstring 'Copy relative file path' +map global system Y ': info %sh{realpath -s "$kak_buffile" | xclip -selection clipboard}' -docstring 'Copy absolute file path' + +# Make cmd map global system M ':set global makecmd ""' -docstring 'Set global compile command' map global system m ': make' -docstring 'Compile' -map global system p ': info %sh{ realpath -s --relative-to="$PWD" "$kak_buffile" }' -docstring 'Print relative file path' -map global system P ': info %val{buffile}' -docstring 'Print absolute file path' -map global system ! ':info %sh{}' -docstring 'Run command' +# Run oneshot shell command +map global system ! ':info %sh{}' -docstring 'Run command with %sh' +# New term map global system t ': terminal %sh{ echo "$SHELL" }' -docstring 'Open new term' -- cgit v1.3.1