<p>I want to paste something I have cut from my desktop into a file open in Vi.</p>

<p>But if I paste the tabs embed on top of each other across the page.</p>

<p>I think it is some sort of visual mode change but can't find the command.</p>

[{'answer_id': 58788, 'author': 'JayG', 'author_id': 5823, 'author_profile': 'https://Stackoverflow.com/users/5823', 'pm_score': 2, 'selected': False, 'text': '<p>If you are using VIM, you can use "*p (i.e. double quotes, asterisk, letter p).</p>\n'}, {'answer_id': 58794, 'author': 'Antti Kissaniemi', 'author_id': 2948, 'author_profile': 'https://Stackoverflow.com/users/2948', 'pm_score': 7, 'selected': True, 'text': '<h2>If you\'re using plain vi:</h2>\n<p>You probably have <code>autoindent</code> on. To turn it off while pasting:</p>\n<pre><code>&lt;Esc&gt; :set noai\n\n&lt;paste all you want&gt;\n\n&lt;Esc&gt; :set ai\n</code></pre>\n<p>I have in my <code>.exrc</code> the following shortcuts:</p>\n<pre><code>map ^P :set noai^M\nmap ^N :set ai^M\n</code></pre>\n<p>Note that these have to be the actual control characters - insert them using <kbd>Ctrl</kbd>-<kbd>V</kbd>\xa0<kbd>Ctrl</kbd>-<kbd>P</kbd> and so on.</p>\n<h2>If you\'re using vim:</h2>\n<p>Use the <a href="http://www.vim.org/htmldoc/options.html#%27paste%27" rel="noreferrer"><code>paste</code></a> option. In addition to disabling <code>autoindent</code> it will also set other options such as <code>textwidth</code> and <code>wrapmargin</code> to paste-friendly defaults:</p>\n<pre><code>&lt;Esc&gt; :set paste\n\n&lt;paste all you want&gt;\n\n&lt;Esc&gt; :set nopaste\n</code></pre>\n<p>You can also set a key to toggle the paste mode. My <code>.vimrc</code> has the following line:</p>\n<pre><code>set pastetoggle=&lt;C-P&gt; &quot; Ctrl-P toggles paste mode\n</code></pre>\n'}, {'answer_id': 59804, 'author': 'Edward Tanguay', 'author_id': 4639, 'author_profile': 'https://Stackoverflow.com/users/4639', 'pm_score': 0, 'selected': False, 'text': '<p>I found that if I copy tabbed lines first into a text editor and then recopy them from there to vim, then the tabs are correct.</p>\n'}]
['https://Stackoverflow.com/questions/58774', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6096/']