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
Post a Comment