vim - auto comment
Hi,
I am copying some code from a perl source file into a new one. What happens each time is that if the code i'm copying from contains a comment (#) the vim i am copying to adds a # to all subsequent lines! So if a am copying Code:
#this is a comment Code:
#this is a comment I'd like to switch this off,but i have not been able to find the command yet. Any one know what this is so i can switch it off. Thans |
Hi Baddah,
Can you please explain me how do you do to copy the code? So I can try to reproduce, and maybe find a solution. Best regards, Angel |
I was having the same prob and managed to fix it. Its when you've got 2 xterm/vim sessions open and you copy/paste with the mouse from one to the other.
If the src window/file had a comment at the end of the line (or as the whole line) as in Perl/shell ie '#', then the target ended up with '#' on each line and the next newline, as per his example. Not exactly sure how I fixed it ( ;) ), but : 1. mv /etc/vimrc /etc/vimrc_bak 2. mv /etc/virc /etc/virc_bak 3. here's my new/current $HOME/.vimrc Code:
" Use Vim settings, rather then Vi settings (much better!). :) |
Quote:
Thanks |
Hi Baddah,
You're probably looking for this command :set paste Or you can add this line to your ~/.vimrc (which will allow you to toggle between paste and nopaste with Ctrl+P) nm <C-P> :se invpaste paste?<CR> Br, Beetle |
All times are GMT -5. The time now is 11:19 AM. |