diff options
-rw-r--r-- | IDEAS.md | 2 | ||||
-rw-r--r-- | ISSUES.md | 2 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | vim/plugin/spellfile_local.vim | 26 | ||||
-rw-r--r-- | vim/vimrc | 13 |
5 files changed, 39 insertions, 8 deletions
@@ -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. @@ -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. @@ -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 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 <buffer> zG 2zg @@ -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! @@ -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 @@ -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. @@ -1031,7 +1030,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 |