kakoune: support wayland or X clipboard (autodetect)

This commit is contained in:
2026-05-16 18:26:54 +02:00
parent 7656f1db67
commit 3aa7246458

View File

@@ -45,9 +45,21 @@ map global -docstring 'LP Light mode' options-mode 'l' ': colorscheme four-color
map global -docstring 'Light mode' options-mode 'L' ': colorscheme one-light<ret>' map global -docstring 'Light mode' options-mode 'L' ': colorscheme one-light<ret>'
map global -docstring 'Dark mode' options-mode 'D' ': colorscheme one-darker<ret>' map global -docstring 'Dark mode' options-mode 'D' ': colorscheme one-darker<ret>'
map global -docstring 'Paste clipboard (append)' user 'p' '<a-!> xsel -bo<ret>' evaluate-commands %sh{
map global -docstring 'Paste clipboard (insert)' user 'P' '! xsel -bo<ret>' if [ -n "$WAYLAND_DISPLAY" ]; then
map global -docstring 'Yank to clipboard' user 'y' '<a-|> xsel -bi<ret>' echo "
map global -docstring 'Paste clipboard (append)' user 'p' '<a-!> wl-paste -n<ret>'
map global -docstring 'Paste clipboard (insert)' user 'P' '! wl-paste -n<ret>'
map global -docstring 'Yank to clipboard' user 'y' '<a-|> wl-copy<ret>'
"
elif [ -n "$DISPLAY" ]; then
echo "
map global -docstring 'Paste clipboard (append)' user 'p' '<a-!> xsel -bo<ret>'
map global -docstring 'Paste clipboard (insert)' user 'P' '! xsel -bo<ret>'
map global -docstring 'Yank to clipboard' user 'y' '<a-|> xsel -bi<ret>'
"
fi
}
map global -docstring 'Replace jump mode' user 'j' ': enter_jump_mode_with_replace_select_mode<ret>' map global -docstring 'Replace jump mode' user 'j' ': enter_jump_mode_with_replace_select_mode<ret>'
map global -docstring 'Extend jump mode' user 'e' ': enter_jump_mode_with_extend_select_mode<ret>' map global -docstring 'Extend jump mode' user 'e' ': enter_jump_mode_with_extend_select_mode<ret>'