-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
231 lines (156 loc) · 4.41 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
set nocompatible
set exrc
set secure
set modeline
augroup vimrc
autocmd!
augroup END
source $HOME/.vim/plugins.vim
filetype plugin indent on
syntax on
let s:fzfdir = expand("$ZDOTDIR/.zplug/repos/junegunn/fzf")
if isdirectory(s:fzfdir)
execute "set runtimepath+=" . s:fzfdir
endif
set background=dark
try
colorscheme hybrid
catch
if has("gui_running")
colorscheme desert
endif
endtry
colorscheme default
set viminfo='50,/50,:50,<10,n~/.vim/viminfo
set autoread
set autowriteall
set autochdir
" allow edited buffers to be hidden
set hidden
set splitbelow splitright
set langmenu=en_US.UTF-8
set switchbuf=usetab
set history=50 " cmd history
set cmdheight=1
set sessionoptions-=options
" autocmd vimrc BufWinLeave * silent! mkview
" autocmd vimrc BufWinEnter * silent! loadview
set title
set undolevels=200
set t_Co=256
set noerrorbells visualbell t_vb=
autocmd vimrc GUIEnter * set visualbell t_vb=
set confirm
set shortmess=atI
set clipboard=unnamedplus
set mouse=a
set mousemodel=popup_setpos
set number relativenumber
set showtabline=1
" allow bs all
set backspace=indent,eol,start
set whichwrap+=<,>,h,l,[,]
set cursorline
set encoding=utf-8 nobomb
set fileencoding=utf-8
set fileencodings=utf-8
set tags+=./.tags;/
set completeopt=longest,menuone,noselect
" backup
set backup
set undofile
set backupdir=$HOME/.vim/data/backup
if !isdirectory(&backupdir)
call mkdir(&backupdir, "p")
endif
set undodir=$HOME/.vim/data/undo//
if !isdirectory(&undodir)
call mkdir(&undodir, "p")
endif
set directory=$HOME/.vim/data/swap//
if !isdirectory(&directory)
call mkdir(&directory, "p")
endif
set list
set listchars=tab:>-,trail:-,nbsp:%,extends:>,precedes:<
set expandtab tabstop=4 softtabstop=4 shiftwidth=4 smarttab
set autoindent
" set paste
set pastetoggle=
set wrap
set wrapmargin=5
set linebreak
set showbreak=\ \ \ \ \ >\
set textwidth=120
set formatoptions+=j
set fileformat=unix
set fileformats=unix,dos,mac
set showcmd " Show us the command we're typing
set showmode " mode in status bar
" match bracket
set showmatch
" search:
set nohlsearch "no highlight search
set incsearch " but hi as typing
set ignorecase smartcase
" Speed up macros
set lazyredraw
set showfulltag
set regexpengine=1
" folding
" manual: zf za
set foldmethod=manual
" Try to show at least three lines and two columns of context when
" scrolling
set scrolloff=3 sidescrolloff=2
" none of these should be word dividers, so make them not be
set iskeyword+=_,$,@,%,#
" ruler
set ruler
" vertical rulers:
set colorcolumn=+1,80
set laststatus=2
set statusline=%{HiStatusLine(mode())} " empty str, triggers highlighting
set statusline+=\%#error#%{exists('*SyntasticStatuslineFlag')?SyntasticStatuslineFlag():''}%*
set statusline+=\ (%{mode()})
set statusline+=\ [%{$USER}]
set statusline+=\ b:%n "buffer number
set statusline+=\ [ "start group
set statusline+=%{&fenc==\"\"?&enc:&fenc} " encoding
set statusline+=%{(exists(\"+bomb\")\ &&\ &bomb)?\"+B\":\"\"} "BOM
set statusline+=/%{&ff}/%y "fileformat/filetype
set statusline+=] "end group
set statusline+=\ %m "modifier flag
set statusline+=\ %r "readonly?
set statusline+=\ %{exists('*fugitive#statusline')?fugitive#statusline():''}
" set statusline+=\ [%t] "tail
set statusline+=\ %{exists('*tagbar#currenttag')?tagbar#currenttag('[tag:%s]',''):''}
set statusline+=%= " right align reminder
set statusline+=\ L:%l/%L(%p) "lines nu, percentage, total
set statusline+=\ col:%c "column nu
set statusline+=\ ch:0x%04B "char under cursor (hex)
set statusline+=\ bytes:%O "bytes
set statusline+=\ [%{strftime('%H:%M\ %a\ %d\ %b')}]
set statusline+=%<
" command line completion
set wildmenu
set wildmode=full
set shell=/usr/bin/env\ bash " --login
" Redefine the shell redirection operator to receive both the stderr messages
" and stdout messages
set shellredir=>%s\ 2>&1
augroup vimrc
autocmd FileType php setlocal makeprg=/usr/bin/env\ php\ %
autocmd FileType python setlocal makeprg=/usr/bin/env\ python3\ %
autocmd FileType javascript setlocal makeprg=/usr/bin/env\ node\ %
autocmd FileType sh setlocal makeprg=/usr/bin/env\ bash\ %
augroup END
autocmd vimrc FileType vim setlocal keywordprg=:help
augroup vimrc
autocmd FileType python setlocal completeopt+=preview
autocmd FileType javascript setlocal completeopt+=preview
augroup END
iabbrev @@ andrew.kamenchuk@gmail.com
if filereadable(expand("$HOME/.vimrc.local"))
source $HOME/.vimrc.local
endif