使用VIM中的autoindent
配置時,它將在創建新行後自動將光標縮進到有意義的位置。但是,當您輸入的第一個字符是散列字符(#
)時,將刪除縮進並將#
作爲該行的第一個字符插入。如何不通過插入`#`來刪除縮進?
這是爲什麼發生?如何配置VIM不這樣做?
例(_
爲空光標位置):
def python_function():
_
點擊#
鍵盤上後,這種情況發生:
def python_function():
#_
但什麼應該發生是這樣的:
def python_function():
#_
檢出http://stackoverflow.com/questions/191201/indenting-comments-to-match-code-in-vim和http://stackoverflow.com/questions/385327/what-setting-in-vim -counteracts-smartindents-refusal-to-indent-comments-in-sh –
你說得對,我只是不知道如何搜索這個詞。 – erikbwork