From 8a0ca3eb1488800be99d1b74e474b693c4276485 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 15:53:49 +1200 Subject: Inline scroll_next.vim plugin It's just one line, and not very complicated. A plugin is overkill. --- .gitmodules | 3 --- vim/bundle/scroll_next | 1 - vim/vimrc | 37 ++++++++++--------------------------- 3 files changed, 10 insertions(+), 31 deletions(-) delete mode 160000 vim/bundle/scroll_next diff --git a/.gitmodules b/.gitmodules index 1c789480..86bad115 100644 --- a/.gitmodules +++ b/.gitmodules @@ -47,9 +47,6 @@ [submodule "vim/bundle/replace_operator"] path = vim/bundle/replace_operator url = https://sanctum.geek.nz/code/vim-replace-operator.git -[submodule "vim/bundle/scroll_next"] - path = vim/bundle/scroll_next - url = https://sanctum.geek.nz/code/vim-scroll-next.git [submodule "vim/bundle/shebang_change_filetype"] path = vim/bundle/shebang_change_filetype url = https://sanctum.geek.nz/code/vim-shebang-change-filetype.git diff --git a/vim/bundle/scroll_next b/vim/bundle/scroll_next deleted file mode 160000 index cc135ce0..00000000 --- a/vim/bundle/scroll_next +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc135ce086c158012c8b740ff8e5a802b9f9ee52 diff --git a/vim/vimrc b/vim/vimrc index e74abeff..87d194e4 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -997,32 +997,16 @@ endtry " We'll start with the non-leader mappings. Ideally, there shouldn't be too " many of these. " -" I like using the space bar to scroll down a page, so I can lazily tap it to -" read documents, and I find its default behaviour of moving right one -" character to be useless. -" -" I also have a custom plugin named scroll_next.vim that issues :next to have -" it move to the next file in the arglist if the bottom line of the buffer is -" visible, for reading multiple buffers. -" -" -" -" However, I only want that functionality mapped if the required plugin is -" actually going to load, so I check that it's available and that the -" 'loadplugin' option is set before using its provided map target, because if -" it doesn't it will kill the space key. If the plugin doesn't look like it's -" going to load, I just bind Space to do the same thing as PageDown. -" -" Either way, the downside of this arrangement is it's an easy key to hit -" accidentally. I'm keeping it for the moment, though. + +" I find the space bar's default behaviour 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 +" the buffer is visible, and then moving to the :next buffer. " " I always wanted you to go into space, man. " -if &loadplugins && globpath(&runtimepath, 'plugin/scroll_next.vim') !=# '' - nmap (ScrollNext) -else - nnoremap -endif +nnoremap + \ line('w$') < line('$') ? "\" : ":\next\" " I hate CTRL-C in insert mode, which ends the insert session without firing " the InsertLeave event for automatic command hooks. It seems worse than @@ -1053,10 +1037,9 @@ endif " of the simple mapping above is not too much more complicated, but it was not " easy to figure out. " -" At any rate, as with the space bar's leverage of the scroll_next.vim plugin -" above, we only want to establish the mapping if we can expect the plugin to -" load, so test that it exists with the expected name and that 'loadplugins' -" is set. +" At any rate, we only want to establish the mapping if we can expect the +" plugin to load, so test that 'loadplugins' is set and that the plugin file +" exists with the expected filename. " " If the plugin isn't available, I just abandon CTRL-C to continue its " uselessness. -- cgit v1.2.3 From d71a8420073e6ee391cee7e2bd5ec4a3933603a7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 15:54:13 +1200 Subject: Adjust my complaint about i_CTRL-C --- vim/vimrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 87d194e4..ffa332e5 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1008,13 +1008,13 @@ endtry nnoremap \ line('w$') < line('$') ? "\" : ":\next\" -" I hate CTRL-C in insert mode, which ends the insert session without firing -" the InsertLeave event for automatic command hooks. It seems worse than -" useless; why would you want that? It breaks plugins that hinge on mirrored -" functionality between the InsertEnter and InsertLeave automatic command -" events, and doesn't otherwise do anything different from Escape. Even -" worse, people think it's a *synonym* for Escape, and use it because it's -" easier to reach than the Escape key or CTRL-[. It's terrible! +" I hate CTRL-C's default insert mode behaviour. It ends the insert session +" without firing the InsertLeave event for automatic command hooks. Why would +" anyone want that? It breaks plugins that hinge on mirrored functionality +" between the InsertEnter and InsertLeave events, and doesn't otherwise differ +" from Escape or :stopinsert. Even worse, people think it's a *synonym* for +" Escape, and use it because it's easier to reach than the Escape key or +" CTRL-[. Terrible! " " Instead, I apply a custom plugin named insert_cancel.vim to make it cancel " the current insert operation; that is, if the buffer has changed at all -- cgit v1.2.3 From 5bc7a679d46f734ad822eec89ddd87f2100469ea Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 16:15:39 +1200 Subject: Correct a word --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ffa332e5..0a246996 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -108,9 +108,9 @@ endif " versions of Vim, forbid that character. I haven't found the exact patch " level that this was fixed yet, nor the true reason for the bug. " -" If any of those conditions are meant, throw an explanatory error and stop -" reading this file. Most of the file doesn't depend on MYVIM, but there's -" no point catering to these edge cases. +" If any of those conditions are met, throw an explanatory error and stop +" reading this file. Most of the file doesn't depend on MYVIM, but there's no +" point catering to these edge cases. " if $MYVIM ==# '' echoerr 'Blank user runtime path' -- cgit v1.2.3 From c5ddd1914b257114d931602fc7852ebcbeab5039 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 16:28:13 +1200 Subject: Correct a comment --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 0a246996..ed825c4d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -145,7 +145,7 @@ command! -bar ReloadFileType \ call s:ReloadFileType() " We'll also define a :ReloadVimrc command. This may seem like overkill at -" first; surely just :source $MYVIMRC is good enough? +" first; surely just `:source $MYVIMRC` would be good enough? " " We're defining the command because of an edge case: if the vimrc stub or " main file is re-sourced, the global settings for options like 'expandtab' -- cgit v1.2.3 From 7d1942ef6f2c600712908beb5b3355e2b4e04c8e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 20:28:05 +1200 Subject: Rewrite a misleading paragraphy --- vim/vimrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ed825c4d..ebd0546a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -354,10 +354,8 @@ if has('persistent_undo') Establish $MYVIM/cache/undo set undodir^=$MYVIM/cache/undo// - " Turn the persistent undo features on, regardless of whether we have - " a cache directory for them as a result of the logic above. The files - " might sprinkle around the filesystem annoyingly, but that's still better - " than losing the history completely. + " Turn the persistent undo features on, now that we hopefully have a cache + " directory configured to collect them. " set undofile -- cgit v1.2.3 From dbe3297efab1cb83a06d47f4722ee8557f6cab92 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 20:32:33 +1200 Subject: Remove return value from EstablishDir() It's not being used, so it's a bit misleading to provide it. --- vim/vimrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ebd0546a..3887c11b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -221,8 +221,9 @@ augroup END " function! s:Establish(path) abort let path = expand(a:path) - return isdirectory(path) - \ || exists('*mkdir') && mkdir(path, 'p', 0700) + if !isdirectory(path) && exists('*mkdir') + call mkdir(path, 'p', 0700) + endif endfunction " Now we define the :Establish command for user-level access to the -- cgit v1.2.3 From 151d71c773f1749d5c81c43e65d14f4a08504d6c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 21:07:26 +1200 Subject: Correct and improve comment-stripping command --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 3887c11b..ae1b37d3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -13,7 +13,7 @@ " something like this to strip out all the blank lines and lines with only " comments: " -" :v/^\s*[^"]/d +" :g/\m^$\|^\s*"/d " " This file should be saved as "vimrc" in the user runtime directory. On " Unix-like operating systems, this is ~/.vim; on Windows, it's ~/vimfiles. -- cgit v1.2.3 From 9014dc52e8fdaf101ad67ecb199a23f14a8bbd68 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 21:10:30 +1200 Subject: Change a word in a comment --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index ae1b37d3..818c04f9 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1183,7 +1183,7 @@ let maplocalleader = ',' " require any plugins. " " These are sometimes applicable in visual mode, and sometimes not. We'll -" start with the ones that only make sense as normal mode maps. Interesting, +" start with the ones that only make sense as normal mode maps. Annoyingly, " a visual mode mapping for 'cursorline' toggling doesn't work at all; " 'cursorline' is always off when in any visual mode, including block mode, " where it actually might have been really handy. -- cgit v1.2.3 From 8fb7d6b0edc93bac3829c7c5e31c0130373c26d3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 01:13:34 +1200 Subject: Lots more literate explanation and development --- vim/vimrc | 486 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 258 insertions(+), 228 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 818c04f9..dcb73f3d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -17,9 +17,9 @@ " " This file should be saved as "vimrc" in the user runtime directory. On " Unix-like operating systems, this is ~/.vim; on Windows, it's ~/vimfiles. -" It requires Vim 7.0 or newer with +eval, not running in &compatible mode. -" The vimrc stub at ~/.vimrc on Unix or ~/_vimrc on Windows checks that these -" conditions are met before loading this file. +" It requires Vim 7.0 or newer with +eval, with 'nocompatible'. The vimrc +" stub at ~/.vimrc on Unix or ~/_vimrc on Windows checks that these conditions +" are met before loading this file. " " > And I was lifted up in heart, and thought " > Of all my late-shown prowess in the lists, @@ -31,110 +31,125 @@ " > --Tennyson " -" This file contains a few Unicode characters, and the Vint Vim script linter -" wants me to declare that, so I'll do so. The :help for :scriptencoding says -" that I should do that after 'encoding' is set, so we'll do that now. +" This file has characters outside the ASCII character set, which makes the +" Vim script linter vim-vint recommend declaring the file encoding with +" a :scriptencoding command. The :help for this command specifies that it +" should be done after 'encoding' is set, so we'll do that here at the top of +" the file too. " " On Unix, I keep LANG defined in my environment, and it's almost always set " to a multibyte (UTF-8) locale. This informs Vim's choice of internal -" character encoding, but the default for the 'encoding' option is latin1, -" which is seldom what I want, and if I do want it, I'll specify it with LANG -" or possibly a manual :set command. UTF-8 makes much more sense as a default -" encoding if Vim can't glean what I want from LANG. +" character encoding, but the default for the 'encoding' option in LANG's +" absence is "latin1". Nowadays, this is never what I want, so we'll manually +" choose "utf-8" as an encoding instead if LANG is not defined. " if !exists('$LANG') set encoding=utf-8 endif scriptencoding utf-8 -" With encoding handled, the next thing we'll do is set an environment -" variable MYVIM for the user runtime directory, if such a variable does not -" already exist in the environment, and there's a value in 'runtimepath' from -" which to glean a useable path. We'll use the path nominated in the MYVIM -" variable as the root of our 'backupdir', 'directory', 'undodir', and -" 'viminfofile' caches, and anywhere else we need a sensible writeable -" location for Vim-related files. Having it available as an environment -" variable makes assignments with :set more convenient, without requiring -" :execute wrappers. +" With encoding handled, the next thing we'll do is ensure we have an +" environment variable MYVIM set that specifies the path to the directory +" holding user runtime files. We'll only set our own if such a variable does +" not already exist in the environment. +" +" We'll use the path nominated in the MYVIM variable as the root of our +" 'backupdir', 'directory', 'undodir', and 'viminfofile' caches, and anywhere +" else we need a sensible writeable location for Vim-related files. Having it +" available as an environment variable makes assignments with :set and +" escaping much more convenient, without requiring awkward :execute wrappers. " " I think the absence of a variable like this is a glaring omission from Vim. " We have VIM, VIMRUNTIME, and MYVIMRC, so why is there not an environment " variable for the user's Vim runtime directory? It is a mystery. " -" We'll use the first path specified in 'runtimepath' as a default value. -" This is similar to what Vim does internally for the location of the spelling -" database files in the absence of a setting for 'spellfile'. +" The default value for MYVIM will be the first path in &runtimepath. This is +" similar to what Vim does internally for situating its spelling database +" files, in the absence of a specific setting for 'spellfile'. " " Splitting the values of a comma-separated option like 'runtimepath' -" correctly, is a bit more complicated than it seems. Its list separator is -" more accurately defined as a comma that is not preceded by a backslash, and -" which is followed by any number of spaces and/or further commas. +" correctly is surprisingly complicated. The list separator for such options +" is more accurately defined as follows: +" +" > A comma not preceded by a backslash, and possibly followed by an arbitrary +" > number of spaces and commas. " " The pattern required for the split breaks down like this: " -" \\ Literal backslash -" \@ 730 || v:version == 730 && has('patch541') set formatoptions+=j @@ -658,9 +683,10 @@ endif " set hidden -" Do highlight matches for completed searches in the text, but clear that -" highlighting away when this vimrc is reloaded. Later on in this file, -" CTRL-L in normal mode is remapped to tack on a :nohlsearch as well. +" Highlight matches for completed searches in the buffer text, but clear that +" highlighting away when this vimrc file is reloaded. Later on in this file, +" CTRL-L in normal mode is remapped to issue :nohlsearch in addition to its +" usual screen refresh function. " set hlsearch nohlsearch @@ -669,16 +695,17 @@ nohlsearch " including scrolling the screen to show the first such match if necessary. " This can be somewhat jarring, particularly when the cursor ends up scrolling " a long way from home in a large file, but I think the benefits of being able -" to see instances of what I'm trying to match as I try to match it do -" outweigh that discomfort. +" to see instances of what I'm trying to match as I type the pattern do outweigh +" that discomfort. " set incsearch " If there's only one window, I don't need a status line to appear beneath it. -" I very often edit only a few files in one window in a Vim session. I like -" the initial screen just being empty save for the trademark tildes. It gives -" me an extra screen line, too. It's a reflex for me to press CTRL-G in -" normal mode if I need to see the buffer name. +" I very often edit only a few files in one window in a Vim session. I like the +" initial screen for a call to Vim with no arguments to be empty, save for the +" trademark tildes. It gives me an extra screen line, too. It's a reflex for +" me to press CTRL-G in normal mode if I need to see the buffer name, so I don't +" really lose anything. " " This value reflects the Vim default, but Neovim changed its default to '2' " for an 'always-on' status line, so we'll explicitly set it to the default @@ -697,10 +724,10 @@ set lazyredraw " Define meta-characters to show in place of characters that are otherwise " invisible, or line wrapping attributes when the 'list' option is enabled. " -" We need to reset the option to its default value first, because at the time -" of writing at least, Neovim v0.3.5 doesn't check these for uniqueness, -" resulting in duplicates if this file is reloaded. 'backupskip' has similar -" problems in the original Vim v8.1.1487 and earlier. +" We need to reset the option to its default value first, because the current +" Neovim version at the time of writing (v0.3.5) doesn't check these for +" uniqueness, resulting in duplicates if this file is reloaded. 'backupskip' +" has similar problems in the original Vim v8.1.1487 and earlier. " set listchars&vi @@ -725,7 +752,7 @@ set listchars+=nbsp:+ " Non-breaking spaces " precedes: Signals presence of unwrapped text to screen left " « U+00BB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK " -" Failing that, '<' and '>' will still do the trick. +" Failing that, '<' and '>' will do the trick. " if has('multi_byte_encoding') set listchars+=extends:»,precedes:« @@ -738,9 +765,9 @@ endif " " I think that modelines are Vim's worst misfeature, and that 'nomodeline' " should be the default. It's enabled pretty bad security vulnerabilities -" over the years, and it's a lot more effective to use filetype detection, -" other automatic command hooks, or systems like .editorconfig to set -" variables specifically for a buffer or project. +" over the years, and it's a lot more effective to use filetype detection, other +" automatic command hooks, or methods like .editorconfig to set variables +" specifically for a buffer or project. " set nomodeline @@ -751,22 +778,21 @@ set nomodeline set nrformats-=octal " I like to leave the last line of the screen blank unless something is -" actually happening in it, so I have grown to like the Vim default of -" 'noruler'. CTRL-G shows me everything I need to know, and is -" near-instinctive now. +" actually happening in the editor for it to report, so I have grown to like +" the Vim default of 'noruler'. CTRL-G shows me everything I need to know, +" and is near-instinctive now. " " Rude system vimrc files tend to switch this back on, though, and Neovim has -" it on by default, so we will often need to put it back to normal, as we do -" here. +" it on by default, and so we force it off here. " set noruler -" Sessions preserving buffer and window layout are great for more complex and -" longer-term projects like books, but they don't play together well with -" plugins and filetype plugins. Restoring the same settings from both -" reloaded plugins and from the session causes screeds of errors. Adjusting -" session behaviour to stop it trying to restore quite so much makes them -" useable. +" Sessions preserve window, tab, and buffer layout, and are thereby great for +" more complex and longer-term projects like books, but they don't play +" together well with plugins and filetype plugins. Restoring the same +" settings from both reloaded plugins and from the session causes screeds of +" errors. Adjusting session behaviour to stop it trying to restore the sorts +" of settings that plugins manage makes them useable again. " set sessionoptions-=localoptions " No buffer options or mappings set sessionoptions-=options " No global options or mappings @@ -779,8 +805,8 @@ set sessionoptions-=options " No global options or mappings " start Vim with no file arguments. " " I haven't felt the need to mess with the other flags in this option. -" I don't have any problems with spurious Enter prompts, which seems to be -" the main reason people pile it full of letters. +" I don't have any problems with spurious Enter prompts, which seems to be the +" main reason people pile it full of letters. " set shortmess+=I @@ -810,9 +836,10 @@ if &term =~# '^putty\|^tmux' endif " We really don't want a mouse; while I use it a lot for cut and paste in X, -" at the terminal application level, it just gets in the way. Mouse events -" should be exclusively handled by the terminal emulator application, so Vim -" shouldn't try to give me terminal mouse support, even if it would work. +" it just gets in the way if the tool running in the terminal tries to use it +" too. Mouse events should be exclusively handled by the terminal emulator +" application, so Vim shouldn't try to give me terminal mouse support, even if +" it would work. " " The manual suggests that disabling this should be done by clearing 't_RV', " but that didn't actually seem to work when I tried it. @@ -835,17 +862,15 @@ set virtualedit+=block " I can't recall a time that Vim's error beeping or flashing was actually " useful to me, and so we turn it off in the manner that the manual instructs " in `:help 'visualbell'`. This enables visual rather than audio error bells, -" but in the same breath blanks the terminal attribute that would be used to +" but in the same breath, blanks the terminal attribute that would be used to " trigger such screen blinking, indirectly disabling the bell altogether. " " I thought at first that the newer 'belloff' and/or 'errorbells' options " would be a more intuitive way to keep Vim quiet, but the last time I checked -" that they didn't actually appear to work as comprehensively as this older -" method does. +" that, neither appeared to work as comprehensively as this older method does. " " Interestingly, the :help says that this setting has to be repeated in the -" gvimrc file for GUI Vim, so you'll find this exact same command issued again -" in there. +" gvimrc file for GUI Vim. " set visualbell t_vb= @@ -856,15 +881,14 @@ set visualbell t_vb= " The default value of 'full' for the 'wildmode' option puts the full " completion onto the line immediately, which I tolerate for insert mode " completion but don't really like on the Ex command line. Instead, I arrange -" for that with a second key press if I ever want it, which isn't often. I did -" without using it at all for years. +" for that to happen only with a second key press. " set wildmenu set wildmode=list:longest,full -" Define a list of patterns for the 'wildignore' option. Files and -" directories with names matching any of these patterns won't be presented as -" candidates for tab completion on the command line. +" Define a list of patterns to ignore for file and directory command line +" completion. Files and directories with names matching any of these patterns +" won't be presented as candidates for tab completion on the command line. " " To make this list, I went right through my home directory with " a `find`-toothed comb; counted the occurrences of every extension, forced @@ -872,13 +896,19 @@ set wildmode=list:longest,full " would seldom contain plain text. " " The following incantation does the trick with POSIX-compatible shell tools, -" giving you patterns for the top 50 extensions: -" -" $ find ~ -type f -name '*.*' | -" awk -F. '{exts[tolower($NF)]++} -" END {for(ext in exts)print exts[ext], "*." ext}' | -" sort -k1,1nr | -" sed 50q +" giving patterns for the top 100 alphanumeric extensions for files from the +" running user's home directory: +" +" $ find "$HOME" ! -type d -name '*.*' -exec \ +" sh -c 'for fn ; do +" ext=${fn##*.} +" case $ext in +" *[^[:alnum:]]*) continue ;; +" ?*) printf "%s\n" "$ext" ;; +" esac +" done' _ {} + | +" tr '[:upper:]' '[:lower:]' | sort | uniq -c | +" sort -k1,1nr | awk 'NR <= 100 {print "*." $2}' " " I turned out to have rather a lot of .html and .vim files. " @@ -1412,7 +1442,7 @@ onoremap % " This group defines some useful motions. -"" Leader,{ and Leader,} move to lines with non-space chars before current column +" Leader,{ and Leader,} move to top and bottom of indent region map { (VerticalRegionUp) sunmap { map } (VerticalRegionDown) -- cgit v1.2.3 From d90272a8b16da9299a21a56505ca6aad29969025 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 09:08:33 +1200 Subject: More vimrc comment editing --- vim/vimrc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index dcb73f3d..39d7e7b2 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -592,21 +592,21 @@ set formatoptions+=l " at the end of it. Typographically, as far as I can tell, this seems to be " a stylistic preference rather than a rule, rather like avoiding "widow" and " "orphan" lines in typesetting. I think it generally looks better to have the -" shortk word start the line, so we'll switch it on. +" short word start the line, so we'll switch it on. " set formatoptions+=1 " If the filetype plugins have correctly described what the comment syntax for " the buffer's language looks like, it makes sense to use that to figure out -" how to join lines within comments without redundant comment leaders cropping -" up. For example, with this set, in Vim, joining lines in this very comment -" with 'J' would remove the leading '"' characters that denote a comment. +" how to join lines within comments without redundant comment syntax cropping +" up. For example, with this set, joining lines in this very comment with 'J' +" would remove the leading '"' characters. " -" This option flag wasn't added until v7.3.541. Because we can't test for the -" availability of option flags directly, we resort to a version number check -" before attempting to add the flag. I don't like using :silent! to suppress -" errors for this sort of thing when I can reasonably avoid it, even if the -" tests are somewhat more verbose. +" This 'formatoptions' flag wasn't added until v7.3.541. Because we can't +" test for the availability of option flags directly, we resort to a version +" number check before attempting to set it. I don't like using :silent! to +" suppress errors for this sort of thing when I can reasonably avoid it, even +" if the tests are somewhat more verbose. " if v:version > 730 || v:version == 730 && has('patch541') set formatoptions+=j @@ -708,8 +708,8 @@ set incsearch " really lose anything. " " This value reflects the Vim default, but Neovim changed its default to '2' -" for an 'always-on' status line, so we'll explicitly set it to the default -" here in case we're using Neovim. +" for an 'always-on' status line, so we'll explicitly set it to the original +" Vim default here in case we're using Neovim. " set laststatus=1 -- cgit v1.2.3 From 874e5de53b7ba79e766a172f2a7450ae8708d0e7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 09:52:22 +1200 Subject: Improve extension-seeking command --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 39d7e7b2..c5815c81 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -899,7 +899,7 @@ set wildmode=list:longest,full " giving patterns for the top 100 alphanumeric extensions for files from the " running user's home directory: " -" $ find "$HOME" ! -type d -name '*.*' -exec \ +" $ find "$HOME" ! -type d -name '*.?*' -exec \ " sh -c 'for fn ; do " ext=${fn##*.} " case $ext in -- cgit v1.2.3 From 6916d13104583eefecd38d84de7090a01526d735 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 10:53:37 +1200 Subject: Remove an issue that I believe I have fixed --- ISSUES.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/ISSUES.md b/ISSUES.md index cb510942..a4bb0ccb 100644 --- a/ISSUES.md +++ b/ISSUES.md @@ -30,5 +30,3 @@ Known issues pushed upstream. * The `_text_filenames` completion handler for Bash won't work on files with newlines in their names. Can it be made to? -* Normal usage of write-mkpath.vim raises swap file warnings on Windows for - some reason. -- cgit v1.2.3 From 0fcd91f32fd9507f226f0e124dd0e263371c901f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 10:55:28 +1200 Subject: Add an issue with Vim mail ftplugin --- ISSUES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ISSUES.md b/ISSUES.md index a4bb0ccb..8e214ff1 100644 --- a/ISSUES.md +++ b/ISSUES.md @@ -30,3 +30,5 @@ Known issues pushed upstream. * The `_text_filenames` completion handler for Bash won't work on files with newlines in their names. Can it be made to? +* Something in the mail ftplugin is butchering the headers, probably something + that strips whitespace or quotes -- cgit v1.2.3 From 2cbe4931c0bbbb566fc6062cd874020c280b0dda Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 12:41:43 +1200 Subject: Restore a joke --- vim/vimrc | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index c5815c81..f45d4021 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1077,21 +1077,20 @@ if &loadplugins && globpath(&runtimepath, 'plugin/insert_cancel.vim') !=# '' imap (InsertCancel) endif -" I often don't remember or can't guess digraph codes very well, and want to -" look up how to compose a specific character that I can name, at least in -" part. The table in `:help digraph-table` is what to use for that situation, -" and it solves the problem, but the overhead of repeated lookups therein was -" just a little bit high. +" I often can't remember (or guess) digraph codes, and want to look up how to +" compose a specific character that I can name, at least in part. The table +" in `:help digraph-table` is what to use for that situation, and it solves +" the problem, but I didn't like the overhead of repeated lookups therein. " " Steve Losh has a solution I liked where a double-tap of CTRL-K in insert -" mode brought up a help window with the table, which could then be searched -" as normal: +" mode brought up the applicable :help window: " " " -" I took it one step further with a custom plugin digraph_search.vim that -" parses the digraph table and runs a simple text search of its names using -" a string provided by the user. For example, searching for ACUTE yields: +" I took that one step further with a custom plugin named digraph_search.vim. +" It parses the digraph table from :help and runs a simple text search of its +" names using a string provided by the user. For example, searching for ACUTE +" yields: " " > Digraphs matching ACUTE: " > ´ '' ACUTE ACCENT @@ -1126,11 +1125,11 @@ imap (DigraphSearch) nnoremap \ :nohlsearch -" The insert mode wrapper for normal CTRL-L uses CTRL-O to issue a single +" The insert mode wrapper for normal CTRL-L uses i_CTRL-O to issue a single " normal mode command. We intentionally use `:normal` rather than `:normal!` -" so that the normal mode mapping applies. I tried using just -" directly for this, but it didn't work; maybe i_CTRL-O doesn't respect -" mappings, but I couldn't find any documentation about this. +" so that the mapping works recursively. I tried using with :imap +" for this, but it didn't work. Maybe i_CTRL-O doesn't respect mappings. +" I couldn't find any documentation about it. " inoremap :execute "normal \" @@ -1301,10 +1300,11 @@ nnoremap z nmap b (CopyLinebreakToggle) " The above mappings show that mappings for toggling boolean options are -" simple, but there isn't a way to toggle single flags within option strings, -" so I wrote a plugin called toggle_flags.vim to provide :ToggleFlag and -" :ToggleFlagLocal commands. The first argument is the name of an option, and -" the second is the flag within it that should be toggled on or off. +" simple, but there isn't a way to toggle single flags within option strings +" with just the :set command, so I wrote a plugin called toggle_flags.vim to +" provide :ToggleFlag and :ToggleFlagLocal commands. The first argument is +" the name of an option, and the second is the flag within it that should be +" toggled on or off. "" Leader,a toggles 'formatoptions' 'a' auto-flowing flag nnoremap a @@ -1370,10 +1370,10 @@ nnoremap M "" Leader,S shows loaded scripts nnoremap S \ :scriptnames -"" Leader,v shows all global variables +"" Leader,v shows all global and internal variables nnoremap v \ :let g: v: -"" Leader,V shows all local variables +"" Leader,V shows all buffer, tab, and window local variables nnoremap V \ :let b: t: w: "" Leader,y shows all registers @@ -1405,19 +1405,19 @@ nnoremap j " This ground defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: " -" strip_trailing_whitespace.vim: +" " :StripTrailingWhitespace -" squeeze_repeat_blanks.vim: +" " :SqueezeRepeatBlanks -" keep_position.vim +" " :KeepPosition -"" Leader,x strips trailing whitespace via a custom plugin +"" Leader,x strips trailing whitespace nnoremap x \ :StripTrailingWhitespace xnoremap x \ :StripTrailingWhitespace -"" Leader,X squeezes repeated blank lines via a custom plugin +"" Leader,X squeezes repeated blank lines nnoremap X \ :SqueezeRepeatBlanks xnoremap X @@ -1506,8 +1506,8 @@ nnoremap R inoreabbrev tr@ tom@sanctum.geek.nz inoreabbrev tr/ -" And then, just fix some typographical and spelling errors for me -" automatically. +" And then, just automatically fix some things I almsot always spell or type +" wrnog. " inoreabbrev almsot almost inoreabbrev wrnog wrong -- cgit v1.2.3 From c167dd645374b0c7717fc7ec4c826a8d869e4a8f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 13:27:56 +1200 Subject: Refine another comment --- vim/vimrc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index f45d4021..fd5da916 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -162,13 +162,12 @@ command! -bar ReloadFileType " We'll also define a :ReloadVimrc command. This may seem like overkill, at " first. Surely just `:source $MYVIMRC` would be good enough? " -" We're defining the command because of the effect of reloading the vimrc on -" the current buffer at the time. If the vimrc stub or main file is -" re-sourced, the global settings for options like 'expandtab' and +" The problem is there are potential side effects to the current buffer when +" the vimrc is reloaded. The :set commands for options like 'expandtab' and " 'shiftwidth' may trample over different buffer-local settings that were " specified by filetype and indent plugins. To ensure these local values are -" reinstated, we'll define the command to include issuing :ReloadFileType -" after the vimrc file is sourced. +" reinstated, we'll define the new command wrapper to issue a :ReloadFileType +" command after the vimrc file is sourced. " " We can't put the actual :source command into the script-local function we " define here, because Vim would get upset that we're trying to redefine -- cgit v1.2.3 From 6bb6658926689ccbe604fa36bafc6e5c4a4d725f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 13:30:55 +1200 Subject: Rewrite a couple of paragraphs --- vim/vimrc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index fd5da916..bc6d7875 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1191,17 +1191,16 @@ nnoremap ]l nmap [ (PutBlankLinesAbove) nmap ] (PutBlankLinesBelow) -" We're on to the leader maps, now. It's difficult to know what order to put -" these in; I originally had them in alphabetical order, but it seems more -" useful now to group the by the category of their function, albeit roughly. +" We're on to the leader maps, now. It's difficult to know in what order to +" describe and specify these. I used to have them in alphabetical order, but +" it seems much more useful to group them by the type of action they take. " " First of all, let's set the leader keys; backslash happens to be the -" default, but I like to make my choice explicit here. -" -" As of 2019, I'm still not certain that comma is the best choice for my local -" leader. I use it all the time for this purpose, and it works well, but -" I don't much like that it shadows a useful function in the fFtT;, group, and -" wonder if I would use it more if I hadn't shadowed it. +" default, but I like to make my choice explicit here. As of 2019, I'm still +" not certain that comma is the best choice for my local leader. I use it all +" the time for this purpose, and it works well, but I don't much like that it +" shadows a useful function in the fFtT;, group, and I sometimes wonder if +" I would use the key for its original function more, had I not shadowed it. " let mapleader = '\' let maplocalleader = ',' -- cgit v1.2.3 From 9137357cb33f01b977ac999ff5b67bb3533dce8a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 12 Jun 2019 13:31:50 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 439f291c..a7af40bb 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v5.41.1 -Tue Jun 11 04:54:04 UTC 2019 +tejr dotfiles v5.42.0 +Wed Jun 12 01:31:50 UTC 2019 -- cgit v1.2.3