Update pbcopy/paste

This commit is contained in:
Natsu Kagami 2024-04-26 13:16:10 -04:00
parent c7cc8f9516
commit e17341a42f
Signed by: nki
GPG key ID: 55A032EB38B49ADB
2 changed files with 5 additions and 5 deletions

View file

@ -39,9 +39,9 @@ map global goto f -docstring "current grep-jump match" '<esc>: grep-jump<ret>'
hook global RegisterModified '"' %{ nop %sh{ hook global RegisterModified '"' %{ nop %sh{
printf "%s" "$kak_main_reg_dquote" | pbcopy >/dev/null 2>/dev/null & printf "%s" "$kak_main_reg_dquote" | pbcopy >/dev/null 2>/dev/null &
}} }}
map global user P -docstring "Paste before cursor from clipboard" '! pbpaste<ret>' map global user P -docstring "Paste before cursor from clipboard" '! pbpaste -n | cat<ret>'
map global user p -docstring "Paste after cursor from clipboard" '<a-!> pbpaste<ret>' map global user p -docstring "Paste after cursor from clipboard" '<a-!> pbpaste -n | cat<ret>'
map global user R -docstring "Replace selection with text from clipboard" '<a-d>! pbpaste<ret>' map global user R -docstring "Replace selection with text from clipboard" '<a-d>! pbpaste -n | cat<ret>'
define-command -params 0 -docstring "Copy line down" copyline %{ define-command -params 0 -docstring "Copy line down" copyline %{
execute-keys -draft 'xy'%val{count}'P' execute-keys -draft 'xy'%val{count}'P'
} }

View file

@ -68,10 +68,10 @@ with lib;
# Mimic the clipboard stuff in MacOS # Mimic the clipboard stuff in MacOS
(pkgs.writeShellScriptBin "pbcopy" '' (pkgs.writeShellScriptBin "pbcopy" ''
exec ${pkgs.wl-clipboard}/bin/wl-copy exec ${pkgs.wl-clipboard}/bin/wl-copy "$@"
'') '')
(pkgs.writeShellScriptBin "pbpaste" '' (pkgs.writeShellScriptBin "pbpaste" ''
exec ${pkgs.wl-clipboard}/bin/wl-paste -n exec ${pkgs.wl-clipboard}/bin/wl-paste "$@"
'') '')
]; ];