syntax on
"colorscheme monokai
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
"set expandtab " 设置tab键换空格
set tabstop=4 " 设置tab键的宽度
set shiftwidth=4 " 换行时行间交错使用4个空格
set autoindent " 自动对齐
set backspace=2 " 设置退格键可用
set cindent shiftwidth=4 " 自动缩进4空格
set smartindent " 智能自动缩进
set ai! " 设置自动缩进
"set nu! " 显示行号
set nocompatible " 关闭兼容模式
set hlsearch " 开启高亮显示结果
"set showmatch " 显示括号配对情况
"插入匹配括号
"inoremap { {}
syntax enable " 打开语法高亮
"下面的可以不用的,只要有上面这些也够用。
filetype indent on " 针对不同的文件类型采用不同的缩进格式
filetype plugin on " 针对不同的文件类型加载对应的插件
filetype plugin indent on " 启用自动补全
" 以下设置,如果你用框架的话,其实可以忽略
" 设置编码
set fenc=utf-8
set encoding=utf-8
set fileencodings=utf-8,gbk,cp936,latin-1
"只有在是PHP文件时,才启用PHP补全
au FileType php call AddPHPFuncList()
function AddPHPFuncList()
set dictionary-=/home/code/vim/funclist.txt dictionary+=/home/code/vim/funclist.txt
set complete-=k complete+=k
endfunction
分享一下,自用很多年的vim配置
最新推荐文章于 2023-07-30 00:00:25 发布