commit 70510d499673bf564b99eb9d7dc74a21228f72f5 (patch)
parent bfc61cd939e41bf598f883781c9a6f9eaa5f2119
Author: Alex Karle <alex@karle.co>
Date: Thu, 13 Feb 2020 00:13:07 -0500
vim: small vimrc tweaks for (n)vi(m)
1. Have ~/.vimrc trump ~/.vim/vimrc for nvim
2. Move 'number' to 'improved.vim' -- not needed for simple edits, but
crucial for the longer code sessions (debugging, error output, etc)
3. Remove some newer settings (belloff, guard packpath) that error on
older Vim's
Diffstat:
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/nvim/init.vim b/nvim/init.vim
@@ -5,7 +5,13 @@
" First, just source the regular Vim stuff
set runtimepath+=~/.vim,~/.vim/after
set packpath+=~/.vim
-source ~/.vim/vimrc
+
+if filereadable(expand("~/.vimrc"))
+ " On some machines, I prefer to use a ~/.vimrc
+ source ~/.vimrc
+else
+ source ~/.vim/vimrc
+endif
" no numbers in terminal
autocmd TermOpen * setlocal nonumber
diff --git a/vim/improved.vim b/vim/improved.vim
@@ -8,6 +8,9 @@ else
let s:vimdir = expand($HOME . '/.vim')
endif
+" Line numbers on -- helpful for debugging, not needed in `vi`
+set number
+
" Faster grepping! (use ripgrep if available for :grep and :FZF)
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading
diff --git a/vim/vimrc b/vim/vimrc
@@ -11,11 +11,9 @@ set incsearch " Incrementally search
set backspace=indent,eol,start " Backspace should function as expected
set ttimeout " Timeout on esc keycodes
set ttimeoutlen=30 " Low timeout to avoid <ESC> delay
-set belloff=all " Quiet in the Console!
set modelines=0 " Disable modelines for security
set history=10000 " Remember last 1000 :commands
set scrolloff=3 " Scroll at 3 rows from edge of screen
-set number " Line numbers on
set wildmenu " Visual completion for command mode
set showcmd " Show the command being typed
set laststatus=2 " Always show the statusbar
@@ -24,7 +22,7 @@ set listchars=tab:>-,trail:~,eol:$ " Nicer whitespace
if v:progname =~# 'vim$'
runtime! improved.vim " put the IM in VIM
-else
+elseif has('packages')
set pp-=~/.vim
set pp-=~/.vim/after
endif