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>
vim 配置vim
最新推荐文章于 2023-04-16 23:47:55 发布