Reputation: 59
I enabled vim-gtk, opened a file, did :set nu
, but the command :%y+
does not copy the line numbers to the clipboard.
That may be resolved in visual mode (I do not know how to use it), but sometimes files are very long and I guess it is impractical.
Also does :set nonumber
have a shorter alias like :set number
has :set nu
?
Upvotes: 0
Views: 207
Reputation: 1773
To copy the entire file with line numbers to the "+
register (which is CLIPBOARD
buffer under X11) you may use:
:redir @+ | silent %# | redir END
Upvotes: 3
Reputation: 3367
:set nonumber
is the same as :set nonu
.
Line numbers will not be copied. But, if you copy the entire file, just enable line numbers where you paste in.
Upvotes: 1