From 4e097f5552731229cbda3ed7b55004b56c2b84f4 Mon Sep 17 00:00:00 2001 From: Robin Palotai Date: Mon, 19 Aug 2019 15:00:09 +0200 Subject: [PATCH] Make cached spelling file directory configurable. Introduces the `g:wordy_spell_dir` variable. This is useful with `nixpkgs` or other distros where plugins are installed into unwritable locations. --- README.markdown | 8 ++++++++ autoload/wordy.vim | 2 +- plugin/wordy.vim | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 2f480e5..1afe307 100644 --- a/README.markdown +++ b/README.markdown @@ -283,6 +283,14 @@ instances of “’s”, such as “Joe’s not here.” And finally, `vague-time` finds where you are using vague descriptions of time where you could be more specific. +## Configuration + +Change where `vim-wordy` stores cached spelling files using: + +``` +let g:wordy_spell_dir = '/home/my-user/wordy' +``` + ## See also * [danielbmarques/vim-ditto][vd] - new plugin to highlight repeated words diff --git a/autoload/wordy.vim b/autoload/wordy.vim index 8769946..c3630f2 100644 --- a/autoload/wordy.vim +++ b/autoload/wordy.vim @@ -45,7 +45,7 @@ function! wordy#init(...) abort let l:src_path = l:rare_path endif - let l:spell_dir = g:wordy_dir . '/spell' + let l:spell_dir = g:wordy_spell_dir . '/spell' if !isdirectory(l:spell_dir) call mkdir(expand(l:spell_dir), "p") endif diff --git a/plugin/wordy.vim b/plugin/wordy.vim index 3939f08..af130ab 100644 --- a/plugin/wordy.vim +++ b/plugin/wordy.vim @@ -16,6 +16,10 @@ set cpo&vim " need directory to manage spell files let g:wordy_dir = fnamemodify(resolve(expand(':p')), ':h:h') +if !exists('g:wordy_spell_dir') + let g:wordy_spell_dir = g:wordy_dir +endif + command -nargs=0 NoWordy call wordy#init({}) command -nargs=0 NextWordy call wordy#jump(1)