-
Notifications
You must be signed in to change notification settings - Fork 0
/
autocommands.vim
65 lines (55 loc) · 2.52 KB
/
autocommands.vim
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
" Autocommands
if has("autocmd")
" Autosource files on saving
"autocmd bufwritepost .vimrc source $MYVIMRC
autocmd bufwritepost abolish.vim source ~/.vim/after/plugin/abolish.vim
autocmd bufwritepost autocommands.vim source ~/.vim/autocommands.vim
autocmd bufwritepost cmakerc.vim source ~/.vim/cmakerc.vim
autocmd bufwritepost cocrc.vim source ~/.vim/cocrc.vim
autocmd bufwritepost commands.vim source ~/.vim/commands.vim
autocmd bufwritepost ctags.vim source ~/.vim/ctags.vim
autocmd bufwritepost fernrc.vim source ~/.vim/fernrc.vim
autocmd bufwritepost folds.vim source ~/.vim/folds.vim
autocmd bufwritepost fugitiverc.vim source ~/.vim/fugitiverc.vim
autocmd bufwritepost kitty.vim source ~/.vim/kitty.vim
autocmd bufwritepost lsp.vim source ~/.vim/lsp.vim
autocmd bufwritepost miscellaneous.vim source ~/.vim/miscellaneous.vim
autocmd bufwritepost pluginlist.vim source ~/.vim/pluginlist.vim
autocmd bufwritepost remaps.vim source ~/.vim/remaps.vim
autocmd bufwritepost themeconfig.vim source ~/.vim/themeconfig.vim
autocmd bufwritepost ultisnipsrc.vim source ~/.vim/ultisnipsrc.vim
autocmd bufwritepost urlhandler.vim source ~/.vim/urlhandler.vim
autocmd bufwritepost vimspectorrc.vim source ~/.vim/vimspectorrc.vim
autocmd bufwritepost vimtexrc.vim source ~/.vim/vimtexrc.vim
autocmd bufwritepost ycmrc.vim source ~/.vim/ycmrc.vim
" Autoformatting
" autocmd bufwritepost *.ts :Prettier <CR>
"autocmd bufwritepost *.py :Black <CR>
" autocmd BufWritePost *.py call CocAction('format')
" Manually load syntax highlighting for some file extensions
"
au BufReadPost *.patch setlocal ft=diff
au BufReadPost *.conf setlocal ft=conf
au BufReadPost *.its setlocal syntax=dts
au BufReadPost *.scr setlocal syntax=bash
au BufReadPost *_defconfig setlocal syntax=config
au BufReadPost *.h setlocal filetype=c
"au BufReadPost * :ColorHighlight<CR>
" Run retab on saving files
"autocmd bufwritepost *.c,*.cpp retab
" Activate Prettier plugin for various file extensions
"let g:prettier#autoformat = 0
" autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
endif
" Stop highlighting after search has finished
augroup vimrc-incsearch-highlight
autocmd!
autocmd CmdlineEnter /,\? :set hlsearch
autocmd CmdlineLeave /,\? :set nohlsearch
augroup END
" autocmd FileType c ClangFormatAutoEnable
" autocmd FileType h ClangFormatAutoEnable
" autocmd FileType cpp ClangFormatAutoEnable
" autocmd FileType hpp ClangFormatAutoEnable
" JSON settings
au FileType json set filetype=jsonc