-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvimrc
213 lines (170 loc) · 5.3 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
"""""""""""""""""""""
" OS: Mac OS "
" GUI: MacVim "
" Terminal: iTerm2 "
"""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins
""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
filetype off
call plug#begin('~/.vim/plugged')
Plug 'embear/vim-localvimrc'
" File finder
Plug 'dyng/ctrlsf.vim', { 'do': 'brew install the_silver_searcher' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'scrooloose/nerdtree'
Plug 'airblade/vim-rooter'
" Text, easier navigation and editing
Plug 'ciaranm/detectindent'
Plug 'Lokaltog/vim-easymotion'
Plug 'jiangmiao/auto-pairs'
Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-surround'
Plug 'baopham/vim-nerdtree-unfocus'
Plug 'baopham/trailertrash.vim'
Plug 'tpope/vim-repeat'
Plug 'xsunsmile/showmarks'
" Improve search
Plug 'osyo-manga/vim-anzu'
" CVS
Plug 'tpope/vim-fugitive' | Plug 'gregsexton/gitv', {'on': ['Gitv']}
Plug 'mattn/webapi-vim' | Plug 'mattn/gist-vim'
" Tags & coding related
Plug 'python-mode/python-mode', { 'for': ['python'] }
Plug 'majutsushi/tagbar'
Plug 'tomtom/tcomment_vim'
Plug 'editorconfig/editorconfig-vim', { 'do': 'brew install editorconfig' }
Plug 'neomake/neomake' | Plug 'jaawerth/neomake-local-eslint-first'
" {{{ Autocomplete
Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --all' }
" }}}
Plug 'moll/vim-node'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Syntax highlighting & templating
Plug 'mattn/sonictemplate-vim'
Plug 'sheerun/vim-polyglot'
Plug 'flowtype/vim-flow', { 'for': ['javascript', 'javascript.jsx'] }
" Appearance
Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes'
Plug 'joshdick/onedark.vim'
" Others
Plug 'gmarik/sudo-gui.vim'
Plug 'thinca/vim-quickrun'
Plug 'vim-scripts/YankRing.vim'
Plug 'mbbill/undotree'
Plug 'szw/vim-maximizer'
call plug#end()
filetype plugin indent on
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Important settings
""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
set laststatus=2
set encoding=utf-8
" Set vim for 256 color schemes
set t_Co=256
if has('mouse')
set mouse=a
if !has('gui_running')
set ttymouse=xterm2
endif
endif
if exists('+autochdir')
set autochdir
else
autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
endif
" Disable bell
set visualbell
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colorscheme
""""""""""""""""""""""""""""""""""""""""""""""""""""
colo onedark
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => GUI MacVim
""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("gui_running")
set gfn=Monaco\ for\ Powerline:h12
set guioptions-=T
set guioptions-=L
set guioptions-=r
set showtabline=2 "always show tabs
set macmeta
let g:tagbar_iconchars = ['▸', '▾']
map <SwipeLeft> gT
map <SwipeRight> gt
imap <SwipeLeft> <Esc>gT<CR>
imap <SwipeRight> <Esc>gt<CR>
" Turn on/off transparency
map <Leader>trn :set transparency=8<CR>
map <Leader>trf :set transparency=0<CR>
" Show tab number
autocmd VimEnter * set guitablabel=%M\ %t\ \⌘%N
" Enable horizontal scrolling
" set guioptions+=h
" set nowrap
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Miscellaneous
""""""""""""""""""""""""""""""""""""""""""""""""""""
set noshowmode
set binary
if !has("gui_running")
set ttimeout
set ttimeoutlen=100
endif
" +c: Apply 'textwidth' to comments.
" +r: Continue comments after hitting <Enter> in Insert mode.
" +o: Continue comments after when using 'O' or 'o' to open a new line.
" +q: Format comments using q<motion>.
" +l: Do not break a comment line if it is long before you start.
set formatoptions+=croql
" This makes vim act like all other editors, buffers can
" exist in the background without being in a window.
" http://items.sjbach.com/319/configuring-vim-right
set hidden
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
set wildmode=longest,full
set hlsearch
set ignorecase "ignore case when searching
set smartcase
set magic "set magic on, for regular expressions
set ruler
set number
set undolevels=1000
set splitbelow "split windows at bottom
set scrolloff=8 "start scrolling when we're 8 lines away from margins
set sidescrolloff=15
set sidescroll=1
set listchars=eol:\ ,tab:\|\ ,trail:·,extends:>,precedes:<
set list
" Different background color for characters going past the 121 limit
" Credit: http://stackoverflow.com/a/13731714/949806
let &colorcolumn=join(range(121,999),",")
" Display help in vertical split window
command -nargs=* -complete=help Help vertical belowright help <args>
" Resize splits when window is resized
au VimResized * exe "normal! \<c-w>="
highlight MatchParen cterm=bold ctermfg=cyan
" Command to change to directory of the current file
command CDC cd %:p:h
" Swap, backup, undo {{{
set nobackup
set noswapfile
set nowb
if exists('+undofile')
set undofile
" Try `mkdir -p ~/.cache/vim/undo` if the directory doesn't already exist
if isdirectory(expand('~/.cache/vim/undo')) && &undodir =~# '^\.\%(,\|$\)'
set undodir^=~/.cache/vim/undo//
endif
endif
" }}}
""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Settings
""""""""""""""""""""""""""""""""""""""""""""""""""""
for fpath in split(globpath('~/.vim/settings', '*.vim'), '\n')
exe 'source' fpath
endfor