.vimrc备份,以作以后参考

Vim | 2012-12-08 18:59:59 | 阅读 1885 次 | 评论(0)
runtime! debian.vim

call pathogen#infect()

if has("syntax")
  syntax on
endif

set nu
set ts=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set hlsearch
colorscheme molokai

au BufNewFile,BufRead *.rb,*.html,*.htm,*.erb,*.yaml,*.yml,*.sass,*.scss set softtabstop=2 | set shiftwidth=2
au BufNewFile,BufRead *.html.erb set filetype=html
au BufNewFile,BufRead *.scss set filetype=css
au BufNewFile,BufRead *.go set filetype=go
au BufRead *.c,*.cpp,*.py,*.rb,*.go nmap <F5> :call CompileRun()<CR>
func! CompileRun()
    exec "w"
    if &filetype == 'c'
        exec "!gcc % -o %<"
        exec "! ./%<"
    elseif &filetype == 'cpp'
        exec "!g++ % -o %<"
        exec "! ./%<"
    elseif &filetype == 'python'
        exec "!python %"
    elseif &filetype == 'ruby'
        exec "!ruby %"
    elseif &filetype == 'go'
        exec "!go run %"
    endif
endfunc

"zencoding相关设置
let g:user_zen_expandabbr_key = '<c-space>'

"CtrlP相关设置,快捷键绑定仅在gvim下有效,因为vi下无法识别alt键
map <a-x> :CtrlP<CR>
map <a-e> :CtrlPMRU<CR>
set wildignore+=*/doc/*,*.so,*.swp,*.zip

"方向键绑定
imap <a-h> <Left>
imap <a-j> <Down>
imap <a-k> <Up>
imap <a-l> <Right>
imap <c-h> <Home>
imap <c-l> <End>
imap <S-CR> <Esc>o
imap <C-CR> <Esc><S-o>

if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd		" Show (partial) command in status line.
"set showmatch		" Show matching brackets.
"set ignorecase		" Do case insensitive matching
"set smartcase		" Do smart case matching
"set incsearch		" Incremental search
"set autowrite		" Automatically save before commands like :next and :make
"set hidden             " Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif
文章评论,共0条
游客请输入验证码
浏览1730065次
文章归档
最新评论