-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
124 lines (109 loc) · 3.12 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
"Note for MACOSX: brew install vim --with-python3 --with-lua --with-override-system-vi
"===== Basic configuration ====="
set nocompatible
set incsearch
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set number
set list
set laststatus=2
set cursorcolumn
set cursorline
set nowrap
set noswapfile
set backspace=indent,eol,start
"===== Colors and theme ====="
set t_Co=256
let g:molokai_original = 1
colorscheme molokai
"===== Plugins ====="
" Filetype off is required by vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Let Vundle manage Vundle (required)
Plugin 'gmarik/Vundle.vim'
" Vundle plugins
Plugin 'itchyny/lightline.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Shutnik/jshint2.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'elzr/vim-json'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'Shougo/neocomplete'
Plugin 'Townk/vim-autoclose'
Plugin 'alvan/vim-closetag'
Plugin 'vim-syntastic/syntastic'
call vundle#end()
filetype plugin indent on
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
"===== Lightline status bar configuration ====="
let g:lightline = {
\ "component": {
\ "readonly": '%{&readonly?"⭤":""}',
\ },
\ "active": {
\ "left": [ [ "mode", "paste" ], [ "fugitive", "filename" ], [ "syntastic" ] ]
\ },
\"component_function": {
\ "fugitive": "MyFugitive",
\ },
\ "component_expand": {
\ "syntastic": "SyntasticStatuslineFlag",
\ },
\ "component_type": {
\ "syntastic": "error",
\ },
\ "separator": { "left": "\ue0b0", "right": "\ue0b2" },
\ "subseparator": { "left": "\ue0b1", "right": "\ue0b3" }
\ }
function! MyFugitive()
try
if expand("%:t") !~? "Tagbar\|Gundo\|NERD" && &ft !~? "vimfiler" && exists("*fugitive#head")
let mark = "" " edit here for cool mark
let _ = fugitive#head()
return strlen(_) ? "\ue0a0 " . _ : "\ue0a0 no-branch"
endif
catch
endtry
return ""
endfunction
augroup AutoSyntastic
autocmd!
autocmd BufWritePost *.c,*.cpp call s:syntastic()
augroup END
function! s:syntastic()
SyntasticCheck
call lightline#update()
endfunction
"===== Syntax ====="
syntax on
au BufNewFile,BufRead *.scss,*.sass set syntax=css
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/syntax/yaml.vim
"JSX configuration
let g:jsx_ext_required = 0
"Closetag configuration
let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.hbs"
"Autocomplete configuration
let g:neocomplete#enable_at_startup = 1
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
"Syntastic configuration
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_loc_list_height = 2
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_java_javac_autoload_maven_classpath = 0