.vimrc

set nocompatible

if !exists("syntax_on")
syntax on
endif

"windows model
"source $VIMRUNTIME/vimrc_example.vim
"source $VIMRUNTIME/mswin.vim
"behave mswin

"配色方案
colo darkblue

"不备份文件,备份文件很讨厌
set nobackup

"显示行号
"set nu

"设置tab字符个数
set tabstop=4

"设置自动将Tab键替换为空格
set expandtab

"设置回车换行后自动缩进宽度为4字符
set shiftwidth=4

"自动缩进
set autoindent

"更方便的退格键
set backspace=2

"查找高亮
set hlsearch

"增量查找
set incsearch

map V :w
"去除行首空格
map K :s/^[ ]*//

syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific indenting and plugins

" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim

augroup myfiletypes
autocmd!
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END

"自动检测文件类圿filetype on

"映射F8为显示列蟿需要taglist插件
nnoremap <silent> <F8> :Tlist<CR>

"字体
if (has("gui_running"))
set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
endif

"----------------below for txt file
"让文本文件也有高亮,thanks to xbeta@smth
augroup filetypedetect
au BufNewFile,BufRead *.* setf ztxt
augroup END

"缓冲区写入文件的时候自动检查文件类圿au BufWritePost * filet detect

"设定文件编码类型,彻底解决中文编码问頿let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936

autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1

set suffixesadd=.rb
set includeexpr+=substitute(v:fname,'s$','','g')
" or you can add substitution pattern s/ies$/y/g, s/ves$/f/g like this:
" set includeexpr+=substitute(substitute(substitute(v:fname,'s$','','g'),'ie$','y','g'),'ve$','f','g')

"let loaded_project=1

map <F11> <Esc>:set suffixesadd=.rb<CR>gf
map <F12> <Esc>:set suffixesadd=.rhtml<CR>gf

下面的命令可以设置或是取消缩进;
autoindent(自动缩进,即每行的缩进值与上一行相等;使用 noautoindent 取消设置)
说明:拷贝粘贴 就在已经缩进的基础上再缩进,所以就变得很乱.
可以 set noautoindent或者设置 set paste来解决
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值