aboutsummaryrefslogtreecommitdiff
path: root/after/ftplugin/vim.vim
blob: cac808f1952d8028da841ce3d7f85c4007e4a31a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" Disable inserting comment leader after hitting o or O
set formatoptions-=o

" Disable inserting comment leader after hitting <Enter> in insert mode
set formatoptions-=r

" Set the folding related options for vim script. Setting folding option in
" modeline is annoying in that the modeline get executed each time the window
" focus is lost (see
" https://github.com/tmux-plugins/vim-tmux-focus-events/issues/14)
set foldmethod=expr foldlevel=0 foldlevelstart=-1
	\ foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText()

" Use :help command for keyword when pressing `K` in vim file,
" see `:h K` and https://stackoverflow.com/q/15867323/6064933
set keywordprg=:help

" Only define following variable if Auto-pairs plugin is used
if &runtimepath =~? 'auto-pairs'
	let b:AutoPairs = AutoPairsDefine({'<' : '>'})

	" Do not use `"` for vim script since `"` is also used for comment
	let b:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", "`":"`", '<':'>'}
endif