-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
643 lines (534 loc) · 19.8 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
" Preamble {{{
" vim: set foldlevel=0:
" .vimrc
" Author: Mark Tozzi
" Source: https://github.com/not-napoleon/vim-configuration/blob/master/vimrc
"
" In addition to the plugins listed below, parts of this file have been lifted
" from various coworkers, friends and internet sources over the years. A
" partial list follows:
"
" [1] https://github.com/DanielleSucher/dotfiles/blob/master/vim/vimrc
" [2] https://github.com/jonafato/dotfiles/blob/master/vimrc
" [3] https://github.com/johnbenjaminlewis/dotfiles/blob/master/.vimrc
" [4] https://bitbucket.org/sjl/dotfiles/src/tip/vim/vimrc
" [5] http://stackoverflow.com/a/1270689
" [6] http://vim.wikia.com/wiki/List_loaded_scripts
" [7] https://stackoverflow.com/a/9527384/529459
"
" To the best of my knowledge, all sources are used with permission.
"
" Original parts of this file are free to use under the MIT license
" (https://opensource.org/licenses/MIT)
"
" Notes and Information {{{1
" Missing documentation, installation notes, and other stuff I need to find
" but don't have a good place for belongs here.
"
" text-object-left-and-right {{{2
" There's no help file, so here's a dump of the readme:
" This is a mirror of http://www.vim.org/scripts/script.php?script_id=3511
"
" This simple script create text object for left and right of a statement. e.g
"
" stri|ng = "Hello World"
"
"
" | is where your cursor is, in command mode
" type ciL (change inner and L for the right hand sided)
"
" the line will become
"
" string = |
"
" similarily
"
" ciH, diH, yiH etc will change, delete, yank the left hand side of the
" statement
"
" this also works for ==, => as well
"
" Note if the line end with ',' or ';' it will be the boundary of the right
" hand side If there is a space before the separator (=, ==, =>) or after,
" they are so the the boundary
"
" Plugins {{{1
call plug#begin('~/.vim/plugged')
" Movements, gestures and commands {{{2
Plug 'AndrewRadev/sideways.vim' " Move items around in lists
Plug 'easymotion/vim-easymotion' " Fast in document movement
Plug 'gregsexton/MatchTag' " Tag pairing? I guess?
Plug 'michaeljsmith/vim-indent-object' " Indent level text objects
Plug 'tmhedberg/matchit'
Plug 'tomtom/tcomment_vim' " Block commenting
Plug 'tpope/vim-speeddating' " Increment/decrement dates
Plug 'tpope/vim-surround' " Handle paired markers
Plug 'tpope/vim-unimpaired' " Paired short-cuts with braces
Plug 'vim-scripts/text-object-left-and-right' " Text objects for LHS/RHS of expressions
" Filetype Support {{{2
Plug 'cespare/vim-toml'
Plug 'dag/vim-fish', {'for': 'fish'}
Plug 'derekwyatt/vim-scala', {'for': 'scala'}
Plug 'elzr/vim-json', {'for': 'json'}
Plug 'klen/python-mode', {'for': 'python'}
Plug 'lepture/vim-jinja', {'for': 'jinja'}
Plug 'rhysd/vim-clang-format', {'for': ['c', 'cpp']}
Plug 'rust-lang/rust.vim'
Plug 'vim-scripts/applescript.vim', {'for': 'applescript'}
Plug 'rdolgushin/groovy.vim', {'for': 'groovy'}
Plug 'vim-scripts/groovyindent-unix', {'for': 'groovy'}
" Interface Mods {{{2
Plug 'bling/vim-airline' " Improved status line
Plug 'embear/vim-foldsearch'
Plug 'godlygeek/tabular' " Align text as needed
Plug 'haya14busa/incsearch.vim' " Better incremental search
Plug 'lfv89/vim-interestingwords' " Arbitrary highlights
Plug 'majutsushi/tagbar' " Navigate by tagfile
Plug 'mbbill/undotree' " Visualize vim's undo tree
Plug 'ntpeters/vim-better-whitespace' " Trailing Whitespace highlite & trim
Plug 'scrooloose/syntastic' " Flag syntax errors
Plug 'whatyouhide/vim-lengthmatters' " Highlite overly long lines
Plug 'diepm/vim-rest-console' " Use vim as elasticsearch client
" Colorschemes {{{2
Plug 'altercation/vim-colors-solarized' " Solarized color scheme
Plug 'blueshirts/darcula'
Plug 'freeo/vim-kalisi'
Plug 'jscappini/material.vim'
Plug 'michalbachowski/vim-wombat256mod'
Plug 'romainl/Apprentice'
Plug 'vim-scripts/Perfect-Dark'
Plug 'vim-scripts/moria'
Plug 'xero/blaquemagick.vim'
Plug 'xero/sourcerer.vim'
Plug 'TroyFletcher/vim-colors-synthwave/'
" External Systems {{{2
Plug 'jistr/vim-nerdtree-tabs'
Plug 'kien/ctrlp.vim' " Fuzzy match file opener
Plug 'mattn/gist-vim' | Plug 'mattn/webapi-vim' " Post gists direct from vim! amazing!
Plug 'mhinz/vim-startify' " Fancy start screen
Plug 'scrooloose/nerdtree' " Filesystem broswer
Plug 'tpope/vim-fugitive' " Git integration
Plug 'tpope/vim-rhubarb' " Github extention for fugitive
" Wiki Tools {{{2
Plug 'mmai/wikilink'
" Completion {{{2
Plug 'SirVer/ultisnips' " Snippets and such
Plug 'honza/vim-snippets' " Actual snippets
Plug 'not-napoleon/vim-byline' " Sign your work
Plug 'tpope/vim-abolish' " Better abbreviations
" Meta {{{2
Plug 'embear/vim-localvimrc' " Support for project specific vim settings
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-repeat' " Enable dot repeat for plugins
" Other {{{2
Plug 'airblade/vim-rooter' " Automatically change to root directory
" In Development {{{2
call plug#end()
" Config Settings {{{1
if !has("nvim")
set ttyfast " Send more characters for redraws
set ttymouse=xterm2
" else
" " TODO check if the virtual envs exist, and if not create them
" let g:python_host_prog=$HOME . "/.virtualenvs/neovim/bin/python2"
" let g:python3_host_prog=$HOME . "/.virtualenvs/neovim-python3/bin/python3"
endif
" Start with all folds open and default to a sane fold method. Filetypes
" should override the fold method.
set foldmethod=indent
set foldlevel=99
set showcmd " Show what's been typed so far in command pending mode
" Good default tab settings. Projects can use localvimrc to override this for
" their native conventions, if they differ.
set softtabstop=4
set shiftwidth=4
set expandtab
set number " Line Numbers!
set fileformats="unix" " Show those ^M's when editing a windows file
" Live dangerously
set nobackup
set nowritebackup
" Put swap files all in one place, so I don't need to git-ignore them globally
" or in every project.
" The // causes vim to use the full path name for the swap file, to avoid
" name collisions.
"
" Auto directory creation from [4] above
set undodir=$HOME/.vim/tmp/undo// " undo files
set backupdir=$HOME/.vim/tmp/backup// " backups
set directory=$HOME/.vim/tmp/swap// " swap files
" Make those folders automatically if they don't already exist.
if !isdirectory(expand(&undodir))
call mkdir(expand(&undodir), "p")
endif
if !isdirectory(expand(&backupdir))
call mkdir(expand(&backupdir), "p")
endif
if !isdirectory(expand(&directory))
call mkdir(expand(&directory), "p")
endif
" See also the incsearch plugin settings
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
" show the `best match so far' as search strings are typed:
set incsearch
set backspace=indent,eol,start " Make backspace not suck
set mouse=a " Enable mouse use in all modes
filetype plugin indent on
syntax enable
" Space bar toggles folds. This is life changing. [3]
nnoremap <Space> za
vnoremap <Space> za
" Make zO recursively open whatever top level fold we're in, no matter where
" the cursor happens to be.
nnoremap zO zCzO
" Use jk to exit insert mode
inoremap jk <esc>
inoremap kj <esc>
" equalize windows when vim is resized [4]
autocmd VimResized * exe "normal! \<c-w>="
set t_Co=256
colorscheme synthwave
set background=dark
" Format options:
" Wrap lines to textwidth in comments while typing, by default. Non-code file
" types should override this. Given this, code file types should set
" textwidth to the comment width and g:lengthmatters_start_at_column for
" highlighting too long lines (and plugin config should unset
" g:lengthmatters_use_textwidth)
set formatoptions=croq
" Show whitespace characters with neat unicode [4]
set list
set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮
set nowrap
" nolist is necessary because list breaks linebreak, because of course it
" does. See http://vimcasts.org/episodes/soft-wrapping-text/
command! -nargs=* Wrap set wrap linebreak nolist
set showbreak=…
" Upper case current word. This is inspired by a mapping by Steve Losh,
" adapted slightly to how I like to work [4]
inoremap <c-u> <esc>gUiwea
nnoremap <c-u> gUiwe
" Plugin Configuration {{{1
" Airline config {{{2
" Status line settings
let g:airline_powerline_fonts = 1
set laststatus=2 " Always show status line
set noshowmode " Rely on airline's modified status marker
let g:airline_theme = 'dark'
let g:airline#extensions#syntastic#enabled = 0
let g:airline#extensions#virtualenv#enabled = 0
" Shorten mode names
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
" let g:airline_section_a " (mode, paste, iminsert)
" let g:airline_section_b " (hunks, branch)
" let g:airline_section_c' " (bufferline or filename)
" let g:airline_section_gutter " (readonly, csv)
let g:airline_section_x = 'fo:%{&formatoptions}' " (tagbar, filetype, virtualenv)
"let g:airline_section_y " (fileencoding, fileformat)
let g:airline_section_z = 'c:%c %p%%' " (percentage, line number, column number)
" let g:airline_section_warning " (syntastic, whitespace)
" Byline {{{2
let g:bylineName='Tozzi'
iab MT <C-R>=BylineInsert()<cr>
" Clang Fomatter {{{2
" Enable clang format with gq command
let g:clang_format#auto_formatexpr = 1
" Read project style files
let g:clang_format#detect_style_file = 1
" CtrlP {{{2
let g:ctrlp_reuse_window='startify' " Let ctrlp reuse the startify window
"Easy Motion {{{2
" Replace f, F, t, T with their easy motion variants for normal and visual
nmap f <Plug>(easymotion-fl)
xmap f <Plug>(easymotion-fl)
nmap F <Plug>(easymotion-Fl)
xmap F <Plug>(easymotion-Fl)
nmap t <Plug>(easymotion-tl)
xmap t <Plug>(easymotion-tl)
nmap T <Plug>(easymotion-Tl)
xmap T <Plug>(easymotion-Tl)
" Fugitive {{{2
" Not fugitive specific, but this is the only place I care about diffopt,
" really
set diffopt=filler,vertical,context:10
" Gist {{{2
" Mac clipboard. TODO: Detect OS and set based on that
let g:gist_clip_command = 'pbcopy'
let g:gist_detect_filetype = 1
let g:gist_show_privates=1
let g:gist_post_private = 1 " Default to private gists, because I'm paranoid
" Incsearch {{{2
nmap / <Plug>(incsearch-forward)
xmap / <Plug>(incsearch-forward)
nmap ? <Plug>(incsearch-backward)
xmap ? <Plug>(incsearch-backward)
nmap g/ <Plug>(incsearch-stay)
xmap g/ <Plug>(incsearch-stay)
" Clear highlighting after finishing search
set hlsearch
let g:incsearch#auto_nohlsearch = 1
nmap n <Plug>(incsearch-nohl-n)
xmap n <Plug>(incsearch-nohl-n)
nmap N <Plug>(incsearch-nohl-N)
xmap N <Plug>(incsearch-nohl-N)
nmap * <Plug>(incsearch-nohl-*)
xmap * <Plug>(incsearch-nohl-*)
nmap # <Plug>(incsearch-nohl-#)
xmap # <Plug>(incsearch-nohl-#)
nmap g* <Plug>(incsearch-nohl-g*)
xmap g* <Plug>(incsearch-nohl-g*)
nmap g# <Plug>(incsearch-nohl-g#)
xmap g# <Plug>(incsearch-nohl-g#)
" lengthmatters {{{2
let g:lengthmatters_use_textwidth=0
let g:lengthmatters_start_at_column=140 " good default
" localvimrc {{{2
let g:localvimrc_name = ['.vimrc', '.lvimrc']
let g:localvimrc_event = ['VimEnter']
" Don't load in sandbox mode - risky, so we'll ask before loading
let g:localvimrc_sandbox = 0
let g:localvimrc_ask = 1
let g:localvimrc_persistent = 1
let g:localvimrc_blacklist = $HOME . '/.vim/vimrc'
" Nerd Tree {{{2
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeRespectWildIgnore=1 " Use wildignore for nerdtree
let g:NERDTreeShowHidden=1 " Show hidden files
set wildignore+=*.pyc,*/*.egg-info/* " Python incidentals
set wildignore+=.git,.hg " Source control
set wildignore+=*.sw? " Swap files
set wildignore+=*.jpg,*.jpeg,*.gif,*.png " Images
set wildignore+=*.o " Object files
set wildignore+=*.class " Java class files
" Python Mode {{{2
" Override go-to.definition key shortcut to Ctrl-]
let g:pymode_rope_goto_definition_bind = "<C-]>"
let g:pylint_show_rate = 0
let g:pymode_indent = 0
let g:pymode_folding = 1
let g:pymode_motion = 1
let g:pymode_indent = 1
" I like the syntastic plugin's presentation of errors better
let g:pymode_lint = 0
let g:pymode_lint_on_write = 0
" I'm using YCM for completion
let g:pymode_rope_completion = 0
" let g:pymode_lint_onfly = 1
" let g:pymode_lint_cwindow = 0
" Startify {{{2
let g:startify_change_to_dir=0 " Don't change to the directory of the file being opened
let g:startify_change_to_vcs_root=1 " Always start from the root of the repository (if applicable)
let g:startify_list_order=[
\ [' Recent Sessions'], 'sessions',
\ [' Most recently used in dir'], 'dir',
\ [' Bookmarks'], 'bookmarks'
\ ]
let g:startify_bookmarks=['~/.vim/vimrc']
let g:startify_session_persistence = 1
let g:startify_session_dir = '~/.vim/tmp/session'
" Trigger NERDtree to reuse the startify window (works for Ctrl-P too)
autocmd User Startified setlocal buftype=
" Syntastic config {{{2
" Syntastic checker plugins
let g:syntastic_aggregate_errors = 1
" Note to self: make sure pylint is running in the venv, not the system pylint
" Also, there's a pylint plugin to play nicely with django, put this in a
" local vimrc to use it:
" let g:syntastic_python_pylint_args = '--load-plugins pylint_django'
let g:syntastic_python_checkers=['flake8', 'pylint']
let g:syntastic_json_checkers=['jsonlint']
"
" Disable syntastic java checking in favor of YCM
let g:syntastic_java_checkers = []
" Always populate error list
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Sideways macro & text object {{{2
nnoremap <c-h> :SidewaysLeft<cr>
nnoremap <c-l> :SidewaysRight<cr>
omap aa <Plug>SidewaysArgumentTextobjA
xmap aa <Plug>SidewaysArgumentTextobjA
omap ia <Plug>SidewaysArgumentTextobjI
xmap ia <Plug>SidewaysArgumentTextobjI
" Ultisnips config {{{2
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
let g:ultisnips_python_style="sphinx"
" Better Whitespace {{{2
" Automatically strip trailing whitespace on save for all filetypes.
" DISABLED FOR NOW TO NOT CLUTTER PRs
" augroup plugin_better_whitespace
" autocmd BufWritePre * StripWhitespace
" augroup END
" let g:better_whitespace_filetypes_blacklist+=[]
" default blacklist: ['diff', 'gitcommit', 'unite', 'qf', 'help']
" Vim Rest Console {{{2
let g:vrc_elasticsearch_support = 1
let g:vrc_allow_get_request_body = 1
let g:vrc_response_default_content_type = 'application/json'
" Utility Functions {{{1
" reselect text just pasted with gp [1]
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" highlight duplicate lines from [5]. Useful for spotting refactoring
" candidates.
function! HighlightRepeats() range
let lineCounts = {}
let lineNum = a:firstline
while lineNum <= a:lastline
let lineText = getline(lineNum)
if lineText != ""
let lineCounts[lineText] = (has_key(lineCounts, lineText) ? lineCounts[lineText] : 0) + 1
endif
let lineNum = lineNum + 1
endwhile
exe 'syn clear Repeat'
for lineText in keys(lineCounts)
if lineCounts[lineText] >= 2
exe 'syn match Repeat "^' . escape(lineText, '".\^$*[]') . '$"'
endif
endfor
endfunction
command! -range=% HighlightRepeats <line1>,<line2>call HighlightRepeats()
" Get currently loaded scripts in a buffer, via [6]
" Execute 'cmd' while redirecting output.
" Delete all lines that do not match regex 'filter' (if not empty).
" Delete any blank lines.
" Delete '<whitespace><number>:<whitespace>' from start of each line.
" Display result in a scratch buffer.
function! s:Filter_lines(cmd, filter)
let save_more = &more
set nomore
redir => lines
silent execute a:cmd
redir END
let &more = save_more
new
setlocal buftype=nofile bufhidden=hide noswapfile
put =lines
g/^\s*$/d
%s/^\s*\d\+:\s*//e
if !empty(a:filter)
execute 'v/' . a:filter . '/d'
endif
0
endfunction
command! -nargs=? Scriptnames call s:Filter_lines('scriptnames', <q-args>)
" TODO: this should be in vimwiki or markdown filetype plugin or something
" Custom folding expresion for anything using the = Header = format
" e.g. vimwiki. See
" http://vimcasts.org/episodes/writing-a-custom-fold-expression/ and
" https://gist.github.com/anonymous/4149842
function! EqualHeaderFolding()
let thisline = getline(v:lnum)
" There must be a better way to do this...
if match(thisline, "^======") >= 0
return ">6"
elseif match(thisline, "^=====") >= 0
return ">5"
elseif match(thisline, "^====") >= 0
return ">4"
elseif match(thisline, "^===") >= 0
return ">3"
elseif match(thisline, "^==") >= 0
return ">2"
elseif match(thisline, "^=") >= 0
return ">1"
else
return "="
endif
endfunction
" Timestamp to Date tools
command EpochToDate s/\(\d\{10\}\)\(\d\{3\}\)\?/\=strftime("%Y-%m-%d", str2nr(submatch(1)))/
command EpochToDatetime s/\(\d\{10\}\)\(\d\{3\}\)\?/\=strftime("%Y-%m-%d %H:%M:%S", str2nr(submatch(1)))/
" Filetype Specific Stuff {{{1
" Perl {{{2
augroup filetype_perl
autocmd!
autocmd FileType perl set smartindent
augroup END
let perl_extended_vars=1 " Highlite advanced perl vars inside strings (hash refs)
" Python {{{2
let python_highlight_all=1
let g:pyflakes_use_quickfix = 0
" Ruby {{{2
" For some reason, vim is unusably slow on ruby files
augroup filetype_ruby
autocmd!
autocmd FileType ruby setlocal regexpengine=1 nocursorline nocursorcolumn
augroup END
" Java {{{2
augroup filetype_java
autocmd!
autocmd FileType java setlocal foldmethod=syntax
autocmd FileType java setlocal textwidth=90
autocmd FileType java let g:lengthmatters_start_at_column=140
augroup END
" C# and Mono {{{2
augroup filetype_cs
autocmd!
autocmd FileType cs setlocal noexpandtab
augroup END
" Restructured text {{{2
augroup filetype_rst
autocmd!
autocmd FileType rst setlocal textwidth=78 spell spelllang=en_us
augroup END
" Markdown {{{2
augroup filetype_markdown
autocmd!
autocmd FileType markdown setlocal textwidth=78 spell spelllang=en_us
augroup END
" Tex/LaTeX files {{{2
augroup filetype_latex
autocmd!
autocmd FileType tex setlocal spell spelllang=en_us
augroup END
" Vimwiki {{{2
augroup filetype_vimwiki
autocmd!
autocmd FileType vimwiki setlocal spell spelllang=en_us foldmethod=expr foldexpr=EqualHeaderFolding()
augroup END
" Git commits {{{2
augroup filetype_gitcommit
autocmd!
autocmd FileType gitcommit setlocal spell spelllang=en_us
augroup END
" Applescript {{{2
augroup filetype_applescript
autocmd!
au BufRead,BufNewFile *.applescript set filetype=applescript
augroup END
" Vimscript {{{2
augroup filetype_vimscript
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" Avro Schema Files {{{2
" Avro uses json, so just force these to json filetype
augroup filetype_avro
autocmd!
autocmd BufNewFile,BufRead *.avsc set filetype=json
augroup END
" Asciidoc {{{2
augroup filetype_asciidoc
autocmd!
autocmd FileType asciidoc setlocal spell spelllang=en_us
autocmd FileType asciidoc setlocal fo+=t textwidth=79
augroup END