How to insert tab character when expandtab option is on in Vim

后端 未结 3 1576
孤街浪徒
孤街浪徒 2021-01-29 17:14

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

3条回答
  •  一生所求
    2021-01-29 17:35

    You can use in "insert mode". In insert mode, 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:

    :inoremap  
    

    Also, as noted by @feedbackloop, on Windows you may need to press rather than .

提交回复
热议问题