From 1076c3b7c542bb499be84c738cf5cf0c9248bf28 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 11:35:07 +1200 Subject: Expand on why I hate i_CTRL-C --- vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index a501bd88..35920814 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1031,7 +1031,9 @@ endif " 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. Terrible! +" 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! " " 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 f03594d5319843a1dbb4e6fe81cc73af0ad51bbe Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 11:45:47 +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 35920814..8370ae31 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -460,7 +460,7 @@ endif " By default, I prefer that figuring out where a region of text to fold away " should be done by the indent level of its lines, since I tend to be careful -" about my indentation even in languages where it has no structure +" about my indentation even in languages where it has no structural " significance. " set foldmethod=indent -- cgit v1.2.3 From f88990c809d6e231289c63803e59641ec628f4fd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 12:59:58 +1200 Subject: Add an issue --- ISSUES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ISSUES.md b/ISSUES.md index a4bb0ccb..cb510942 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? +* Normal usage of write-mkpath.vim raises swap file warnings on Windows for + some reason. -- cgit v1.2.3 From 8a49423d46127c8d9e603d7f37b999f80ba9acd1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 13:00:04 +1200 Subject: Add an idea --- IDEAS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IDEAS.md b/IDEAS.md index 7c42cc96..6e098377 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -33,3 +33,7 @@ Ideas some point * I'd like a Git hook that pre-fills out "Version X.Y.Z" if making an annotated tag named `vX.Y.Z`. +* I'd like to make the zG command in Vim a bit more useful by maintaining + a per-file cache of added words, indexed by path, mapping it to 2zg or 3zg + rather like Steve Losh does. I wouldn't think it would be too hard; + 'spellfile' is a buffer-local option. -- cgit v1.2.3 From 49d6353df4f75213bc58fd2a1ac0dffc0a0f8048 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:02:55 +1200 Subject: Add a command prefix --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 8370ae31..f87f906a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -169,7 +169,7 @@ endif " and clear away any automatic command hooks already defined within it if it " does. This way, we don't end up collecting multiple copies of the hooks " configured in the rest of this file if it's reloaded. I don't want to make -" the augroup span the entire file, though. +" the :augroup span the entire file, though. " augroup vimrc autocmd! -- cgit v1.2.3 From 58450a02dd814483760f9921854e41c5870e12c8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:04:33 +1200 Subject: Correct a badly copy-pasted sentence --- vim/vimrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index f87f906a..95ca61ae 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1009,9 +1009,8 @@ endtry " 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. it kills 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. +" 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. -- cgit v1.2.3 From c0bab95ec716a6b68b11539c205623ed11d8c450 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:05:01 +1200 Subject: Add uncommented code for spellfile extension --- IDEAS.md | 4 ---- vim/vimrc | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/IDEAS.md b/IDEAS.md index 6e098377..7c42cc96 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -33,7 +33,3 @@ Ideas some point * I'd like a Git hook that pre-fills out "Version X.Y.Z" if making an annotated tag named `vX.Y.Z`. -* I'd like to make the zG command in Vim a bit more useful by maintaining - a per-file cache of added words, indexed by path, mapping it to 2zg or 3zg - rather like Steve Losh does. I wouldn't think it would be too hard; - 'spellfile' is a buffer-local option. diff --git a/vim/vimrc b/vim/vimrc index 95ca61ae..737b9fd6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -902,6 +902,28 @@ if $MYVIM !=# '' && $MYVIM !~# '[*?[|;&<>\r\n]' set thesaurus^=$MYVIM/ref/thesaurus.txt endif +EnsureDir $MYVIM/cache/spell + +let spellfile = join([ + \ substitute(v:lang, '_.*', '', ''), + \ &encoding + \ ], '.') . '.add' +execute 'set spellfile=$MYVIM/cache/spell/'.spellfile + +EnsureDir $MYVIM/cache/spell/local + +function! AddLocalSpellfile() abort + let spellfile = join([ + \ substitute(expand('%:p'), '[^0-9A-Za-z_.-]', '%', 'g'), + \ substitute(v:lang, '_.*', '', ''), + \ &encoding + \ ], '.') . '.add' + setlocal spellfile< + execute 'setlocal spellfile+=$MYVIM/cache/spell/local/'.spellfile +ndfunction! +autocmd vimrc BufRead * + \ call AddLocalSpellfile() | nnoremap zG 2zg + " Use all of the filetype detection, plugin, and indent support available. " I define my own filetype.vim and scripts.vim files for filetype detection, " in a similar but not identical form to the stock runtime files. I also -- cgit v1.2.3 From 1e75ff9b46748ec7fb8757efa233744cc8edb79d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:07:20 +1200 Subject: Move local spellfile out into ad-hoc plugin At some point I'll package this up properly as a little distribution, once I'm a bit more confident it's working correctly. So far, it's pretty neat. --- vim/plugin/spellfile_local.vim | 26 ++++++++++++++++++++++++++ vim/vimrc | 22 ---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 vim/plugin/spellfile_local.vim diff --git a/vim/plugin/spellfile_local.vim b/vim/plugin/spellfile_local.vim new file mode 100644 index 00000000..583df986 --- /dev/null +++ b/vim/plugin/spellfile_local.vim @@ -0,0 +1,26 @@ +if exists('loaded_spellfile_local') + finish +endif +let loaded_spellfile_local = 1 + +EnsureDir $MYVIM/cache/spell + +let spellfile = join([ + \ substitute(v:lang, '_.*', '', ''), + \ &encoding + \ ], '.') . '.add' +execute 'set spellfile=$MYVIM/cache/spell/'.spellfile + +EnsureDir $MYVIM/cache/spell/local + +function! AddLocalSpellfile() abort + let spellfile = join([ + \ substitute(expand('%:p'), '[^0-9A-Za-z_.-]', '%', 'g'), + \ substitute(v:lang, '_.*', '', ''), + \ &encoding + \ ], '.') . '.add' + setlocal spellfile< + execute 'setlocal spellfile+=$MYVIM/cache/spell/local/'.spellfile +endfunction! +autocmd vimrc BufRead * + \ call AddLocalSpellfile() | nnoremap zG 2zg diff --git a/vim/vimrc b/vim/vimrc index 737b9fd6..95ca61ae 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -902,28 +902,6 @@ if $MYVIM !=# '' && $MYVIM !~# '[*?[|;&<>\r\n]' set thesaurus^=$MYVIM/ref/thesaurus.txt endif -EnsureDir $MYVIM/cache/spell - -let spellfile = join([ - \ substitute(v:lang, '_.*', '', ''), - \ &encoding - \ ], '.') . '.add' -execute 'set spellfile=$MYVIM/cache/spell/'.spellfile - -EnsureDir $MYVIM/cache/spell/local - -function! AddLocalSpellfile() abort - let spellfile = join([ - \ substitute(expand('%:p'), '[^0-9A-Za-z_.-]', '%', 'g'), - \ substitute(v:lang, '_.*', '', ''), - \ &encoding - \ ], '.') . '.add' - setlocal spellfile< - execute 'setlocal spellfile+=$MYVIM/cache/spell/local/'.spellfile -ndfunction! -autocmd vimrc BufRead * - \ call AddLocalSpellfile() | nnoremap zG 2zg - " Use all of the filetype detection, plugin, and indent support available. " I define my own filetype.vim and scripts.vim files for filetype detection, " in a similar but not identical form to the stock runtime files. I also -- cgit v1.2.3 From ddb386911424bb3e853ac340c4600d3c39f0d591 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:08:19 +1200 Subject: Add an idea about spell files --- IDEAS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IDEAS.md b/IDEAS.md index 7c42cc96..3d25a512 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -33,3 +33,5 @@ Ideas some point * I'd like a Git hook that pre-fills out "Version X.Y.Z" if making an annotated tag named `vX.Y.Z`. +* Per-filetype spelling dictionaries might be a good idea, e.g. writing all the + valid :commands and 'options' for Vim script into a file for ft=vim. -- cgit v1.2.3 From 335a56384412704b3409e99466af4521c4aa53c9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Jun 2019 14:08:30 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 3658643d..83f4807f 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v5.30.0 -Sun Jun 9 22:22:15 UTC 2019 +tejr dotfiles v5.31.0 +Mon Jun 10 02:08:30 UTC 2019 -- cgit v1.2.3