Toggle or temporarily hide gutter

Hi,

I wonder if it’s possible to hide the gutter temporarily, so that it’s easier to copy and paste part of a file I’m editing from the terminal window.
Yes, I know there are ways to interact with the system clipboard, but the kakoune instance is running in a tmux window inside an SSH session where I can’t get X forwarding to work.

In vim, I “just” selected the text to paste, then did :<,>w !cat, so that it launched cat on the selection. Needless to say, I’m hoping for a less convoluted workflow, hence the question. I’m open for suggestions that doesn’t involve hiding the gutter at all, but that seems like the simplest thing I could think of to achieve what I want, right after I failed to find something equivalent to the vim command. If toggling the gutter is too much effort, I’d also be OK with copying the selection to a fresh buffer without a gutter, for example.

You can temporarily remove the highlighters although this becomes awkward if you have extra things in the gutter, for example linter errors. If you’re using tmux then this user mapping

map global user y \
  '<a-|> cat > /tmp/kak-cpy && tmux new-window "cat /tmp/kak-cpy; read -n1"<ret>'

will put the current selection into a temp file and then open the contents in a new tmux window where you can select and copy them. read -n1 will keep the window open until you press a key. If you have multiple selections then the default behavior of the | key means it will do the operation for each selection. Hope this helps.

1 Like

Thanks, that works perfectly!