From e0ee2e3259531d4e5bdb5c2a376ce2ae0501adfe Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 20 Dec 2020 17:53:29 -0800 Subject: [PATCH] Merge vim sensible from tpope with previous settings --- vim/.config/vim/plugin/settings.vim | 116 +++++++++++++++++++++------- vim/.config/vim/plugin/theme.vim | 2 + vim/.config/vim/vimrc | 4 + 3 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 vim/.config/vim/plugin/theme.vim diff --git a/vim/.config/vim/plugin/settings.vim b/vim/.config/vim/plugin/settings.vim index 912ae21..cadfa04 100644 --- a/vim/.config/vim/plugin/settings.vim +++ b/vim/.config/vim/plugin/settings.vim @@ -1,31 +1,104 @@ -syntax on -filetype plugin on -filetype indent on +if has('syntax') && !exists('g:syntax_on') + syntax enable +endif -"colorscheme PaperColor -"colorscheme solarized -colorscheme wombat +if has('autocmd') + filetype plugin on + filetype indent on +endif + +set autoindent +set backspace=indent,eol,start +set complete-=i +set smarttab + +set nrformats-=octal + +if !has('nvim') && &ttimeoutlen == -1 + set ttimeout + set ttimeoutlen=100 +endif + +set incsearch +" Use to clear the highlighting of :set hlsearch. +if maparg('', 'n') ==# '' + nnoremap :nohlsearch=has('diff')?'diffupdate':'' +endif + +set laststatus=2 +set ruler +set wildmenu + +" Status +" ~/file [type] [line,column] [number of lines] +set statusline=%F%m%r%h%w\ [%Y]\ [%03l,%03v]\ [%L] + +if !&scrolloff + set scrolloff=1 +endif +if !&sidescrolloff + set sidescrolloff=5 +endif +set display+=lastline + +if &encoding ==# 'latin1' && has('gui_running') + set encoding=utf-8 +endif + +if &listchars ==# 'eol:$' + set listchars=tab:\ \ ,trail:…,extends:>,precedes:<,nbsp:+ +endif + +if v:version > 703 || v:version == 703 && has("patch541") + set formatoptions+=j " Delete comment character when joining commented lines +endif + +if has('path_extra') + setglobal tags-=./tags tags-=./tags; tags^=./tags; +endif + +set autoread + +if &history < 10000 + set history=10000 +endif +if &tabpagemax < 50 + set tabpagemax=50 +endif +if !empty(&viminfo) + set viminfo^=! +endif +set sessionoptions-=options +set viewoptions-=options + + +" Allow color schemes to do bright colors without forcing bold. +if &t_Co == 8 && $TERM !~# '^Eterm' + set t_Co=16 +else + set t_Co=256 +endif + +if empty(mapcheck('', 'i')) + inoremap u +endif + +if empty(mapcheck('', 'i')) + inoremap u +endif " Basics -set t_Co=256 -set encoding=utf8 -set nocompatible -set background=dark -" set background=light +set encoding=utf-8 " General " setlocal spell spelllang=en_us set fileformats=unix,dos,mac set nostartofline -set history=10000 -set autoread set autochdir set colorcolumn=81 " Have tab complete work more like bash -set wildmenu set wildmode=list:longest -set backspace=start,eol,indent set whichwrap+=<,>,[,] set magic @@ -41,27 +114,19 @@ set softtabstop=4 set tabstop=4 " Indent -set autoindent set smartindent set copyindent set preserveindent set shiftround -" Status -" ~/file [type] [line,column] [number of lines] -set statusline=%F%m%r%h%w\ [%Y]\ [%03l,%03v]\ [%L] -set laststatus=2 - " Text Formatting/Layout set nowrap set ignorecase set smartcase set list -set listchars=tab:\ \ ,trail:… " UI set showcmd -set ruler set number relativenumber set numberwidth=4 set hidden @@ -70,10 +135,7 @@ set hidden set showmatch set matchtime=2 set hlsearch -set incsearch -set scrolloff=5 -set sidescrolloff=5 set noerrorbells set novisualbell set t_vb= -set tm=500 +set timeoutlen=500 diff --git a/vim/.config/vim/plugin/theme.vim b/vim/.config/vim/plugin/theme.vim new file mode 100644 index 0000000..d4a881f --- /dev/null +++ b/vim/.config/vim/plugin/theme.vim @@ -0,0 +1,2 @@ +colorscheme wombat +set background=dark diff --git a/vim/.config/vim/vimrc b/vim/.config/vim/vimrc index 8f30356..95f4d50 100644 --- a/vim/.config/vim/vimrc +++ b/vim/.config/vim/vimrc @@ -1,3 +1,7 @@ +" Setting nocompatible here because this setting can effect other settings. +" The vim help suggests this as the first setting because of the side effects. +set nocompatible + " Load from init.d instead of plugin directory. This is done so a leader key " can be set before loading plugin settings. This allows the plugin setting " files to set mappings with leader keys