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,<,>,[,],~ " TODO: whichwrap=b,h,l,s,<,>,[,],~
" Don't show completeopt preview buffer " Don't show completeopt preview buffer
if has('insert_expand')
set completeopt-=preview set completeopt-=preview
endif
" Set window title to titlestring " Set window title to titlestring
if has('title')
set title set title
endif
" Don't show mode in command line " Don't show mode in command line
set noshowmode set noshowmode
@ -23,10 +27,16 @@ set relativenumber
set scrolloff=8 set scrolloff=8
" Turn backup off " Turn backup off
set nobackup nowritebackup noswapfile set nobackup noswapfile
if has('writebackup')
set nowritebackup
endif
" Wrap to whole words " 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 " Don't add 2 spaces after end of sentence
set nojoinspaces set nojoinspaces
@ -47,13 +57,20 @@ set ignorecase smartcase
set hidden set hidden
" Open new splits on the other side of the axis " 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 " Indicates a fast terminal connection
set ttyfast set ttyfast
" Set syntax as default fold method " Set syntax as default fold method
if has('folding')
set foldmethod=syntax foldlevel=20 set foldmethod=syntax foldlevel=20
endif
" Automatically write changes to files " Automatically write changes to files
set autowrite set autowrite