Vim编辑器缩进问题,当行的第一个字符是一个锋利的#字符

自从第一天使用Vim 3年以来,这个天堂一直在欺骗我.每当我尝试通过Shift>当该行的第一个字符以“#”开始时,无论文件类型(.PHP,.txt等)如何,都不起作用.因为#用于 PHP中的评论,我也用它来装饰文本文件,如:
# This is a comment

### 1. Instruction one

# ------------ this is an sample --------------

我在Ubuntu中使用Vim 7.2,使用以下.vimrc设置

Syntax on
set t_Co=256
set incsearch
set hlsearch
set number
set Nowrap
set Nowrapscan
set ignorecase
set et
set sw=4
set smarttab
set smartindent
set autoindent
set textwidth=0
set noequalalways
set formatoptions=1
set lbr
set vb      
set foldmethod=marker

谢谢!

在.vimrc中插入以下内容
set nosmartindent

这是smartindent,导致以#开头的行不要缩进.您可以通过键入以下内容了解更多信息:help smartindent.如果您使用缩进文件进行python脚本(或任何其他语法),还包括以下内容.

filetype indent on

相关文章

解决方案:解决linux下vim乱码的情况:(修改vimrc的内容)全...
Linuxvi/vim所有的UnixLike系统都会内建vi文书编辑器,其他的...
      vim正则匹配:空行:/^$/  /^[\t]*$/注释...
$select-editorSelectaneditor.Tochangelater,run'sele...
上次手贱忘了保存,这次就简单做个备忘吧,把踩过的坑记一下...
Linux之文本编译器小结vim的优势所有的UNIX-LIKE习通都会内置...