I am using vim through and SSH connection. I have the numbers setting set, and so when ever I try to copy sections of my code with the mouse...it grabs the numbers also. Is there a good way to copy text that doesn't grab the numbers with it. (I know that with in that instance of vim I can use Y, but I need a way to copy to other instances and programs).
Here's an example of what I am talking about.
1 function foo ( home, ip, hash, regex )
2 {
3 return false;
4 }
Thank you all very much for the advice.
Toggle the 'number'
setting with a !
:set nu!
Run it once to turn off 'number'
. Run the command again to turn the setting back on.
I use the following mapping in my ~/.vimrc
:
nnoremap <leader>tn :set nu! nu?<cr>
It will toggle the setting and then echo out the current value of 'number'
For more help see:
:h 'nu'
:h :set-!
:set nonumber
copy what you want
:set number
:help number
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With