indentLine icon indicating copy to clipboard operation
indentLine copied to clipboard

Identation lines get copied/pasted

Open lmiq opened this issue 4 years ago • 3 comments

The identation lines get copied with the code. For example:

function f(x)
  if x == 1
  │ println(x)
  end
end

Of course, this invalidates the code when pasting from one file to the other, or to a REPL. Is there a workaround around this? (I am using Mint 20.1 with the default terminal, copy/paste, etc)

lmiq avatar Jun 14 '21 13:06 lmiq

Have you tried yanking the lines to the system clipboard instead "+y - assuming your vim build supports clipboard.

honeyglazed avatar Jul 12 '21 05:07 honeyglazed

Yes, there are workarounds like that. But it is annoying that one cannot use "select -> middle click" to copy/paste. But I was told that changing that would be complicated. Unfortunately that makes me not using identation in vim most of the time.

lmiq avatar Jul 12 '21 11:07 lmiq

You could maybe map a shortcut to the command :IndentLinesToggle and toggle off the indent symbols before copying?

Then after you're done copying, run the last command (either though history or with @:) to toggle them back on That's how I do it...

LemonadeJoseph avatar Aug 01 '21 10:08 LemonadeJoseph