vim 基本配置

set nocompatible              " be improved, required


"disable popup preview window while auto-completing
set completeopt-=preview
filetype off                  " required


" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()


" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'


" auto complete
Plugin 'Valloric/YouCompleteMe'


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required




"ycm setting"""""""""""""""""""""""
let g:ycm_autoclose_preview_window_after_insertion=1
"swith to next candidate 
let g:ycm_key_list_select_completion = ['<TAB>']
"finish current selection
let g:ycm_key_list_stop_completion = ['Enter']
set completeopt -=preview,menuone


set number
" if no clean, cannot enable paste by using right-click
set mouse=
nnoremap tr :let a=expand("<cword>")<Bar>exec '!translate ' .a<CR>


"Let tab replaced by 2 spaces
set ts=2
set expandtab
set shiftwidth=2
set autoindent


" Enable backspace deleting
set backspace=indent,eol,start


" High light colorful
syntax on


"vsp default to right
set splitright


"map ff to list go funcs in current file
nnoremap ff :let a=expand('%:p')<Bar> exec '!/bin/cp ' .' -rf ' .a .' /tmp/rand862102937387979203.txt' <Bar>exec '!findgo ' .a <CR>:vsp /tmp/go_funcs_0928342.funcs<CR><CR>




let g:go_template_autocreate = 0
filetype plugin indent on
au BufRead,BufNewFile *.go set filetype=go
au bufnewfile *.go so $HOME/.vim/.goheader.txt
au bufnewfile *.go exe "%g/@AUTHOR/s//wangxugang(xgwang@clustertech.com)/" 
au bufnewfile *.go exe "%g/@YEAR/s//".strftime("%Y")."/" 


let mapleader = ","
nnoremap <leader>b :GoBuild<CR>
inoremap <C-z>  <C-x><C-o>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值