How can I select a block with a mouse when line numbering is enabled. The selection includes the line numbering. Is there a way to exclude the line numbering from mouse selection ?

Clarification: The questions if for VIM, not GVIM

marked as duplicate by John O'M., kenorb, Martin Tournoij, muru, Doorknob Feb 19 '15 at 2:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You're not using GVim, right? In GVim I just tried this and the numbers are not selected. – Gonçalo Ribeiro Feb 18 '15 at 20:15
  • nope. using vim in a virtual terminal – stdcall Feb 18 '15 at 20:16
  • 2
    :set mouse=a should solve your problem. – romainl Feb 18 '15 at 20:21

OK. So this does not use the mouse.
But that's the whole point of vim (not needing to use the mouse).

You can use the vim normal copy command (which will not select the line numbers). To get it into the system clipboard just use the buffer *

"*<Normal Yank Command>

You have now yanked the text you want into the system clipboard and it can be pasted as normal. The Yank command you use can be any normal vim yank command.

Not the answer you're looking for? Browse other questions tagged or ask your own question.