From d43717bbc761ee7c1d747621af712282f6aaf5e7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 17:24:08 +1300 Subject: Factor out vimrc user 'runtimepath' switching --- vim/vimrc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 69f63083..9ab03c51 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -4,6 +4,15 @@ " Undo anything the operating system's vimrc may have broken runtime system.vim +" Set an environment variable for the user runtime directory +if !exists('$MYVIMRUNTIME') + if has('win32') || has('win64') + let $MYVIMRUNTIME = expand('~/vimfiles') + else + let $MYVIMRUNTIME = expand('~/.vim') + endif +endif + " Load filetype settings, plugins, and maps if has('autocmd') let g:maplocalleader = ',' @@ -49,11 +58,7 @@ set backspace+=start " The start of current insertion " Try to keep backups in one system-appropriate dir set backup -if has('win32') || has('win64') - set backupdir^=~/vimfiles/cache/backup -else - set backupdir^=~/.vim/cache/backup -endif +set backupdir^=$MYVIMRUNTIME/cache/backup " Add some paths not to back up if has('unix') @@ -79,11 +84,7 @@ endif set confirm " Try to keep swapfiles in one system-appropriate dir -if has('win32') || has('win64') - set directory^=~/vimfiles/cache/swap// -else - set directory^=~/.vim/cache/swap// -endif +set directory^=$MYVIMRUNTIME/cache/swap// " Use UTF-8 if we can and env LANG didn't tell us not to if has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1' @@ -198,11 +199,7 @@ endif " Keep undo files, hopefully in a dedicated directory if has('persistent_undo') set undofile - if has('win32') || has('win64') - set undodir^=~/vimfiles/cache/undo// - else - set undodir^=~/.vim/cache/undo// - endif + set undodir^=$MYVIMRUNTIME/cache/undo// endif " Wildmenu settings; see also plugin/wildignore.vim -- cgit v1.2.3 From ce1d06de80d825de0ef9ed11f417b84980a2eb86 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 17:24:57 +1300 Subject: Include /usr/tmp in 'backupskip' The temporary paths used by `sudo -e` appear to be chosen at build time. --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 9ab03c51..3f058544 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -63,7 +63,8 @@ set backupdir^=$MYVIMRUNTIME/cache/backup " Add some paths not to back up if has('unix') set backupskip^=/dev/shm/* " Shared memory RAM disk - set backupskip^=/var/tmp/* " Debian's $TMPDIR for sudoedit(8) + set backupskip^=/usr/tmp/* " Hardcoded path for `sudo -e` + set backupskip^=/var/tmp/* " Hardcoded path for `sudo -e` endif " Indent wrapped lines if supported -- cgit v1.2.3 From 924563586b6766044bff1ff029dac8917394a623 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 18:08:17 +1300 Subject: No longer need a longer 'timeoutlen' in Vim --- vim/vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 3f058544..a63871f6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -189,9 +189,6 @@ set showbreak=... set splitbelow " Below the current window, not above set splitright " Right of the current window, not left -" Give me a bit longer to complete mappings -set timeoutlen=3000 - " No terminal mouse, even if we could if exists('+ttymouse') set ttymouse= -- cgit v1.2.3 From 24761da02819234a841054c1eec052de185ca9c4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 18:08:35 +1300 Subject: Force 'ttymouse' off a little more carefully --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index a63871f6..6c16f033 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -190,7 +190,8 @@ set splitbelow " Below the current window, not above set splitright " Right of the current window, not left " No terminal mouse, even if we could -if exists('+ttymouse') +" The manual says to set 't_RV', but I don't like that +if exists('+ttymouse') && &ttymouse !=# '' set ttymouse= endif -- cgit v1.2.3 From d5f8d934cf6aad67f57a10aac88e34db280c5017 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 18:17:23 +1300 Subject: Remove repeat.vim and surround.vim Getting in the habit of using , and ; properly. This is the last of the third-party code in my ~/.vim! --- .gitmodules | 14 +++----------- README.md | 6 ------ lint/vim.sh | 19 +------------------ vim/after/plugin/surround.vim | 9 --------- vim/bundle/repeat | 1 - vim/bundle/surround | 1 - 6 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 vim/after/plugin/surround.vim delete mode 160000 vim/bundle/repeat delete mode 160000 vim/bundle/surround diff --git a/.gitmodules b/.gitmodules index 6d232f3e..f13f3697 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -# My Vim plugins +# Vim plugins [submodule "vim/bundle/big_file_options"] path = vim/bundle/big_file_options url = https://sanctum.geek.nz/code/vim-big-file-options.git @@ -72,7 +72,7 @@ path = vim/bundle/vimrc_reload_filetype url = https://sanctum.geek.nz/code/vim-vimrc-reload-filetype.git -# My Vim filetype plugins +# Vim filetype plugins [submodule "vim/bundle/diff_prune"] path = vim/bundle/diff_prune url = https://sanctum.geek.nz/code/vim-diff-prune.git @@ -83,18 +83,10 @@ path = vim/bundle/perl_version_bump url = https://sanctum.geek.nz/code/vim-perl-version-bump.git -# My Vim colorschemes +# Vim colorschemes [submodule "vim/bundle/juvenile"] path = vim/bundle/juvenile url = https://sanctum.geek.nz/code/vim-juvenile.git [submodule "vim/bundle/sahara"] path = vim/bundle/sahara url = https://sanctum.geek.nz/code/vim-sahara.git - -# Others' Vim plugins -[submodule "vim/bundle/repeat"] - path = vim/bundle/repeat - url = https://sanctum.geek.nz/clone/vim-repeat.git -[submodule "vim/bundle/surround"] - path = vim/bundle/surround - url = https://sanctum.geek.nz/clone/vim-surround.git diff --git a/README.md b/README.md index 67272653..b66b8a13 100644 --- a/README.md +++ b/README.md @@ -367,12 +367,6 @@ They eventually get either discarded or spun off into their own repositories, added to this repository as submodules under `vim/bundle` instead, and uploaded to [vim.org](https://www.vim.org/account/profile.php?user_id=73687). -I still use two third-party plugins: Tim Pope's -[repeat.vim](https://www.vim.org/scripts/script.php?script_id=2136) and -[surround.vim](https://www.vim.org/scripts/script.php?script_id=1697). In my -opinion, these plugins are so fundamental and useful that they should have been -implemented in or bundled with Vim itself many years ago. - #### Filetype plugins I also define a few rules specific to file types I often edit in diff --git a/lint/vim.sh b/lint/vim.sh index bd8e73af..b3b2e261 100644 --- a/lint/vim.sh +++ b/lint/vim.sh @@ -1,19 +1,2 @@ -# Build an argument list of checks to make -set -- -for vim in vim/* vim/bundle/* ; do - [ -e "$vim" ] || continue - case $vim in - - # Skip third-party plugins - vim/bundle) ;; - vim/bundle/repeat) ;; - vim/bundle/surround) ;; - - # Check everything else - *) set -- "$@" "$vim" ;; - - esac -done - # Run check -vint -s -- "$@" || exit +vint -s -- vim || exit diff --git a/vim/after/plugin/surround.vim b/vim/after/plugin/surround.vim deleted file mode 100644 index 800bc38d..00000000 --- a/vim/after/plugin/surround.vim +++ /dev/null @@ -1,9 +0,0 @@ -" Remove surround.vim's insert mode maps -if !exists('g:loaded_surround') - finish -endif -iunmap ISurround -iunmap Isurround -iunmap S -iunmap s -iunmap diff --git a/vim/bundle/repeat b/vim/bundle/repeat deleted file mode 160000 index 43d2678f..00000000 --- a/vim/bundle/repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 43d2678fa59d068c815d8298331c195e850ff5a7 diff --git a/vim/bundle/surround b/vim/bundle/surround deleted file mode 160000 index 59706887..00000000 --- a/vim/bundle/surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 597068870b8f093a8b2d11536c62ff31222ee8d0 -- cgit v1.2.3 From 63596ba1b4207115116bff9257d52c16964f612a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 18:30:57 +1300 Subject: Switch to two-space sentences You win, Steve Losh. --- vim/vimrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 6c16f033..122a108d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -84,6 +84,10 @@ endif " Give me a prompt instead of just rejecting risky :write, :saveas set confirm +" Require two spaces for sentence objects +" Yes, I have become a filthy two-spacer +set cpoptions+=J + " Try to keep swapfiles in one system-appropriate dir set directory^=$MYVIMRUNTIME/cache/swap// @@ -135,9 +139,6 @@ set include= " Show search matches as I type my pattern set incsearch -" Don't join lines with two spaces at the end of sentences -set nojoinspaces - " Don't show a statusline if there's only one window " This is the Vim default, but NeoVim changed it if &laststatus != 1 -- cgit v1.2.3 From a99b834ad05c7c3c6aaaffc4918a38cad2af6124 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 26 Dec 2018 18:31:54 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f88e3e2b..22c48d03 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v3.6.1 -Thu Dec 20 02:08:26 UTC 2018 +tejr dotfiles v4.0.0 +Wed Dec 26 05:31:40 UTC 2018 -- cgit v1.2.3