我的.vimrc仅供参考,未完待续

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Vundle setup
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible              " be iMproved
filetype on                   "helpful
filetype off                  " required!

" let Vundle manage Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" vim plugin bundle control, command model
" :BundleInstall     install
" :BundleInstall!    update
" :BundleClean       remove plugin not in list

"need git
Bundle 'gmarik/vundle'
"independent plugins
Bundle 'mhinz/vim-startify'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'Raimondi/delimitMate'
Bundle 'altercation/vim-colors-solarized'
Bundle 'bling/vim-airline'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'Shougo/neocomplcache.vim'
Bundle 'Shougo/neosnippet.vim'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
Bundle 'kien/ctrlp.vim'
Bundle 'godlygeek/tabular'
Bundle 'bronson/vim-trailing-whitespace'
Bundle 'Shougo/vimshell.vim'
Bundle 'majutsushi/tagbar'


"Enable detection,plugins and indenting in one step
filetype plugin indent on     " required!
syntax enable
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"colorscheme
let g:solarized_termcolors=256
colorscheme solarized
set background=dark
set t_Co=256

"airline custermization
"let g:airline_theme = 'solarized'
let g:airline_left_sep='›'
let g:airline_right_sep='‹'

" TagBar {
nnoremap <silent> <leader>tt :TagbarToggle<CR>

 " neocomplcache {
            let g:acp_enableAtStartup = 0
            let g:neocomplcache_enable_at_startup = 1
            let g:neocomplcache_enable_camel_case_completion = 1
            let g:neocomplcache_enable_smart_case = 1
            let g:neocomplcache_enable_underbar_completion = 1
            let g:neocomplcache_enable_auto_delimiter = 1
            let g:neocomplcache_max_list = 15
            let g:neocomplcache_force_overwrite_completefunc = 1

            " SuperTab like snippets behavior.
            imap <silent><expr><TAB> neosnippet#expandable() ?
                        \ "\<Plug>(neosnippet_expand_or_jump)" : (pumvisible() ?
                        \ "\<C-e>" : "\<TAB>")
            smap <TAB> <Right><Plug>(neosnippet_jump_or_expand)

                inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
                inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"

                " <CR>: close popup
                " <s-CR>: close popup and save indent.
                inoremap <expr><s-CR> pumvisible() ? neocomplcache#close_popup()"\<CR>" : "\<CR>"
                inoremap <expr><CR> pumvisible() ? neocomplcache#close_popup() : "\<CR>"

                " <C-h>, <BS>: close popup and delete backword char.
                inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
                inoremap <expr><C-y> neocomplcache#close_popup()
            " }

            " For snippet_complete marker.
            if has('conceal')
                set conceallevel=2 concealcursor=i
            endif

            " Disable the neosnippet preview candidate window
            " When enabled, there can be too much visual noise
            " especially when splits are used.
            set completeopt-=preview
    " }

"Ctags
set tags=./tags;/,~/.vimtags

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"base configuration
set timeoutlen=300 "manpping timeout
set ttimeoutlen=50 "keycode timeout
set mouse=a "enable mouse
set mousehide "hide when type
set history=1000
set undolevels=1000
set ttyfast "assume fast terminal
set viewoptions=folds,options,cursor,unix,slash


set scrolloff=2
set scrolljump=5
set showmatch
set matchtime=2
set number
set showmode
set showcmd
set lazyredraw
"set ruler
set title
set cursorline
set cursorcolumn
"When yout type the first tab,it will complete as much as possible,the
"second tab hit will provide a list,the third and subsequent tabs will
"cycle through completion options so you can complete the file without
"further keys
"
set foldenable                                      "enable folds by default
set foldmethod=syntax                               "fold via syntax of files
set foldlevelstart=99                               "open all folds by
let g:xml_syntax_folding=1                          "enable xml folding


set wildmenu
set wildmode=list:full
set completeopt=menu,preview,longest
set wildignorecase
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store

set splitbelow
set splitright

 " disable sounds
 set noerrorbells
 set novisualbell
 set t_vb=
"This changes the default display of tab and CR chars in list mode
set list
set listchars=tab:│\ ,trail:•,extends:❯,precedes:❮

set linebreak
let &showbreak='↪ '

"Editor settings
set ignorecase
set smartcase
set autoindent
set copyindent
set cindent
set cino=b1,g0,N-s,t0,(0,W4)
set smarttab
set magic
set bs=indent,eol,start
set nobackup
set nowrap
set tabstop=4           " number of spaces a tab counts for
set shiftwidth=4        " spaces for autoindents
set softtabstop=4
set shiftround          " makes indenting a multiple of shiftwidth
set expandtab           " turn a tab into spaces
set laststatus=2        " the statusline is now always shown
set noshowmode          " don't show the mode ("-- INSERT --") at the bottom

" order
"
set viminfo='20,\"500
set hidden
set autoread

set pastetoggle=<F7>
set mousemodel=popup_setpos
set shortmess+=filmnrxoOtT
" none of these should be word dividers, so make them not be
set iskeyword+=_,$,@,%,#

" Number of screen lines to use for the command-line
set cmdheight=2

" allow backspace and cursor keys to cross line boundaries
set whichwrap+=<,>,h,l
set nohlsearch          " do not highlight searched-for phrases
set incsearch           " ...but do highlight-as-I-type the search string
set gdefault            " this makes search/replace global by default

" enforces a specified line-length and auto inserts hard line breaks when we
" reach the limit; in Normal mode, you can reformat the current paragraph with
" gqap.
set textwidth=80

" this makes the color after the textwidth column highlighted
set colorcolumn=+1

" options for formatting text; see :h formatoptions
set formatoptions=tcroqnj


if v:version >= 704
  set regexpengine=1
endif



if has('unnamedplus')
  " See :h 'clipboard' for details.
  set clipboard=unnamedplus,unnamed
else
  " Vim now also uses the selection system clipboard for default yank/paste.
  set clipboard+=unnamed
endif

"file encode,文件编码,格式
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set helplang=cn
set termencoding=utf-8
" misc settings
set fileformat=unix     " file mode is unix
set fileformats=unix,dos,mac   " detects unix, dos, mac file formats in that
set nrformats-=octal

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"key map
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

let mapleader = ','
let g:mapleader = ','

"Smart way to move between windows 分屏窗口移动
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l

"Use arrow key to change buffer"
noremap <left> :bp<CR>
noremap <right> :bn<CR>

map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove


" Quickly close the current window
nnoremap <leader>q :q<CR>
nnoremap <leader>wq :wq<CR>

" automatically reload vimrc when it's saved
au BufWritePost .vimrc so ~/.vimrc


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值