22 Commits
v1.0 ... master

Author SHA1 Message Date
Peter Aronoff
590927f572 Update links to point to preservim 2022-02-13 07:37:47 -05:00
Caleb Maclennan
667426a017 Merge pull request #34 from robinp/master
Make cached spelling file directory configurable.
2020-10-24 12:56:51 +03:00
Reed Es
f0391713fa Added reference to new vim-wordchipper plugin 2019-11-22 00:23:24 -07:00
Reed Es
87a77cb293 Merge pull request #35 from bcl/master-spelllang
Set spelllang correctly
2019-08-29 12:16:25 -06:00
Brian C. Lane
e80520718d Set spelllang correctly
Full paths are not allowed in spelllang, only the lang names.

In the ./spell/ directory the files are named using the 'lang' which in
the case of wordy is the dict name.

This patch drops the actual lang from the .spl path, and only passes
the dict names to spelllang.

NOTE: I am not a vimscript expert, this solution works for me when
loading vim-wordy using pathogen. Closes issue #33
2019-08-25 10:39:02 -07:00
Robin Palotai
4e097f5552 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.
2019-08-19 15:00:09 +02:00
Reed Es
14b9dbf76a Merge pull request #28 from rndnoise/pr-19
Fix excessive regeneration of spelling dictionaries
2018-03-10 16:42:36 -07:00
rndnoise
aa66dfff91 Fix excessive regeneration of spelling dictionaries 2018-03-08 13:32:05 -06:00
Reed Esau
bd37684a04 Support lists of adjectives and adverbs #24 2016-11-07 17:41:36 -07:00
Reed Esau
a4dd6fdb05 Added mention of new danielbmarques/vim-ditto plugin 2016-07-30 19:07:58 -06:00
Reed Esau
ae7470797b Merge branch 'master' of https://github.com/reedes/vim-wordy 2015-09-05 13:19:22 -06:00
Reed Esau
6b37d5a8c9 Merge pull request #18 from michaelx386/issue-9
Replace deprecated commands in demo gif; fixes #9
2015-09-05 12:47:13 -06:00
michaelx386
5a8a149b3c Replace deprecated commands in demo gif; fixes #9 2015-08-29 20:48:28 +01:00
Reed Esau
05dd76aeeb Merge branch 'master' of https://github.com/reedes/vim-wordy 2015-05-09 01:24:47 -06:00
Reed Esau
86ab7f3d5b Misc formatting 2015-05-06 01:50:14 -06:00
Reed Esau
2d840bb5fe Minor updates 2015-05-06 01:37:08 -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
5 changed files with 7575 additions and 41 deletions

View File

