5

So the tabbing is correct on the website itself, but when I paste it into the terminal, each line becomes tabbed further out than the previous one, and is horrendous to fix manually. How do you make it so that the alignment remains the same as it was when it was on the website (correct)?

bertieb
  • 7,344
  • 36
  • 42
  • 54
Dark Templar
  • 2,559
  • 5
  • 24
  • 25

2 Answers2

6

Try using :set paste just before you paste something into vi. Once you've pasted in all you want, :set nopaste.

You might want to consider set noautoindent in your vimrc file. The vim wikia page on auto indenting might intrigue you.

Wesley
  • 4,505
  • 2
  • 22
  • 43
2

Vim is capable of pasting indented code from the clipboard without using the mouse. Example: Mark your text in firefox, open vim, then use " * ] p. See :help ]p:

["x]]p or *]p* *]<MiddleMouse>* ["x]]<MiddleMouse> Like "p", but adjust the indent to the current line. Using the mouse only works when 'mouse' contains 'n' or 'a'. {not in Vi}

evnu
  • 465
  • 3
  • 9