分享一下,自用很多年的vim配置

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值