@@ -5,7 +5,7 @@
<br/>
- - -
![demo](http://i.imgur.com/DzfjEh4.gif)
![demo](https://i.imgur.com/cXDCwdE.gif)
- - -
## Features of the _wordy_ plugin
@@ -16,6 +16,7 @@
* Buffer-scoped configuration (leaves your global settings alone)
* Unicode-friendly, including support for typographic quotes
* User-configurable ring of dictionaries
* *NEW* adjectives and adverbs, to help you detect overuse
## What is _wordy_?
@@ -42,8 +43,8 @@ be missed. To compensate for _wordy_s bare-bones approach, its best used
in concert with the [literature on usage][lit] (Strunk and White, e.g.)
and websites like the [English Language & Usage Stack Exchange][ese].
[lit]: http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=English+Usage
[ese]: http://english.stackexchange.com
[lit]: https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=English+Usage
[ese]: https://english.stackexchange.com
## Requirements
@@ -51,8 +52,15 @@ _wordy_ may require a recent version of Vim.
## Installation
Best installed using Pathogen, Vundle, Neobundle, or your favorite Vim
package manager.
You can install using your favorite Vim package manager. (E.g.,
[Pathogen][pathogen], [Vundle][vundle], or [Plug][plug].) If you are using
a recent version of vim or neovim, you can also use native package
support. (See [:help packages][packages].)
[pathogen]: https://github.com/tpope/vim-pathogen
[vundle]: https://github.com/VundleVim/Vundle.vim
[plug]: https://github.com/junegunn/vim-plug
[packages]: https://vimhelp.org/repeat.txt.html#packages
## Configuration
@@ -81,7 +89,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', ],
@@ -92,12 +100,14 @@ let g:wordy#ring = [
\ ['colloquial', 'idiomatic', 'similies', ],
\ 'art-jargon',
\ ['contractions', 'opinion', 'vague-time', 'said-synonyms', ],
\ 'adjectives',
\ 'adverbs',
\ ]
```
You can navigate the ring with the following commands:
```
```vim
:NextWordy
:PrevWordy
```
@@ -105,23 +115,32 @@ You can navigate the ring with the following commands:
Optionally map a key in your `.vimrc` to rapidly cycle through the
ring's dictionaries:
```
nnoremap <silent> K :NextWordy<cr>
```vim
noremap <silent> <F8> :<C-u>NextWordy<cr>
xnoremap <silent> <F8> :<C-u>NextWordy<cr>
inoremap <silent> <F8> <C-o>: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 +152,7 @@ go to those words flagged by _wordy_.
### Weak and lazy usage
```
```vim
:Wordy weak
```
@@ -161,7 +180,7 @@ asking whether it detracts from the point you are trying to make.
### Redundant and problematic usage
```
```vim
:Wordy redundant
:Wordy problematic
```
@@ -178,7 +197,7 @@ will simply protest.
See [50 Problem Words and Phrases][1] for more detail on those issues
targeted by _problematic_.
[1]: http://www.dailywritingtips.com/50-problem-words-and-phrases/
[1]: https://www.dailywritingtips.com/50-problem-words-and-phrases/
### Puffery and Jargon
@@ -186,7 +205,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 +219,7 @@ Instead of puffery, demonstrate through details.
### Manipulative language
```
```vim
:Wordy weasel
```
@@ -217,7 +236,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 +246,7 @@ of the verb to be, often found in overly-passive sentences.
### Colloquialisms, Idioms, and Similies
```
```vim
:Wordy colloquial
:Wordy idiomatic
:Wordy similies
@@ -236,9 +255,18 @@ of the verb to be, often found in overly-passive sentences.
Dictionaries for uncovering the tired cliché, including colloquial and
idiomatic phrases scraped from Wiktionary and Wikipedia.
### Adjectives and Adverbs
```vim
:Wordy adjectives
:Wordy adverbs
```
Dictionaries to help you detect the overuse of modifiers.
### Miscellaneous
```
```vim
:Wordy said-synonyms
:Wordy opinion
:Wordy contractions
@@ -257,35 +285,45 @@ instances of “s”, such as “Joes 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
[Words To Avoid in Creative Writing][wa] - a brief guide to usage by writer Cary Morton
* [danielbmarques/vim-ditto][vd] - new plugin to highlight repeated words
* [Words To Avoid in Creative Writing][wa] - a brief guide to usage by writer Cary Morton
[wa]: http://darlingmionette.deviantart.com/art/Words-To-Avoid-152886782
[vd]: https://github.com/danielbmarques/vim-ditto
[wa]: https://darlingmionette.deviantart.com/art/Words-To-Avoid-152886782
If you find this plugin useful, you may want to check out these others by
[@reedes][re]:
If you find this plugin useful, you may want to check out these others
originally by [@reedes][re]:
* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer
* [vim-lexical][lx] - building on Vims spell-check and thesaurus/dictionary completion
* [vim-litecorrect][lc] - lightweight auto-correction for Vim
* [vim-one][vo] - make use of Vims _+clientserver_ capabilities
* [vim-pencil][pn] - rethinking Vim as a tool for writers
* [vim-textobj-quote][qu] - extends Vim to support typographic (curly) quotes
* [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command
* [vim-thematic][th] - modify Vims appearance to suit your task and environment
* [vim-wheel][wh] - screen-anchored cursor movement for Vim
* [vim-wordchipper][wc] - power tool for shredding text in Insert mode
[re]: https://github.com/reedes
[cp]: http://github.com/reedes/vim-colors-pencil
[lx]: http://github.com/reedes/vim-lexical
[lc]: http://github.com/reedes/vim-litecorrect
[vo]: http://github.com/reedes/vim-one
[pn]: http://github.com/reedes/vim-pencil
[ts]: http://github.com/reedes/vim-textobj-sentence
[qu]: http://github.com/reedes/vim-textobj-quote
[th]: http://github.com/reedes/vim-thematic
[wh]: http://github.com/reedes/vim-wheel
[cp]: https://github.com/preservim/vim-colors-pencil
[lx]: https://github.com/preservim/vim-lexical
[lc]: https://github.com/preservim/vim-litecorrect
[pn]: https://github.com/preservim/vim-pencil
[ts]: https://github.com/preservim/vim-textobj-sentence
[qu]: https://github.com/preservim/vim-textobj-quote
[th]: https://github.com/preservim/vim-thematic
[wh]: https://github.com/preservim/vim-wheel
[wc]: https://github.com/preservim/vim-wordchipper
## Future development
@@ -294,7 +332,9 @@ Support for other languages will be added if theres interest. (Hint: pull
requests!)
_wordy_ is a work in progress. If youve spotted a problem or have an idea
on improving this plugin, please post it to the github project issue page.
Contributions are welcome.
on improving this plugin, please post it to the [GitHub project issue
page][issues]. Contributions are welcome.
[issues]: https://github.com/preservim/vim-wordy/issues
<!-- vim: set tw=74 :-->

View File

@@ -1,7 +1,7 @@
" ============================================================================
" File: autoload/wordy.vim
" Description: autoload script for vim-wordy plugin
" Maintainer: Reed Esau <github.com/reedes>
" Maintainer: preservim <https://github.com/preservim>
" Last Change: January 14, 2014
" License: The MIT License (MIT)
" ============================================================================
@@ -33,11 +33,24 @@ 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)
let l:spell_dir = g:wordy_dir . '/spell'
if has('nvim')
let l:rare_path = l:src_path . '.rare'
if !filereadable(l:rare_path) ||
\ getftime(l:rare_path) < getftime(l:src_path)
" 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, '!$', '?', '')")
call writefile(l:rare_dic, l:rare_path)
endif
let l:src_path = l:rare_path
endif
let l:spell_dir = g:wordy_spell_dir . '/spell'
if !isdirectory(l:spell_dir)
call mkdir(expand(l:spell_dir), "p")
endif
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:lang . '.' . l:encoding . '.spl'
" The dict name is the 'language' part of the filename
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:encoding . '.spl'
if get(l:args, 'force', 0) ||
\ !filereadable(l:dst_path) ||
\ getftime(l:dst_path) < getftime(l:src_path)
@@ -57,7 +70,9 @@ function! wordy#init(...) abort
let l:prefix = 'wordy: '
if len(l:dst_paths) > 0
let b:original_spl = &spelllang
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
" vim looks up the files in the ./spell/ directory using spell-load (see
" the vim docs) so full paths are not allowed.
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dicts, ',')
setlocal spell
" the magic numbers derived empirically with MacVim

3383
data/en/adjectives.dic Normal file

File diff suppressed because it is too large Load Diff

4090
data/en/adverbs.dic Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
" =============================================================================
" File: plugin/wordy.vim
" Description: Usage support for the Vim text editor
" Maintainer: Reed Esau <github.com/reedes>
" Maintainer: preservim <https://github.com/preservim>
" Last Change: January 14, 2014
" License: The MIT License (MIT)
" =============================================================================
@@ -16,6 +16,10 @@ set cpo&vim
" need directory to manage spell files
let g:wordy_dir = fnamemodify(resolve(expand('<sfile>: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)
@@ -35,6 +39,8 @@ if !exists('g:wordy#ring')
\ ['colloquial', 'idiomatic', 'similies', ],
\ 'art-jargon',
\ ['contractions', 'opinion', 'vague-time', 'said-synonyms', ],
\ 'adjectives',
\ 'adverbs',
\ ]
endif