When I’m in insert mode and I have the expandtab option switched on, pressing Tab ↹ results in inserting the configured number of spaces.
But occasionally I want to insert an actual tab character.
Do you know how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
<CTRL-V><Tab>in “insert mode”. In insert mode,<CTRL-V>inserts a literal copy of your next character.If you need to do this often, @Dee`Kej suggested (in the comments) setting Shift+Tab to insert a real tab with this mapping:
Also, as noted by @feedbackloop, on Windows you may need to press
<CTRL-Q>rather than<CTRL-V>.