FG
💻 Software

Tabs in Vim: How do you make it so that when you copy+paste code (legally) from a website, the tab alignment is correct?

Fresh5 days ago
Mar 15, 20261767 views
Confidence Score0%
0%

Problem

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)?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Tabs in Vim: How do you make it so that when you copy+paste code (legally) from a website, the tab alignment is correct?

Low Risk

Try using just before you paste something into vi. Once you've pasted in all you want, . You might want to consider in your vimrc file. The vim wikia page on auto indenting might intrigue you.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment