From 8c4d911372e709ec0950a8d9766bf2154208c128 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:16:44 +1200 Subject: Conform reloading vimrc message comment to truth --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 699f2e45..3e8aabfe 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -195,9 +195,9 @@ command! -bar ReloadFileType " a defensive measure to avoid infinite recursion. It may not actually be " necessary. " -" We emit a faked display of the command, as well, just to make it clear that -" something has happened. The :redraw just before that message seems to be -" necessary for this message to display correctly. I'm not sure why. +" We emit a message afterwards, just to make it clear that something has +" happened. The :redraw just before that message seems to be necessary for +" this message to display correctly. I'm not sure why. " function! s:ReloadVimrc() abort ReloadFileType -- cgit v1.2.3 From 916a3a4c0e07ec27e601538c0a583f58a7442ea7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:29:57 +1200 Subject: Use "written" not "saved" in vimrc comments --- vim/vimrc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 3e8aabfe..6a4d8c6d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -216,9 +216,9 @@ augroup vimrc augroup END " Reload the stub vimrc, and thereby this main one, each time either of them -" is saved. This often makes errors in the file immediately apparent, and -" saves restarting Vim or running the :source command manually, which -" I almost always want to do after changing my vimrc file anyway. +" is written. This often makes errors in the file immediately apparent, and +" saves restarting Vim or running the :source command manually, which I almost +" always want to do after changing my vimrc file anyway. " autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc \ ReloadVimrc @@ -682,22 +682,22 @@ if has('gui_running') set guioptions+=M endif -" By default, Vim doesn't allow a file buffer to have unsaved changes if it's -" not displayed in a window. Setting this option removes that restriction so -" that buffers can remain in a modified state while not actually displayed -" anywhere. +" By default, Vim doesn't allow a file buffer to have unwritten changes if +" it's not displayed in a window. Setting this option removes that +" restriction so that buffers can remain in a modified state while not +" actually displayed anywhere. " " This option is set in almost every vimrc I read; it's so pervasive that " I sometimes see comments expressing astonishment or annoyance that it isn't " set by default. However, I didn't actually need this option for several " years of Vim usage, because I instinctively close windows onto buffers only -" after the buffers within them were saved anyway. +" after the buffers within them have been written anyway. " " However, the option really is required for batch operations performed with -" commands like :argdo or :bufdo, because Vim won't otherwise tolerate unsaved -" changes to a litany of buffers that are not displayed in any window. After -" I started using such command maps a bit more often, I realized I finally had -" a reason to turn this on permanently. +" commands like :argdo or :bufdo, because Vim won't otherwise tolerate +" unwritten changes to a litany of buffers that are not displayed in any +" window. After I started using such command maps a bit more often, +" I realized I finally had a reason to turn this on permanently. " set hidden -- cgit v1.2.3 From 9199d96093a7eb35266547dd4c573776d8d86a39 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:31:04 +1200 Subject: Map Backspace to CTRL-^ (:edit alt buffer) in Vim --- vim/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 6a4d8c6d..c466b8d7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1045,6 +1045,12 @@ endif " many of these. " +" Use backspace as an even quicker way to switch to the current buffer's +" alternate buffer. User nickspoons of #vim was incredulous that I had never +" used CTRL-^ and indeed did not know about it. I have since repented. +" +nnoremap + " I find the space bar's default behavior in normal mode of moving right one " character to be useless. Instead, I remap it to be a lazy way of paging " through the argument list buffers, scrolling a page until the last line of -- cgit v1.2.3 From e9549730e15c08a5e16a184036fbf7c12b539b01 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:36:05 +1200 Subject: Add ,o mapping to :browse :oldfiles --- vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index c466b8d7..e63a232b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1443,6 +1443,9 @@ nnoremap E "" Leader,j jumps to buffers ("jetpack") nnoremap j \ :buffers:buffer +"" Leader,o opens a screenful of :browse :oldfiles, ready for a selection +nnoremap o + \ :browse :oldfilesq " This ground defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: -- cgit v1.2.3 From 810cfea9c8a86174c425220ae2c55e8919c9959e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:55:15 +1200 Subject: Adapt :browse :oldfiles mapping into plugin Just to avoid a hit-enter prompt by limiting it to just short of the vertical size of the screen, with a temporary array slice of v:oldfiles. --- vim/autoload/select_old_files.vim | 7 +++++++ vim/plugin/select_old_files.vim | 6 ++++++ vim/vimrc | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 vim/autoload/select_old_files.vim create mode 100644 vim/plugin/select_old_files.vim diff --git a/vim/autoload/select_old_files.vim b/vim/autoload/select_old_files.vim new file mode 100644 index 00000000..518b98d4 --- /dev/null +++ b/vim/autoload/select_old_files.vim @@ -0,0 +1,7 @@ +function! select_old_files#() abort + let oldfiles = v:oldfiles + let limit = get(g:, 'select_old_files_limit', &lines - 1) + let v:oldfiles = v:oldfiles[:limit-2] + browse oldfiles + let v:oldfiles = oldfiles +endfunction diff --git a/vim/plugin/select_old_files.vim b/vim/plugin/select_old_files.vim new file mode 100644 index 00000000..dbfbd64c --- /dev/null +++ b/vim/plugin/select_old_files.vim @@ -0,0 +1,6 @@ +if exists('loaded_select_old_files') + finish +endif +let loaded_select_old_files = 1 +command! -bar SelectOldFiles + \ call select_old_files#() diff --git a/vim/vimrc b/vim/vimrc index e63a232b..2bcf9943 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1445,7 +1445,7 @@ nnoremap j \ :buffers:buffer "" Leader,o opens a screenful of :browse :oldfiles, ready for a selection nnoremap o - \ :browse :oldfilesq + \ :SelectOldFiles " This ground defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: -- cgit v1.2.3 From 841425d1ba85324d0ddc2201b9e62228d6ac5cd8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 16:55:52 +1200 Subject: Set target dependencies on install-vim-autoload --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f6a2ae02..4be00a3a 100644 --- a/Makefile +++ b/Makefile @@ -563,7 +563,7 @@ install-vim-after-indent: mkdir -p $(VIMDIR)/after/indent cp -p -- vim/after/indent/*.vim $(VIMDIR)/after/indent -install-vim-after-plugin: +install-vim-after-plugin: install-vim-autoload mkdir -p $(VIMDIR)/after/plugin cp -p -- vim/after/plugin/*.vim $(VIMDIR)/after/plugin @@ -603,7 +603,7 @@ install-vim-config: install-vim-cache install-vim-filetype: cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR) -install-vim-ftplugin: +install-vim-ftplugin: install-vim-autoload mkdir -p -- $(VIMDIR)/ftplugin cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin @@ -619,7 +619,7 @@ install-vim-indent: mkdir -p -- $(VIMDIR)/indent cp -p -- vim/indent/*.vim $(VIMDIR)/indent -install-vim-plugin: +install-vim-plugin: install-vim-autoload mkdir -p -- $(VIMDIR)/plugin cp -p -- vim/plugin/*.vim $(VIMDIR)/plugin -- cgit v1.2.3 From c9a9784d80bfe09a269ff79ca2279674b9412971 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 17:01:16 +1200 Subject: Spruce up mapping comments --- vim/vimrc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 2bcf9943..9eaa699b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1443,11 +1443,17 @@ nnoremap E "" Leader,j jumps to buffers ("jetpack") nnoremap j \ :buffers:buffer -"" Leader,o opens a screenful of :browse :oldfiles, ready for a selection + +" Leader,o hacks up the list of old files from viminfo just long enough to +" ensure that :browse :oldfiles fits in a screen, avoiding an Enter or 'q' +" keypress before entering the number. This one is handy followed by +" ,\ to jump back to the last remembered position in that file, since +" by definition viminfo remembers that mark, too. +" nnoremap o \ :SelectOldFiles -" This ground defines mappings for filtering and batch operations to clean up +" This group defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: " " :KeepPosition @@ -1543,8 +1549,7 @@ xmap * (RegexEscape) " command wrapper defined much earlier in the file, so that filetypes also get " reloaded afterwards, meaning I don't need to follow R with " a F to fix up broken global settings. - -"" Leader,R reloads ~/.vimrc +" nnoremap R \ :ReloadVimrc -- cgit v1.2.3 From 1379a248cfcddf38cb22609f4aac55cc25d4757d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 17:16:16 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 7478c675..093c9915 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v6.14.0 -Sun, 16 Jun 2019 02:26:48 +0000 +tejr dotfiles v6.15.0 +Sun, 16 Jun 2019 05:16:16 +0000 -- cgit v1.2.3