All Projects → dbmrq → Vim Ditto

dbmrq / Vim Ditto

🙊 Stop repeating yourself

Projects that are alternatives of or similar to Vim Ditto

Nord Sublime Text
An arctic, north-bluish clean and elegant Sublime Text theme.
Stars: ✭ 109 (-26.35%)
Mutual labels:  text, highlighting
React Native See More Inline
Show a "read more", "see more", "read less", "see less" inline with your text in React Native
Stars: ✭ 141 (-4.73%)
Mutual labels:  text
Scribble
Efficient multi-effects text renderer for GameMaker Studio 2.3.1
Stars: ✭ 123 (-16.89%)
Mutual labels:  text
Typesettable
📐 A typesetting library for SVG and Canvas
Stars: ✭ 134 (-9.46%)
Mutual labels:  text
Lucenenet
Apache Lucene.NET
Stars: ✭ 1,704 (+1051.35%)
Mutual labels:  text
Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+1235.14%)
Mutual labels:  spellcheck
React Text Transition
Animate your text changes
Stars: ✭ 121 (-18.24%)
Mutual labels:  text
Parjs
JavaScript parser-combinator library
Stars: ✭ 145 (-2.03%)
Mutual labels:  text
Assignment writer
So your teacher told you to upload written assignments? Hate writing assigments? This tool will help you convert your text to handwriting ;-; https://saiteja69.github.io/Assignment_Writer/
Stars: ✭ 143 (-3.38%)
Mutual labels:  text
Textrecognitiondatagenerator
A synthetic data generator for text recognition
Stars: ✭ 2,075 (+1302.03%)
Mutual labels:  text
Dynamic Toasts
Custom toasts with color and icon for Android.
Stars: ✭ 132 (-10.81%)
Mutual labels:  text
Zfont
💬 Text plugin for Zdog - works with any .ttf font!
Stars: ✭ 126 (-14.86%)
Mutual labels:  text
Peep
The CLI text viewer tool that works like less command on small pane within the terminal window.
Stars: ✭ 139 (-6.08%)
Mutual labels:  text
Typewriterview
Android library for typewriter like effects
Stars: ✭ 124 (-16.22%)
Mutual labels:  text
Did you mean
The gem that has been saving people from typos since 2014
Stars: ✭ 1,786 (+1106.76%)
Mutual labels:  spellcheck
Snodge
Randomly mutate JSON, XML, HTML forms, text and binary data for fuzz testing
Stars: ✭ 121 (-18.24%)
Mutual labels:  text
Zsh Syntax Highlighting Filetypes
zsh syntax highlighting with dircolors in realtime
Stars: ✭ 130 (-12.16%)
Mutual labels:  highlighting
Notepanda
📃 A simple cross-platform notepad. Based on Qt and C++.
Stars: ✭ 134 (-9.46%)
Mutual labels:  text
Handwritten.js
Convert typed text to realistic handwriting!
Stars: ✭ 1,806 (+1120.27%)
Mutual labels:  text
Dspellcheck
Notepad++ Spell-checking Plug-in
Stars: ✭ 144 (-2.7%)
Mutual labels:  spellcheck

ditto.vim

Ditto is a Vim plugin that highlights overused words.

You can check the most frequent words in each sentence, paragraph or file, cycle through them, choose which words to ignore and more.

Ditto

