Coder Social home page Coder Social logo

vim-wordy's Introduction

vim-wordy

Uncover usage problems in your writing



demo


Features of the wordy plugin

  • Pure Vimscript; no external services or libraries needed
  • Uses Vim’s native spell-check engine
  • Includes 16 dictionaries covering different types of word usage
  • 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?

wordy is not a grammar checker. Nor is it a guide to proper word usage. Rather, wordy is a lightweight tool to assist you in identifying those words and phrases known for their history of misuse, abuse, and overuse, at least according to usage experts.

For example, if wordy highlights moreover in your document, a word for which no good usage exists, you should consider a rewrite to eliminate it. But if wordy highlights therefore in a sentence where you can demonstrate the usage is sound, you can elect to keep it —wordy be damned.

Why wordy?

Off-the-shelf proofreading software can scan your text for potential problems and provide comprehensive feedback. However, it may require a complex software installation or transmission of your work to a remote server for checking.

wordy stands ready as a simple alternative to these comprehensive tools, focusing narrowly on identifying potential problems that might otherwise be missed. To compensate for wordy’s bare-bones approach, it’s best used in concert with the literature on usage (Strunk and White, e.g.) and websites like the English Language & Usage Stack Exchange.

Requirements

wordy may require a recent version of Vim.

Installation

You can install using your favorite Vim package manager. (E.g., Pathogen, Vundle, or Plug.) If you are using a recent version of vim or neovim, you can also use native package support. (See :help packages.)

Configuration

On demand

Using this plugin’s commands does not require any special configuration.

Important note: on the first use of each of the plugin’s dictionaries, a spell file will be built. This produces a message that resembles:

Reading word file /Users/reede/.vim/bundle/vim-wordy/data/en/weasel.dic ...
Compressing word tree...
Compressed 618 of 1738 nodes; 1120 (64%) remaining
Writing spell file /Users/reede/.vim/bundle/vim-wordy/spell/weasel.en.utf-8.spl ...
Done!
Estimated runtime memory use: 5600 bytes
Press ENTER or type command to continue

As instructed, press the enter key and it will disturb you no longer, at least until wordy feels the urge to build again.

Ring navigation

Define your own ring of dictionaries, overriding the default one in your .vimrc:

let g:wordy#ring = [
  \ 'weak',
  \ ['being', 'passive-voice', ],
  \ 'business-jargon',
  \ 'weasel',
  \ 'puffery',
  \ ['problematic', 'redundant', ],
  \ ['colloquial', 'idiomatic', 'similies', ],
  \ 'art-jargon',
  \ ['contractions', 'opinion', 'vague-time', 'said-synonyms', ],
  \ 'adjectives',
  \ 'adverbs',
  \ ]

You can navigate the ring with the following commands:

:NextWordy
:PrevWordy

Optionally map a key in your .vimrc to rapidly cycle through the ring's dictionaries:

noremap <silent> <F8> :<C-u>NextWordy<cr>
xnoremap <silent> <F8> :<C-u>NextWordy<cr>
inoremap <silent> <F8> <C-o>:NextWordy<cr>

You can browse through a flattened list of dictionaries specified in your ring with:

:Wordy <tab>

and optionally map a key such as \w in your .vimrc to it by

if !&wildcharm | set wildcharm=<C-z> | endif
execute 'nnoremap <leader>w :Wordy<space>'.nr2char(&wildcharm)

Using wordy

You’ll use the commands that follow to enable wordy. To disable it and restore your previous spell environment, enter the command:

:NoWordy

Use Vim’s Normal mode commands for navigating misspelled words to go to those words flagged by wordy.

  • ]s - Move to next misspelled word after the cursor.
  • [s - Like ]s but search backwards

Weak and lazy usage

:Wordy weak

Weak and lazy words are common in first drafts.

We sabotage our writing though weak language, kicking the legs out from beneath our verbs and tearing at the foundations of our nouns, watering down the very points that we are trying to drive home.

  • “I got up at precisely 8 AM.” (weak)
  • “I woke up at precisely 8 AM.” (better)

