如何在Vim中插入一个真正的制表符? [英] How can I insert a real tab character in Vim?

查看:2091
本文介绍了如何在Vim中插入一个真正的制表符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在这里有vimrc时:

When I have my vimrc here:

set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set smarttab

安装。每当我在插入模式下,我按tab,它显示自动完成,但有时我想插入一个真正的tab字符在字符串文字。所以我的意思是每当我在双引号字符串文字中按Tab键,它应该输入一个真正的制表符字符。

And I have supertab plugin installed. Whenever I am in insert mode I press tab, it shows the auto completion, but sometimes I would like to insert a real tab character in a string literal like. So what I mean whenever I press tab in double quotes string literal, it should input we a real tab character.

推荐答案

插入模式或命令模式(编辑器底部的提示符),键入 CTRL + V kbd> TAB 。

While in insert mode or command mode (the : prompt at the bottom of the editor), type CTRL + V then TAB.

使用 CTRL + V 指示Vim应该接受下一个字符。即使是插入模式。

Using CTRL + V signals Vim that it should take the next character literally. Even in insert mode.

UPDATE:

如Herbert Sitz所述,如果gVim处于Windows模式默认值),您必须使用 CRTL + Q 代替 CTRL + V

As noted by Herbert Sitz, if gVim is in Windows mode (default), you must use CRTL + Q in place of CTRL + V.

这篇关于如何在Vim中插入一个真正的制表符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