File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Features of this plugin:
7
7
* Specify the languages to be used in spell-check
8
8
* Specify a list of thesauruses for synonym completion
9
9
* Specify a list of dictionaries for word completion
10
+ * Specify a list of spellfiles for custom word-check additions
10
11
* Opt-in key mappings for _ Normal_ mode thesaurus and dictionary completion
11
12
* Buffer-scoped configuration (leaves your global settings alone)
12
13
@@ -101,6 +102,17 @@ let g:lexical#dictionary = ['/usr/share/dict/words',]
101
102
102
103
You can specify multiple paths to dictionaries in the list.
103
104
105
+
106
+ ### Spellfile configuration
107
+ On Unix-based systems (including OS X) the spellfile will default to:
108
+
109
+ ``` vim
110
+ let g:lexical#dictionary = ['~/.vim/spell/en.utf-8.add',]
111
+ ```
112
+
113
+ You can specify a single path for spellfile in the list.
114
+
115
+
104
116
## Commands
105
117
106
118
Vim offers many standard key mappings for spell-checking and completion.
@@ -189,6 +201,7 @@ command -nargs=0 LexMed call lexical#init({
189
201
\ 'thesaurus': ['~/.vim/dictionary/medical_synonyms.txt',
190
202
\ '~/.vim/thesaurus/mthesaur.txt',
191
203
\ ],
204
+ \ 'spellfile': ['~/.vim/spell/en.add'],
192
205
\ })
193
206
```
194
207
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ function! lexical#init(...) abort
23
23
let l: spelllang_list = get (l: args , ' spelllang' , g: lexical #spelllang )
24
24
execute ' setlocal spelllang=' . join (l: spelllang_list , ' ,' )
25
25
26
+ let l: spellfile_list = get (l: args , ' spellfile' , g: lexical #spellfile )
27
+ execute ' setlocal spellfile=' . join (l: spellfile_list , ' ,' )
28
+
26
29
let l: thesaurus_list = get (l: args , ' thesaurus' , g: lexical #thesaurus )
27
30
execute ' setlocal thesaurus=' . join (l: thesaurus_list , ' ,' )
28
31
if len (&thesaurus ) > 0
Original file line number Diff line number Diff line change @@ -61,6 +61,25 @@ if !exists('g:lexical#dictionary')
61
61
unlet dict_list
62
62
endif
63
63
64
+ if ! exists (' g:lexical#spellfile' )
65
+ " build on globally-defined spellfile, if any
66
+ let spellfile_list = split (&spellfile , ' ,' )
67
+ if len (spellfile_list) > 0
68
+ " use the globally-defined spellfile
69
+ let g: lexical #spellfile = spellfile_list
70
+ else
71
+ " attempt to discover a dictionary
72
+ let spellfile_path = ' ~/.vim/spell/en.utf-8.add'
73
+ let g: lexical #spellfile = [
74
+ \ has (' unix' ) && filereadable (spellfile_path)
75
+ \ ? spellfile_path
76
+ \ : ' '
77
+ \ ]
78
+ unlet spellfile_path
79
+ endif
80
+ unlet spellfile_list
81
+ endif
82
+
64
83
if ! exists (' g:lexical#spell_key' )
65
84
let g: lexical #spell_key = ' '
66
85
endif
70
89
if ! exists (' g:lexical#dictionary_key' )
71
90
let g: lexical #dictionary_key = ' '
72
91
endif
92
+ if ! exists (' g:lexical#spellfile_key' )
93
+ let g: lexical #spellfile_key = ' '
94
+ endif
73
95
74
96
let &cpo = s: save_cpo
75
97
unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments