From 6428422cbd2c16a64981fd205395661f718c7a59 Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 12 Sep 2019 21:29:00 +0800 Subject: Simplify init.vim and move settings to autoload and after directory --- after/ftplugin/vim.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 after/ftplugin/vim.vim (limited to 'after/ftplugin/vim.vim') diff --git a/after/ftplugin/vim.vim b/after/ftplugin/vim.vim new file mode 100644 index 0000000..c95b6af --- /dev/null +++ b/after/ftplugin/vim.vim @@ -0,0 +1,23 @@ +" Disable inserting comment leader after hitting o or O +set formatoptions-=o + +" Disable inserting comment leader after hitting 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 http://tinyurl.com/yyqyyhnc) +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://bre.is/wC3Ih-26u +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 -- cgit v1.2.3