diff --git a/plugin/settings.vim b/plugin/settings.vim index 3cdef7b..1e6c978 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -1,5 +1,47 @@ +" TODO: Move these settings to vimrc when after switching to vim8 packages scriptencoding 'utf-8' +" Copy indent from current line +set autoindent + +" Make work in a sane way +set backspace=indent,eol,start + +" Insert blank same in front of line according to 'shiftwidth'. +set smarttab + +if !has('nvim') && &ttimeoutlen == -1 + " Time in miliseconds to wait for a key core or mapping + set ttimeout + set ttimeoutlen=100 +endif + +" TODO: These might be irrelevant with vim-airline +" Show 2 line status +set laststatus=2 +" Show the line and colum number of a cursor position +set ruler + +" Enhanced command line completion +set wildmenu +" Command line history +if &history < 1000 + set history=1000 +endif + +" Display as much as possible of the last line +set display+=lastline + +if &listchars ==# 'eol:$' + " TODO: Review this + set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ +endif + +if v:version > 703 || v:version == 703 && has("patch541") + " Delete comment character when joining commented lines + set formatoptions+=j +endif + " Enable visually highlighting listchars set list " Non breaking space: @@ -55,6 +97,7 @@ endif " Keep cursor from buffer edges set scrolloff=8 +set sidescrolloff=5 " Turn backup off set nobackup noswapfile @@ -69,8 +112,7 @@ set fileformats=unix,mac,dos set isfname-=: " Highlight search matches & show search matches while typing -set hlsearch - +set hlsearch incsearch " Set ignore search case unless mixed set ignorecase smartcase @@ -96,7 +138,8 @@ if has('folding') set foldmethod=syntax foldlevel=20 endif -" Automatically write changes to files +" Automatically read/write changes to files +set autoread set autowrite " Don't add 2 spaces after end of sentence @@ -116,6 +159,11 @@ set modeline " Don't redraw during execution macros, registers, commands, etc. set lazyredraw +" Allow color schemes to do bright colors without forcing bold +if &t_Co == 8 && $TERM !~# '^linux\|^Eterm' + set t_Co=16 +endif + " Change cursor dependant on current mode if has('cursorshape') && has('unix') && !has('gui_running') if $TMUX ==# '' && $ITERM_PROFILE !=# '' diff --git a/vimrc b/vimrc index b984436..8c7f0d4 100644 --- a/vimrc +++ b/vimrc @@ -4,6 +4,13 @@ scriptencoding 'utf-8' " Set leader to space let g:mapleader = ' ' +if has('autocmd') + filetype plugin indent on +endif +if has('syntax') && !exists('g:syntax_on') + syntax enable +endif + " Plugins call plug#begin('~/.vim/bundle') @@ -104,8 +111,6 @@ Plug 'tpope/vim-vinegar' Plug 'tpope/vim-abolish' " vim-unimpaired - for pairs of tasks Plug 'tpope/vim-unimpaired' -" vim-sensible - sane default settings -Plug 'tpope/vim-sensible' " vim-speeddating - sane date manipulation Plug 'tpope/vim-speeddating' " vim-endwise - wisely add end{if,function}, fork with cmake support