From 0aa6117ffc38581006a8a41e0e6fc2259a07ea74 Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 9 Aug 2021 23:04:27 +0800 Subject: Move ftplugin to after/ftplugin Make my own settings have the final say on how a filetype should behave, instead of some 3rd party plugins. --- after/ftplugin/qf.vim | 6 ++++++ after/ftplugin/yaml.vim | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 after/ftplugin/qf.vim (limited to 'after') diff --git a/after/ftplugin/qf.vim b/after/ftplugin/qf.vim new file mode 100644 index 0000000..89b4c1f --- /dev/null +++ b/after/ftplugin/qf.vim @@ -0,0 +1,6 @@ +" Set quickfix window height, see also https://github.com/lervag/vimtex/issues/1127 +function! AdjustWindowHeight(minheight, maxheight) + execute max([a:minheight, min([line('$'), a:maxheight])]) . 'wincmd _' +endfunction + +call AdjustWindowHeight(5, 15) diff --git a/after/ftplugin/yaml.vim b/after/ftplugin/yaml.vim index 46e9ccd..a8e3099 100644 --- a/after/ftplugin/yaml.vim +++ b/after/ftplugin/yaml.vim @@ -2,3 +2,8 @@ set tabstop=2 " number of visual spaces per TAB set softtabstop=2 " number of spaces in tab when editing set shiftwidth=2 " number of spaces to use for autoindent set expandtab " expand tab to spaces so that tabs are spaces + +" Turn off syntax highlighting for large YAML files. +if line('$') > 500 + setlocal syntax=OFF +endif -- cgit v1.2.3