-
Notifications
You must be signed in to change notification settings - Fork 4
/
vimrc
92 lines (68 loc) · 2.73 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl --silent -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'preservim/nerdtree'
"Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'elzr/vim-json'
Plug 'vim-airline/vim-airline', { 'tag': 'v0.11' }
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'Yggdroot/indentLine'
Plug 'ntpeters/vim-better-whitespace'
Plug 'altercation/vim-colors-solarized'
"Plug 'fatih/vim-go'
Plug 'godlygeek/tabular'
Plug 'mhinz/vim-signify'
Plug 'darfink/vim-plist'
call plug#end()
syntax on
filetype plugin indent on
set number
set autoindent
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
set nostartofline
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" ======================== nerdtree ========================
autocmd vimenter * NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
map <C-n> :NERDTreeToggle<CR>
" Close nerdtree and vim on close file
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
let NERDTreeShowHidden=1
" ======================== vim-airline ========================
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_highlighting_cache = 1
" ==================== vim-airline-themes ======================
let g:airline_theme='powerlineish'
let g:airline_solarized_bg='dark'
" ===================== vim-colors-solorized ===================
if !empty(glob('~/.vim/plugged/vim-colors-solarized/colors/solarized.vim'))
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
endif
" ========================== indentLine =========================
let g:indentLine_char = '│'
let g:indentLine_color_term = 239
" ========================= vim-go =============================
let g:go_version_warning = 0