vim 配置vim

set nocompatible
set background=dark
set nu

set cindent

au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
set cursorline cursorcolumn

" Leader
let mapleader = ","
nnoremap <leader>w :w<CR>
nnoremap <leader>q :q<CR>

" set backspace=2   " Backspace deletes like most programs in insert mode
" set nobackup
" set nowritebackup
" set noswapfile    " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler         " show the cursor position all the time
set showcmd       " display incomplete commands
set incsearch     " do incremental searching
" set laststatus=2  " Always display the status line
set autowrite     " Automatically :write before running commands
set confirm       " Need confrimation while exit
set encoding=utf-8
set fileencodings=utf-8,gb18030,gbk,big5
" set cindent
set autoindent
set smartindent
set smarttab
" set paste "ubuntu has a bug with this script
syntax enable

set tabstop=4
set shiftwidth=4
set shiftround
set expandtab

" map <F6> :call RUN()<CR>
" func RUN()
"     exec "w"
"     if &filetype == "cpp"
"         exec "call CompileC()"
"     elseif &filetype == "c"
"         exec "call CompileC()"
"     elseif &filetype == "java"
"         exec "call CompileJava()"
"     elseif &filetype == "python"
"         exec "call CompilePython()"
"     endif
" endfunc

" map <c-j> :call JsonFormat()<CR>


"minimal function call
map <f6> :call G__()<cr>

func G__()
exec "w"
exec "!g++ -w % -o %<"
exec "!./%<"
endfunc
"end here

func! CompileC()
exec "w"
exec "!g++ -w % -o %<"
exec "!./%<"
endfunc

func! CompileJava()
exec "w"
exec "!javac %"
exec "!java %<"
endfunc

func! CompilePython()
exec "w"
exec "!python %"
endfunc

func! JsonFormat()
exec '%!python -m json.tool' | w
endfunc

filetype off
 set rtp+=~/.vim/bundle/Vundle.vim
 call vundle#begin()
 " alternatively, pass a path where Vundle should install plugins
 "call vundle#begin('~/some/path/here')
 " let Vundle manage Vundle, required
  Plugin 'VundleVim/Vundle.vim'
  Plugin 'vim-scripts/tComment'
  Plugin 'benmills/vimux'
  Plugin 'Raimondi/delimitMate'
  Plugin 'scrooloose/nerdtree'
  Plugin 'msanders/snipmate.vim'
  Plugin 'vim-scripts/javacomplete'
  " Plugin 'godlygeek/tabular'
  " Plugin 'plasticboy/vim-markdown'
  " Plugin 'Valloric/YouCompleteMe'
  " Plugin 'scrooloose/syntastic'
  " Plugin 'vim-scripts/taglist.vim'
  " Plugin 'tpope/vim-surround'
  " Plugin 'vim-airline/vim-airline'

 " All of your Plugins must be added before the following line
 call vundle#end()            " required
 filetype plugin indent on    " required
 " To ignore plugin indent changes, instead use:
 "filetype plugin on
 "
 " Brief help
 " :PluginList       - lists configured plugins
 " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
 " :PluginSearch foo - searches for foo; append `!` to refresh local cache
 " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
 "
 " see :h vundle for more details or wiki for FAQ
 " Put your non-Plugin stuff after this line
 filetype on

 map <c-c> <Esc>

" let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'

 set rtp+=~/.vim/bundle/javacomplete/autoload

autocmd filetype java setlocal omnifunc=javacomplete#Complete
autocmd filetype java setlocal completefunc=javacomplete#CompleteParamsInfo
autocmd FileType java inoremap . .<C-X><C-O><C-P>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值