Skip to main content
Better solution
Source Link

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

EDIT: installing wl-clipboard was really simple, took a few KB on my system for something rather useful, and enabled the functionality of the + register. I also took others' advice and used nvim, which has worked flawlessly. Thanks all. Of course, if those things are prohibitive, see the above. And if you use XOrg, obviously you would use the x clipboard equivalent.

TLDR: Even with """clipboard support""", Vim expects there to be a copying utility/command, which you can configure. Vim automatically configures a certain number of these for you (see :help clipboard). You can also write your own. The problem is that my Vim had no way to access the Wayland system clipboard, as this wasn't configured. Installing wl-clipboard out of the gate fixed this issue because that is one of the clipboards that Vim supports out of the box.

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

EDIT: installing wl-clipboard was really simple, took a few KB on my system for something rather useful, and enabled the functionality of the + register. I also took others' advice and used nvim, which has worked flawlessly. Thanks all. Of course, if those things are prohibitive, see the above. And if you use XOrg, obviously you would use the x clipboard equivalent.

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

EDIT: installing wl-clipboard was really simple, took a few KB on my system for something rather useful, and enabled the functionality of the + register. I also took others' advice and used nvim, which has worked flawlessly. Thanks all. Of course, if those things are prohibitive, see the above. And if you use XOrg, obviously you would use the x clipboard equivalent.

TLDR: Even with """clipboard support""", Vim expects there to be a copying utility/command, which you can configure. Vim automatically configures a certain number of these for you (see :help clipboard). You can also write your own. The problem is that my Vim had no way to access the Wayland system clipboard, as this wasn't configured. Installing wl-clipboard out of the gate fixed this issue because that is one of the clipboards that Vim supports out of the box.

Better solution
Source Link

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

EDIT: installing wl-clipboard was really simple, took a few KB on my system for something rather useful, and enabled the functionality of the + register. I also took others' advice and used nvim, which has worked flawlessly. Thanks all. Of course, if those things are prohibitive, see the above. And if you use XOrg, obviously you would use the x clipboard equivalent.

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

EDIT: installing wl-clipboard was really simple, took a few KB on my system for something rather useful, and enabled the functionality of the + register. I also took others' advice and used nvim, which has worked flawlessly. Thanks all. Of course, if those things are prohibitive, see the above. And if you use XOrg, obviously you would use the x clipboard equivalent.

Improve formatting
Source Link
AdminBee
  • 23.6k
  • 25
  • 56
  • 77

From How to copy text from vim to an external program?

Hold down the shiftShift key and select text with the mouse cursor. Text Text will be copied to the clipboard. This This also works for pasting from the clipboard in to vimvim. To To be clear, this works for vimvim running in a terminal such as xtermxterm.

In my searches, I somehow didn't come across this before. This actually did Afterafter selecting the text, I could use Ctrl+Shift+CCtrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

From How to copy text from vim to an external program?

Hold down the shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did After selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

From How to copy text from vim to an external program?

Hold down the Shift key and select text with the mouse cursor. Text will be copied to the clipboard. This also works for pasting from the clipboard in to vim. To be clear, this works for vim running in a terminal such as xterm.

In my searches, I somehow didn't come across this before. This actually did after selecting the text, I could use Ctrl+Shift+C as normal.

Unfortunately, it copied line numbers as well, so I suppose I would have to disable those before copying. If anyone else has perhaps a more idiomatic way to do this, I would appreciate it.

Source Link
Loading