vim - How do you paste multiple tabbed lines into Vi? -


i want paste have cut desktop file open in vi.

but if paste tabs embed on top of each other across page.

i think sort of visual mode change can't find command.

if you're using plain vi:

you have autoindent on. turn off while pasting:

<esc> :set noai  <paste want>  <esc> :set ai 

i have in .exrc following shortcuts:

map ^p :set noai^m map ^n :set ai^m 

note these have actual control characters - insert them using ctrl-v ctrl-p , on.

if you're using vim:

use paste option. in addition disabling autoindent set other options such textwidth , wrapmargin paste-friendly defaults:

<esc> :set paste  <paste want>  <esc> :set nopaste 

you can set key toggle paste mode. .vimrc has following line:

set pastetoggle=<c-p> " ctrl-p toggles paste mode 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -