From ff40bda110142568d1ad67928882a23bf1ce0a80 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 17 Jun 2018 08:19:41 +0200 Subject: [PATCH] vim/vimrc: move helper functions to the top --- vim/vimrc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index bb55535..8476842 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -16,6 +16,29 @@ " along with this file. If not, see . +" HELPER FUNCTIONS + +if has('eval') +" Check if the given syntax group is available. Thanks to bairui in #vim on +" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea. + function! s:HasSyntaxGroup(group) + try + execute 'silent highlight ' . a:group + " \a = [A-Za-z] + catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found' + return 0 + endtry + return 1 + endfunction + +" Check if the given Vim version and patch is available. + function! s:HasVersionAndPatch(version, patch) + return v:version > a:version + \ || (v:version == a:version && has('patch' . a:patch)) + endfunction +endif + + " EDITOR SETTINGS " Save 'runtimepath' in case it was changed by the system's configuration @@ -127,29 +150,6 @@ if has('autocmd') endif -" HELPER FUNCTIONS - -if has('eval') -" Check if the given syntax group is available. Thanks to bairui in #vim on -" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea. - function! s:HasSyntaxGroup(group) - try - execute 'silent highlight ' . a:group - " \a = [A-Za-z] - catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found' - return 0 - endtry - return 1 - endfunction - -" Check if the given Vim version and patch is available. - function! s:HasVersionAndPatch(version, patch) - return v:version > a:version - \ || (v:version == a:version && has('patch' . a:patch)) - endfunction -endif - - " TERMINAL SETTINGS " Also enable fast terminal mode in GNU screen and tmux, but not for SSH -- 2.45.2