View previous topic :: View next topic |
Author |
Message |
papu l33t
Joined: 25 Jan 2008 Posts: 728 Location: Sota algun pi o alzina...
|
Posted: Wed Nov 02, 2016 10:31 am Post subject: [SOLVED] how to stop vim doing this....? |
|
|
every time a paste some text that content espaces/tabs, vim is doing like this:
EXAMPLE, if i try to copy --->
Code: | Section "Monitor"
Identifier "Monitor0"
EndSection
Section "Device"
Identifier "Device0"
Driver "amdgpu"
Option "DRI" "3"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection |
and then paste inside vim--->
https://i.imgur.com/wRc40bf.png
it's so annoying _________________ --so ~amd64 & openrc --cpu 7700 non-x --ram 2x16GB --gpu RX 470
Last edited by papu on Wed Nov 02, 2016 11:37 am; edited 3 times in total |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31202 Location: here
|
Posted: Wed Nov 02, 2016 10:37 am Post subject: |
|
|
Before paste set paste mode that will prevent vim from re-tabbing your code :set paste, after you can reset with :set nopaste _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
papu l33t
Joined: 25 Jan 2008 Posts: 728 Location: Sota algun pi o alzina...
|
Posted: Wed Nov 02, 2016 11:24 am Post subject: |
|
|
thank you
then i find that typing in mode command "*p or "+p do same thing
_________________ --so ~amd64 & openrc --cpu 7700 non-x --ram 2x16GB --gpu RX 470
Last edited by papu on Thu Nov 03, 2016 3:55 pm; edited 1 time in total |
|
Back to top |
|
|
miket Guru
Joined: 28 Apr 2007 Posts: 496 Location: Gainesville, FL, USA
|
Posted: Wed Nov 02, 2016 8:56 pm Post subject: |
|
|
I switch between paste and normal-indent mode so often I included this line in my .vimrc Code: | set pastetoggle=<f5> |
Now when I type the F5 key--in either visual or command mode--vim switches in or out of paste mode for me. |
|
Back to top |
|
|
papu l33t
Joined: 25 Jan 2008 Posts: 728 Location: Sota algun pi o alzina...
|
Posted: Wed Nov 02, 2016 11:54 pm Post subject: |
|
|
miket wrote: | I switch between paste and normal-indent mode so often I included this line in my .vimrc Code: | set pastetoggle=<f5> |
Now when I type the F5 key--in either visual or command mode--vim switches in or out of paste mode for me. |
oh, thanks!
Code: | Some people like the visual feedback shown in the status line by the following alternative for your vimrc:
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
The first line sets a mapping so that pressing F2 in normal mode will invert the 'paste' option, and will then show the value of that option. The second line allows you to press F2 when in insert mode, to toggle 'paste' on and off. The third line enables displaying whether 'paste' is turned on in insert mode. |
_________________ --so ~amd64 & openrc --cpu 7700 non-x --ram 2x16GB --gpu RX 470 |
|
Back to top |
|
|
|