vim代码自动格式化
发表于 : 2010-04-22 22:46
我在shell中使用vim编辑C代码,可是每次按回车后光标都会到下一行的最开头,而不是自动格式化到正确的位置。请问如何使vim打开格式化代码的功能呢?
代码: 全选
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Auto indent
set autoindent
" Smart indet
set smartindent
" C-style indeting
set cindent
" Set tabstop width
set tabstop=4
set shiftwidth=4
set softtabstop=4
" Enable filetype plugin
filetype on
filetype plugin on
filetype indent on
" Set <BS> delete fake tabs
set smarttab
" Insert spaces instead of real tabs
set expandtab
196 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""vimindel 写了:我在shell中使用vim编辑C代码,可是每次按回车后光标都会到下一行的最开头,而不是自动格式化到正确的位置。请问如何使vim打开格式化代码的功能呢?