Quick start

  1. Install Ditto using your favorite plugin manager or copy each file to its corresponding directory under ~/.vim/.

  2. Add this to your .vimrc:

    " Use autocmds to check your text automatically and keep the highlighting
    " up to date (easier):
    au FileType markdown,text,tex DittoOn  " Turn on Ditto's autocmds
    nmap <leader>di <Plug>ToggleDitto      " Turn Ditto on and off
    
    " If you don't want the autocmds, you can also use an operator to check
    " specific parts of your text:
    " vmap <leader>d <Plug>Ditto	       " Call Ditto on visual selection
    " nmap <leader>d <Plug>Ditto	       " Call Ditto on operator movement
    
    nmap =d <Plug>DittoNext                " Jump to the next word
    nmap -d <Plug>DittoPrev                " Jump to the previous word
    nmap +d <Plug>DittoGood                " Ignore the word under the cursor
    nmap _d <Plug>DittoBad                 " Stop ignoring the word under the cursor
    nmap ]d <Plug>DittoMore                " Show the next matches
    nmap [d <Plug>DittoLess                " Show the previous matches
    

    (Chose the filetypes and mappings you prefer. These are only suggestions.)

  3. Stop procrastinating and write (God knows I should).

Table of Contents

Commands

:Ditto and :NoDitto

:Ditto is the command that actually does all the hard work. It highlights the most frequent word in the current file or in the current visual selection. Most other commands are just wrappers that run :Ditto on specific parts of your file and keep it up to date.

:NoDitto, you guessed it, takes the highlighting away.

:DittoSent, :DittoPar and :DittoFile

These three commands run :Ditto on each sentence, each paragraph or on your whole file, respectively.

:DittoOn, :DittoOff and :DittoUpdate

If you just go ahead and call one of the commands above, as soon as you make some changes in your file you'll notice that the highlighting doesn't keep up. That's where :DittoOn comes in: besides highlighting the most frequent words, it'll add autocmds to keep the highlighting up to date and highlight new words as soon as you type them.

By default, :DittoOn will update the highlighting every time you insert a <space> or add/remove a line from your file. If you don't like that, you can also run :DittoUpdate from your own autocmds:

au CursorHold,CursorHoldI * DittoUpdate

So there in the example config where it says au FileType markdown,text,tex DittoOn, what it does is run :DittoOn on every markdown, text or tex files. Whenever you edit one of those files, Ditto will automatically highlight overused words in each paragraph (the default scope can be changed with g:ditto_mode).

:DittoOn is automatically disabled for readonly files, so you can call it for every text file, like in the example, and Vim's help files won't get all highlighted. If you're editing a readonly file and you still want to turn on Ditto's autocmds, you can use :DittoOn!, with the exclamation mark.

As for :DittoOff, you guessed it again, it removes the highlighting and the autocmds.

:DittoSentOn, :DittoParOn and :DittoFileOn

:DittoOn uses the g:ditto_mode variable to decide whether to highlight overused words in each sentence, paragraph or file. Whatever you set that variable to, you can also use these commands to turn Ditto on in a different mode in the current buffer.

:ToggleDitto

Last but not least, :ToggleDitto does :DittoOn when Ditto's off and :DittoOff when it's on. 😅

Mappings

<Plug>Ditto

Call Ditto for the current selection (in visual mode) or operator movement (in normal mode).

<Plug>DittoNext and <Plug>DittoPrev

Map a couple of keys to these plugs and you will be able to jump to the next and previous highlighted words as if they were spelling mistakes or search results.

<Plug>DittoGood and <Plug>DittoBad

If you run DittoOn on a big file, soon you will find a few words that you think it's ok to repeat.

Use these plugs to ignore or stop ignoring the word under the cursor.

By default, your good words are added to the first readable directory in your runtimepath plus /Ditto/dittofile.txt.

<Plug>DittoMore and <Plug>DittoLess

When you run any of the Ditto commands you'll see the words you use the most. Use <Plug>DittoMore to show the second word you use the most, and then the third, fourth and so on. And then, of course, use<Plug>DittoLess to go back.

When two words are used equally as often, Ditto will highlight the longest one. If they're the same length it'll just pick one. So it's a good idea to use <Plug>DittoMore and <Plug>DittoLess and see what the other words are.

<Plug>DittoOn, <Plug>DittoOff, <Plug>DittoUpdate and <Plug>ToggleDitto

These are the same as the eponymous commands.

Options

g:ditto_min_word_length

Words shorter than this will never be highlighted.

Default: 4

g:ditto_min_repetitions

Words repeated fewer times than this in each scope won't be highlighted.

Default: 3

g:ditto_hlgroups

This is a list of the highlight groups Ditto will use. It'll highlight as many different words per scope as there are strings in this list. So if there are 5 highlight groups in this variable, Ditto will highlight the 5 most used words in each sentence, paragraph or file.

Default: ['SpellRare']

g:ditto_mode

Use this variable to set the scope used by :DittoOn. The current options are:

let g:ditto_mode = "sentence"
let g:ditto_mode = "paragraph"
let g:ditto_mode = "file"

Default: "paragraph"

g:ditto_file

The name of the file Ditto should use to save its ignored words.

Default: dittofile.txt

g:ditto_dir

The directory where Ditto should save g:ditto_file. It can be a comma separated list.

Default: &l:runtimepath . "/Ditto"

See also

You may also be interested in my other plugins:

Also check out wordy and Reedes' many other great plugins.

Also I'm very susceptible to compliments. Just saying.


And that's it!

Here's a song for you, replace "Lido" with "Ditto" in your head:

Ditto Shuffle

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].