Last active
August 29, 2015 14:14
-
-
Save vitohuang/04f3763a4ebf893a93b2 to your computer and use it in GitHub Desktop.
.vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"NeoBundle Scripts----------------------------- | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
" Required: | |
call neobundle#begin(expand('~/.vim/bundle')) | |
" Let NeoBundle manage NeoBundle | |
" Required: | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
" Add or remove your Bundles here: | |
NeoBundle 'Shougo/vimproc.vim', { | |
\ 'build' : { | |
\ 'windows' : 'tools\\update-dll-mingw', | |
\ 'cygwin' : 'make -f make_cygwin.mak', | |
\ 'mac' : 'make -f make_mac.mak', | |
\ 'linux' : 'make', | |
\ 'unix' : 'gmake', | |
\ }, | |
\ } | |
NeoBundle 'Shougo/neosnippet.vim' | |
NeoBundle 'Shougo/neosnippet-snippets' | |
NeoBundle 'tpope/vim-fugitive' | |
"NeoBundle 'ctrlpvim/ctrlp.vim' | |
NeoBundle 'flazz/vim-colorschemes' | |
NeoBundle 'Shougo/unite.vim' | |
" You can specify revision/branch/tag. | |
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' } | |
" Required: | |
call neobundle#end() | |
" Required: | |
filetype plugin indent on | |
" If there are uninstalled bundles found on startup, | |
" this will conveniently prompt you to install them. | |
NeoBundleCheck | |
"End NeoBundle Scripts------------------------- | |
" ---------- General ---------- | |
" Syntax always on | |
syntax on | |
" Line number | |
set number | |
" Vim set terminal title | |
set title | |
" Unicode | |
set encoding=utf-8 | |
" Dictionary | |
set dictionary=/usr/share/dict/words | |
" Undo and backup | |
set undofile | |
set undodir=~/.vim/tmp/undo/ | |
set backup | |
set backupdir=~/.vim/tmp/backup/ | |
" Always have filenames | |
set laststatus=2 | |
" ---------- Appearance ---------- | |
set number | |
" Show command in status line | |
set showcmd | |
" Don't redraw, lazy! | |
set lazyredraw | |
" Flash screen not bell | |
set visualbell | |
" Show match | |
set showmatch | |
" Wrap long lines | |
set wrap | |
" Ruler at the bottom | |
set ruler | |
"set the cursorline | |
set cursorline | |
hi cursorline guibg=#333333 | |
hi CursorColumn guibg=#333333 | |
"command window height | |
set cmdheight=2 | |
" ---------- Behaviors ---------- | |
" Global chosen | |
set gdefault | |
" Vim internal tab-completion | |
set wildmenu | |
set wildmode=list:longest | |
" Search | |
"nnoremap / /\v | |
"vnoremap / /\v | |
set ignorecase | |
set smartcase | |
set incsearch | |
set magic | |
set hlsearch | |
" Mouse | |
set mouse=a | |
" ----------- File type ---------- | |
filetype on | |
filetype plugin on | |
"filetype indent on | |
filetype plugin indent on | |
" Auto indent | |
set autoindent | |
" autocomdn FileType set file type specific settings, setlocal means only | |
" apply to the current session of vim | |
" turn omni completion features on | |
autocmd FileType php set omnifunc=phpcomplete#CompletePHP | |
autocmd FileType php set keywordprg=phpdoc | |
autocmd FileType python set omnifunc=pythoncomplete#Complete | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType css set omnifunc=csscomplete#CompleteCSS | |
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType c set omnifunc=ccomplete#Complete | |
autocmd FileType scss setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
"autocomdn can also tell vim to treat certain extension a specific file type | |
" autocmd BufNewFile, BufRead *.rss,*.atom set filetype=xml | |
autocmd BufNewFile, BufRead *.rss,*.atom setfiletype xml | |
autocmd BufNewFile, BufRead *.rss,*.atom setfiletype xml | |
autocmd BufNewFile, BufRead *.config set filetype=config | |
autocmd BufNewFile, BufRead *.scss set filetype=css | |
" ---------- Style ---------- | |
" Hightlight merge conflict | |
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' | |
" set listchars, so when set list will using ▸ and 3 space instead of tab | |
" character and end of line as ¬ | |
set listchars=tab:▸\ ,eol:¬ | |
"set fillchars=vert:│ | |
" Mark lines that have been wrapped | |
set showbreak=↪ | |
" ---------- Key binding ---------- | |
"map leader | |
let mapleader="," | |
" Open .vimrc to edit | |
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr> | |
"quickfix command | |
"display the next grep finding | |
map <leader>n :cn<cr> | |
"display the previous grep finding | |
map <leader>p :cp<cr> | |
"display overview of grep findings | |
map <leader>c :cw<cr> | |
" ---------- Plugins ---------- | |
" Syntastic error highlight | |
NeoBundle 'scrooloose/syntastic' | |
" Airline | |
NeoBundle 'bling/vim-airline' | |
"let g:airline#extensions#tabline#enabled = 1 | |
" when only one tab is open, show all of the open buffers | |
" user powerline patched fonts = no | |
"let g:airline_powerline_fonts = 0 | |
"let g:airline#extensions#tabline#left_alt_sep = '|' | |
" dict of configurably unicode symbols. mmmmmmmmmm | |
if !exists('g:airline_symbols') | |
let g:airline_symbols = {} | |
endif | |
let g:airline_symbols.branch = '⎇' | |
let g:airline_symbols.paste = 'ρ' | |
let g:airline_symbols.whitespace = 'Ξ' | |
"let g:airline = 1 | |
" Tag bar | |
NeoBundle 'majutsushi/tagbar' | |
"if tagbar is loaded enable tagbar etension for airline | |
if (exists(":TagbarToggle")) | |
let g:airline#extensions#tabline#enabled = 1 | |
endif | |
" Nerdtree | |
NeoBundle 'scrooloose/nerdtree' | |
map <silent> <F5> :NERDTreeToggle<CR> | |
" Solarized | |
NeoBundle 'altercation/vim-colors-solarized' | |
" Colour scheme - solarized | |
" set background=dark | |
"colorscheme solarized | |
NeoBundle 'techlivezheng/vim-plugin-minibufexpl' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment