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

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

1 Answer 1


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.