From c28e93210e2246dd9745c11a8f90946e3b8a844e Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 3 May 2017 23:23:24 +0100 Subject: [PATCH] Check features are available before using them --- plugin/settings.vim | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/plugin/settings.vim b/plugin/settings.vim index 58d071e..252fbe2 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -7,10 +7,14 @@ set mouse=a " TODO: whichwrap=b,h,l,s,<,>,[,],~ " Don't show completeopt preview buffer -set completeopt-=preview +if has('insert_expand') + set completeopt-=preview +endif " Set window title to titlestring -set title +if has('title') + set title +endif " Don't show mode in command line set noshowmode @@ -23,10 +27,16 @@ set relativenumber set scrolloff=8 " Turn backup off -set nobackup nowritebackup noswapfile +set nobackup noswapfile +if has('writebackup') + set nowritebackup +endif " Wrap to whole words -set wrap linebreak nolist +set wrap nolist +if has('linebreak') + set linebreak +endif " Don't add 2 spaces after end of sentence set nojoinspaces @@ -47,13 +57,20 @@ set ignorecase smartcase set hidden " Open new splits on the other side of the axis -set splitbelow splitright +if has('windows') + set splitbelow +endif +if has('vertsplit') + set splitright +endif " Indicates a fast terminal connection set ttyfast " Set syntax as default fold method -set foldmethod=syntax foldlevel=20 +if has('folding') + set foldmethod=syntax foldlevel=20 +endif " Automatically write changes to files set autowrite