Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当设置时,快捷方式>>不会缩进#以 C 或 Python开头的行smartindent。
>>
#
smartindent
如果有人有解决方法,那就太酷了;我也发布了这个让人们知道(为什么那个键不起作用令人困惑和沮丧)。
这在 SO 的相关帖子中进行了讨论,该帖子提到:h smartindent并建议将 nosmartindent 设置为解决方法。您是否使用filetype indent on以获得完整的语言相关缩进?:
:h smartindent
filetype indent on
Vim 自动删除 Python 注释的缩进
是的,预期的行为>>不适#用于:help smartindent. 该文档还提供了一个解决方法:
:help smartindent
:inoremap # X^H#
其中 ^H 输入为Ctrl+ V Ctrl+H