indentation - Vim editor indent problem when the first character of the line is a sharp # character -


this haven been bugging me since first day using vim 3 years. whenever try indent line via shift + > when first character of line starts "#", doesn't work @ all, regardless of file types (.php, .txt, etc.). because # used comment in php , use decoration text files like:

# comment  ### 1. instruction 1  # ------------ sample --------------

i use vim 7.2 in ubuntu following .vimrc settings

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 

thanks!

insert following in .vimrc:

set nosmartindent 

it smartindent causes lines beginning # not indented want. can read more typing :help smartindent. if use indenting file python scripts (or other syntax), include following too.

filetype indent on 

Comments

Popular posts from this blog

how to build hyperlink for query string in php -

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

queue - mq_receive: message too long -