7 Commits
v1.0 ... v1.1

Author SHA1 Message Date
Reed Esau
86ab7f3d5b Misc formatting 2015-05-06 01:50:14 -06:00
Reed Esau
7d90faf657 Merge pull request #13 from Konfekt/patch-1
suggest convenient map to cycle through displayed list of dics
2015-05-06 01:33:35 -06:00
Reed Esau
324e08d11d Merge pull request #15 from sunaku/SpellRare
highlight wordy with SpellLocal or SpellRare, for neovim (where it's supported)
2015-05-06 01:24:36 -06:00
Suraj N. Kurapati
bc6b75ad9a use tempname() for portability; map(), docs, style
Use tempname() for portably obtaining a temporary filename.

Use map() instead of a for-loop.

Add comment explaining the purpose of the newly added code.

Add l: prefix to keep coding style in-line with rest of code.
2015-04-26 19:58:31 -07:00
Jakson Alves de Aquino
03680e115b mark words dynamically: don't need 2 sets of dicts
The dic file is read in a list, a new list is created with
the "!" replaced with "?", the new list is saved in a temporary
file, which is used as the dic file. Finally, after used, the
temporary file is deleted.
2015-04-26 19:44:55 -07:00
Suraj N. Kurapati
210dd1077d GH-15: flag words as rare instead of bad in NeoVim
This change marks all words in all dictionaries as rare words so that
NeoVim highlights them as SpellRare instead of SpellBad.  This lets you
distinguish between wordy writing and normal misspellings, respectively.

In order for this to work, your NeoVim needs to be patched as follows:

  https://github.com/neovim/neovim/pull/2456

  https://groups.google.com/forum/#!topic/vim_dev/rPWOoR3ZgSA

See `:help spell-wordlist-format` for details about dictionary markings.
2015-04-26 17:43:29 -07:00
Konfekt
71b1365e2a suggest convenient map to cycle through list of dics 2015-02-20 22:20:42 +01:00
2 changed files with 27 additions and 13 deletions

View File

@@ -81,7 +81,7 @@ least until _wordy_ feels the urge to build again.
Define your own ring of dictionaries, overriding the default one in your
`.vimrc`:
```
```vim
let g:wordy#ring = [
\ 'weak',
\ ['being', 'passive-voice', ],
@@ -97,7 +97,7 @@ let g:wordy#ring = [
You can navigate the ring with the following commands:
```
```vim
:NextWordy
:PrevWordy
```
@@ -105,23 +105,30 @@ You can navigate the ring with the following commands:
Optionally map a key in your `.vimrc` to rapidly cycle through the
ring's dictionaries:
```
```vim
nnoremap <silent> K :NextWordy<cr>
```
**NEW** - You can browse through a flattened list of dictionaries
You can browse through a flattened list of dictionaries
specified in your ring with:
```
```vim
:Wordy <tab>
```
and optionally map a key such as `\w` in your `.vimrc` to it by
```vim
if !&wildcharm | set wildcharm=<C-z> | endif
execute 'nnoremap <leader>w :Wordy<space>'.nr2char(&wildcharm)
```
## Using _wordy_
Youll use the commands that follow to enable _wordy_. To disable it and
restore your previous spell environment, enter the command:
```
```vim
:NoWordy
```
@@ -133,7 +140,7 @@ go to those words flagged by _wordy_.
### Weak and lazy usage
```
```vim
:Wordy weak
```
@@ -161,7 +168,7 @@ asking whether it detracts from the point you are trying to make.
### Redundant and problematic usage
```
```vim
:Wordy redundant
:Wordy problematic
```
@@ -186,7 +193,7 @@ targeted by _problematic_.
> _self-actualization_ reflect his _dynamic_ and _transformative_
> personality.” (puffery and jargon)
```
```vim
:Wordy puffery
:Wordy business-jargon
:Wordy art-jargon
@@ -200,7 +207,7 @@ Instead of puffery, demonstrate through details.
### Manipulative language
```
```vim
:Wordy weasel
```
@@ -217,7 +224,7 @@ will seek to purge such loaded language from your writing.
### To be and the passive voice
```
```vim
:Wordy being
:Wordy passive-voice
```
@@ -227,7 +234,7 @@ of the verb to be, often found in overly-passive sentences.
### Colloquialisms, Idioms, and Similies
```
```vim
:Wordy colloquial
:Wordy idiomatic
:Wordy similies
@@ -238,7 +245,7 @@ idiomatic phrases scraped from Wiktionary and Wikipedia.
### Miscellaneous
```
```vim
:Wordy said-synonyms
:Wordy opinion
:Wordy contractions

View File

@@ -33,6 +33,13 @@ function! wordy#init(...) abort
let l:data_dir = g:wordy_dir . '/data'
let l:src_path = l:data_dir . '/' . l:lang . '/' . l:dict . '.dic'
if filereadable(l:src_path)
if has('nvim')
" Dynamically convert SpellBad words into SpellRare words under NeoVim.
" See issue 15 for details: https://github.com/reedes/vim-wordy/pull/15
let l:rare_dic = map(readfile(l:src_path), "substitute(v:val, '!$', '?', '')")
let l:src_path = tempname()
call writefile(l:rare_dic, l:src_path)
endif
let l:spell_dir = g:wordy_dir . '/spell'
if !isdirectory(l:spell_dir)
call mkdir(expand(l:spell_dir), "p")