-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
219 lines (162 loc) · 4.31 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
set nocompatible
" Source the vundle config
source ~/.vim/vundle.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => GVIM Specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has('gui_running')
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" GVIM UI
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide toolbar
set guioptions-=T
" Disable window key shortcuts
set winaltkeys=no
if MySys() == "mac"
" Treat Alt/Option as meta in MacVim
set macmeta
endif
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => NeoVim Specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has('nvim')
set timeout
set timeoutlen=0
set ttimeout
set ttimeoutlen=-1
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use bash for shells to avoid delays in zsh starting up
set shell=/bin/bash
set history=1000
" Hide a buffer instead of closing (don't lose unsaved changes!)
set hidden
" Enable filetype plugin
filetype plugin on
" Allow indentation to be filetype dependent
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
" chdir for each open file
set autochdir
" Add BBNDK tags to the tags list
set tags=./tags/;/,$GIT_HOME/tags;/
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM UI
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ZSH-like tab completion in menu
set wildmenu
set wildmode=full
" Only scroll at the border
set so=0
" Ignore case when searching
set ignorecase
" If search contains uppercase, override case-insensitivity
set smartcase
" Highlight next search result
set hlsearch
" Commandbar height
set cmdheight=2
" Show line breaks
set showbreak=→
" Don't show the mode as airline already does this
set noshowmode
" Enable mouse
set mouse=nvr
" Highlight trailing whitespace
match ErrorMsg '\s\+$'
" Have to excape magic chars (except "(,)" and "|"
set magic
" Set backspace config
set whichwrap+=<,>,h,l
" Highlight cursor line and column
set cursorline
set cursorcolumn
" Show relative line numbers
if v:version > 703
set relativenumber
set number
endif
" Show matching braces
set showmatch
" How many tenths of a second to blink
set mat=1
" Folding settings {{{
set nofoldenable
"set foldcolumn=0
"set foldenable
"set foldlevel=0
"set foldmethod=marker
"set foldtext=FoldText()
"" }}}
" No error bells
set noerrorbells
set novisualbell
set t_vb=
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
set t_Co=256
"if !has('gui_running')
" let g:rehash256 = 1
"endif
set background=dark
colorscheme wombat256
set encoding=utf8
set termencoding=utf-8
set ffs=unix,dos,mac
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set backup
set backupdir=~/.vim/backup
set noswapfile
"Persistent undo
try
if MySys() == "windows"
set undodir=%TMP%
else
set undodir=~/.vim/undodir
endif
set undofile
catch
endtry
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4
set tabstop=4
autocmd FileType javascript set shiftwidth=2 tabstop=2
set nolinebreak
" list disables linebreak
set nolist
"set tw=500
set textwidth=0
set wrapmargin=0
set smartindent
set wrap
""""""""""""""""""""""""""""""
" => Statusline
""""""""""""""""""""""""""""""
" Format the statusline
set statusline=%t "tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%y "filetype
" Buf number, help file, modified, read only, preview window flag
set statusline+=[%n%H%M%R%W]%*\
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
set guitablabel=%t
" Source viminit files {{{
runtime! config/*.vim
runtime! config/**/*.vim
" }}}