We diminish the weight of our ideas by adding modifiers and fillers.

  • “That night was perhaps the most important moment of my life, and I don't think I'll ever forget it.” (weak)
  • “That night was the most important moment of my life, and I'll never forget it.” (better)

Words can also be weakened through overuse.

  • “He actually drove to work in the blizzard.” (weak)
  • “He drove to work in spite of the blizzard.” (better)

When using this dictionary, scrutinize each highlighted word or phrase, asking whether it detracts from the point you are trying to make.

Redundant and problematic usage

:Wordy redundant
:Wordy problematic

Did you ever receive an ‘advance warning’ when a mere warning would do? Why plan when you can ‘plan ahead’? Why need a thought to ‘occur to you’ when the thought can merely ‘occur’?

But redundancies may not actually be redundant: ‘invited guests’ may not if some of the guests have crashed your event. Or dialect differences can erase redundancies, as the British will ‘protest against’ where Americans will simply ‘protest’.

See 50 Problem Words and Phrases for more detail on those issues targeted by problematic.

Puffery and Jargon

“The man embodies authenticity; his disruptive ideas on self-actualization reflect his dynamic and transformative personality.” (puffery and jargon)

:Wordy puffery
:Wordy business-jargon
:Wordy art-jargon

Instead of puffery, demonstrate through details.

  • “The Empire State Building is breathtakingly tall.” (puffery)
  • “My ears popped several times during the rapid ascent to the 80th floor.” (better)

Manipulative language

:Wordy weasel

Words can be used to hide or obscure a weak position, or to cast doubt on a strong one. They can be used to mislead, to evade blame, or to claim credit where none has been earned.

  • “mistakes were made”
  • “discounted up to 50% off”
  • “most voters feel that my opponent can’t be trusted”

Assuming that you’re not intentionally trying to manipulate others, you will seek to purge such loaded language from your writing.

To be and the passive voice

:Wordy being
:Wordy passive-voice

You may find this dictionary useful in avoiding overuse of the many forms of the verb to be, often found in overly-passive sentences.

Colloquialisms, Idioms, and Similies

:Wordy colloquial
:Wordy idiomatic
:Wordy similies

Dictionaries for uncovering the tired cliché, including colloquial and idiomatic phrases scraped from Wiktionary and Wikipedia.

Adjectives and Adverbs

:Wordy adjectives
:Wordy adverbs

Dictionaries to help you detect the overuse of modifiers.

Miscellaneous

:Wordy said-synonyms
:Wordy opinion
:Wordy contractions
:Wordy vague-time

A few dictionaries to serve specific needs.

If you’re writing to be neutral, you will want to avoid editorializing (opinion) and loaded use of ‘said’ (said-synonyms).

If you’re writing formally, you’ll want to identify unintentional contractions with contractions. A warning that it’s not yet capturing most 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

If you find this plugin useful, you may want to check out these others originally by @reedes:

Future development

This early version targets English usage issues and utf-8 encoding. Support for other languages will be added if there’s interest. (Hint: pull requests!)

wordy is a work in progress. If you’ve spotted a problem or have an idea on improving this plugin, please post it to the GitHub project issue page. Contributions are welcome.

vim-wordy's People

Contributors

alerque avatar bcl avatar devlinmallory avatar jalvesaq avatar konfekt avatar reedes avatar rndnoise avatar robinp avatar sunaku avatar telemachus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-wordy's Issues

How to add new rules of dictionary?

In the issue Support for TeX/LaTeX files , I find that the actually work/function I need to do is add an new rules of dictionary for scientific writing, for e.g., I would like to add the ten rules mentioned here. I try to create a sciwrt.dic as follows:

#https://www.scribendi.com/advice/academic_phrases_your_writing_doesnt_need.en.html
/encoding=utf-8
On the other hand/!
In order to/!
Indeed/!
However\|moreover\|furthermore/!
As well as/!
For a short\|long period of time/!
By using/!
Due to the fact that/!
In relation to/!
In the event that/!

