Check features are available before using them

This commit is contained in:
Kenneth Benzie 2017-05-03 23:23:24 +01:00
parent df48f1f607
commit c28e93210e

View File

@ -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