My questions are:

  1. How to make this file work with the command Wordy sciwrt?
  2. I want the rule works with ignoring the capital letter, which means, On the other hand/! will also mark on the other hand as a possible improvement.
  3. Can I use the regular expression in the rule? such asHowever\|moreover\|furthermore/! will find However, moreover and furthermore in a single rule. Otherwise, I need to split it into three independent one.
  4. Can I provide some suggestion for the word? I mean, if we use ]s to jump to a new suggestion, then can we use z= or something to give some suggestion/explanation of this improvement?

Error: Can't open file for writing

vim-wordy is installed with Home Manager on NixOS. When I try to run :Wordy weak, I get error:

Error detected while processing function wordy#init:
line   31:
E482: Can't open file /nix/store/bk3lvr06rv7nvwpiza59gf6vfia39fp9-vimplugin-vim-wordy-2019-11-22/share/vim-plugins/vim-wordy/data/en/weak.dic.rare for writing: read-only file system

I understand why this error is happening. The Nix store is indeed a read-only file system. However, does vim-wordy need to open its dictionaries for writing? Is it possible to avoid this error by opening these dictionaries read-only?

Wordy doesn't work; invalid argument spelllang=en,/.....

When I type :Wordy redundant or basically any wordy command I get something like the following (except maybe I don't get the rebuild):

Reading word file /home/curtis/.vim/plugged/vim-wordy/data/en/redundant.dic...                                          
Compressing word tree...
Compressed 1190 of 3937 nodes; 2747 (69%) remaining
Writing spell file /home/curtis/.vim/plugged/vim-wordy/spell/redundant.en.utf-8.spl...
Done!
Estimated runtime memory use: 13735 bytes
Error detected while processing function wordy#init:
line   60:
E474: Invalid argument: spelllang=en,/home/curtis/.vim/plugged/vim-wordy/spell/redundant.en.utf-8.spl
Press ENTER or type command to continue

Support for TeX/LaTeX files

I use wordy to improve my scientific writing --- typically, I use the TeX for typesetting mathematical paper, which includes TeX code for mathematical formulas, e.g.

Suppose $a$, $b$ and $c$ are the length of the three sides of a triangle, then 
$$
a+b>c.
$$

where $a$ and so on are called inline formulas, and code with the double dollars are called display formulas, you can find the sample example on the above wiki page.

The problem is that, it seems wordy can't recognize the TeX code as mathematical formula. I learnt from languagetools that we can replace these formula with a single letter X, then the grammar checking works. I hope there will be some ability to process TeX file.


UPDATE

I checked the source code of vim-wordy, it seems has nothing to do with the mathematical formulas, the tex code in my example will mark are and then as weak words, which is defined in the weak.dic, so maybe I should change my problem to a new issue, how to add new rules of dictionary?

Remove “the” from the weak list

Given that it is the only definite article the English language has, I find it an odd choice to see that on the weak list. In the referenced material, “the” is also not listed as a weak word.

Show suggestions

Thank you for making vim-wordy.

Would it be possible to display suggestions in tooltips and allow auto-completion (eg :h ins-completion) ?
It is often difficult for non-native english speakers to figure out a better way to formulate a sentence. Such a feature would be greatly appreciated.

Conjugation checks

Hi @reedes,

I'm worried that this project is dead considering the lack of support with #31, but hopefully, that's not the case.
I was wondering if we could get highlights for words wrongly conjugated. Eg "This was overrode" should highlight "overrode" because the "was" before expects the past participle "overriden" instead.
I use Grammarly as a Chrome plugin, and it properly detects this issue

Currently, Wordy doesn't detect this kind of errors. Do you have a suggestion, or know another plugin that handles it?

Alternatives in other programs

I've used vim-wordy in neovim, and I found it to be exceptional. However, I have since moved to Spacemacs (an emacs configuration set up to be similar to vim, but more extensible and with more features set up by default). I can't (haven't found) any similar usage analyzers for emacs, or any other programs. As well, I would like to recommend to some friends who don't know about things like vim a writing analyzer which will work with Microsoft Word and similar word processors. Do you know of anything?

Dictionary not being generated

I'm on OS X 10.10.5 using vim version 7.3.

I get this error when I try to run something like :Wordy weak:

Error detected while processing function wordy#init:                                    
line   40:                                                                              
E755: Invalid region in (Personal)/dotfiles/vim/bundle/vim-wordy/spell/weak.en.utf-8.spl

Looking at my file system the spell dir is empty. I assume that means wordy didn't generate the dictionaries for me.

Full vim version:

~/Dropbox (Personal)/projects/commerce $ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul  9 2015 23:58:42)
Compiled by [email protected]
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path 
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv 
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent 
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse 
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype 
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn 
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs 
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

Feature request: highlight words that occur with an unusual frequency

In my writing, one bad behavior I have is to use the same word or phrase over and over. Often I don't even realize I'm doing it. It would be nice to have a Wordy feature that looked for words or phrases being used an excessive number of time in comparison to the overall document length, excluding of course small connector words.

I know this is someone of a vague suggestion and would need to be hammered down, but it would be extremely useful to me.

Highlight colour

Is there a possible configuration option to make the Wordy word highlighted in a different colour from misspelled words, it would be nice to distinguish between them. I think it might be using the misspell highlight group currently as even when I change the spell highlight colour the Wordy words become the same.

Conversion failure when creating word file

OS: Windows 10
Vim Version: Vim 8

Problem description:

When calling a Wordy list for the first time, I get a few

"Conversion failure for word in ~/vimfiles/bundle/vim-wordy/data/en/puffery.dic line [0-9]" messages. (the line and the dictionary will vary)

In every case it seems that the problem is "curly quotes" which appear as gibberish characters within the word that failed to convert. I'm guessing there is a simple fix, but I cannot figure it out.

Wordy calls spellcheck and Wordy check

For some reason when I call Wordy, it highlights both the Wordy check words and the standard spellcheck words, which means it can be difficult to identify Wordy's results at a glance. Is this correct behaviour, and is there any way to only have the Word check words?
Many thanks -- great plugin.

SpellRare

Regarding the check:

      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

Now Vim also has SpellRare so perhaps better than a check for nvim would be one for the highlight-group SpellRare? Don't know how though. Perhaps check for the exact patch of Vim that brought it in?

WeakyWord marks wrong word

Hi Reed,

I tried the your example example with weak words:

“I got up and went to work.” (weak)
“I awoke and walked to work.” (better)

and in the better part of the example, walked is also marked as weak. In my opinion that's a fine word.

Feedback

I love vim-wordy. I actually started writing my own, but came across yours and promptly threw mine away. Well done.

Here's some things I wish Wordy did better.

  1. The command names are kinda random, or at least they seem to be and I have a hard time remembering them. I wish that Wordy was the prefix instead of the postfix so I could just type :Wordy<tab> and see the list
  2. I wish there was a single dictionary or command that contained the most common or all of modes. I often run through a few of them correcting as I go, but I'd rather just do it in one sweep.

I'm happy to provide a pull request for either of these if you think they would be worthwhile.

Externalize the Word Lists as Structured Data

Greetings, fellow writing tools wonk! Big fan of this plugin.

@anseljh and I are lawyers working on a variety of tools to help us draft contracts in a more approachable, understandable style. As part of that, we've come up with a couple data files right in the spirit of the .dic files here:

  1. https://github.com/kemitchell/american-legal-archaisms
  2. https://github.com/kemitchell/wordy-words

I'll definitely convert some of your .dic files for our open-source contract drafting software (https://commonform.github.io), too. I see the MIT license --- thanks for making open source! --- but thought I'd mention, if only to be courteous.

Related: Might you take a pull request to build the .dic files for vim-wordy from structured data tracked in a separate repo? Build steps are kind of a pain, I know, but I'd like to consolidate our efforts. The lists we've created have tended to grow a word or two at a time, as we spot new candidates in our day-to-day. The more folks looking, the better.

Again, thanks for vim-wordy! Really excited to make it part of my everyday Vim.

Suggestion: highlight words overused in file

It would be great if there were a way to just highlight the words that are overused in the current file. It could work for the whole buffer and for each paragraph. So if a word were used a lot more than any other in the file it would be highlighted, and if a word were used more than, say, three times in the same paragraph, it would be highlighted too. And then there could be a way to customize how much a word can be used to trigger this and maybe a way to cycle through the most used words, highlighting one at a time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.