{"id":13706107,"url":"https://github.com/dbmrq/vim-ditto","last_synced_at":"2025-07-03T00:04:52.774Z","repository":{"id":164625229,"uuid":"64102218","full_name":"dbmrq/vim-ditto","owner":"dbmrq","description":":speak_no_evil: Stop repeating yourself","archived":false,"fork":false,"pushed_at":"2018-01-10T23:23:13.000Z","size":51,"stargazers_count":180,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-03T00:03:14.083Z","etag":null,"topics":["check","highlighting","paragraph","repeat","repetition","sentence","spellcheck","spelling","text","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbmrq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-25T03:54:54.000Z","updated_at":"2025-04-30T02:38:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"3be851a8-cc00-4007-bdbc-89eb25732afe","html_url":"https://github.com/dbmrq/vim-ditto","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dbmrq/vim-ditto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbmrq%2Fvim-ditto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbmrq%2Fvim-ditto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbmrq%2Fvim-ditto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbmrq%2Fvim-ditto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbmrq","download_url":"https://codeload.github.com/dbmrq/vim-ditto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbmrq%2Fvim-ditto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263234936,"owners_count":23434916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["check","highlighting","paragraph","repeat","repetition","sentence","spellcheck","spelling","text","vim"],"created_at":"2024-08-02T22:00:52.208Z","updated_at":"2025-07-03T00:04:52.669Z","avatar_url":"https://github.com/dbmrq.png","language":"Vim script","funding_links":[],"categories":["plugins for writing"],"sub_categories":[],"readme":"# ditto.vim\n\nDitto is a Vim plugin that highlights overused words.\n\nYou can check the most frequent words in each sentence, paragraph or file, cycle through them, choose which words to ignore and more. \n\n![Ditto](https://cloud.githubusercontent.com/assets/15813674/17240247/86ae98dc-5540-11e6-9f20-f0f6ae8a9697.png)\n\n### Quick start\n\n1. Install Ditto using your favorite plugin manager or copy each file to its corresponding directory under `~/.vim/`.\n\n2. Add this to your `.vimrc`:\n\n    ```vim\n    \" Use autocmds to check your text automatically and keep the highlighting\n    \" up to date (easier):\n    au FileType markdown,text,tex DittoOn  \" Turn on Ditto's autocmds\n    nmap \u003cleader\u003edi \u003cPlug\u003eToggleDitto      \" Turn Ditto on and off\n\n    \" If you don't want the autocmds, you can also use an operator to check\n    \" specific parts of your text:\n    \" vmap \u003cleader\u003ed \u003cPlug\u003eDitto\t       \" Call Ditto on visual selection\n    \" nmap \u003cleader\u003ed \u003cPlug\u003eDitto\t       \" Call Ditto on operator movement\n\n    nmap =d \u003cPlug\u003eDittoNext                \" Jump to the next word\n    nmap -d \u003cPlug\u003eDittoPrev                \" Jump to the previous word\n    nmap +d \u003cPlug\u003eDittoGood                \" Ignore the word under the cursor\n    nmap _d \u003cPlug\u003eDittoBad                 \" Stop ignoring the word under the cursor\n    nmap ]d \u003cPlug\u003eDittoMore                \" Show the next matches\n    nmap [d \u003cPlug\u003eDittoLess                \" Show the previous matches\n    ```\n\n    (Chose the filetypes and mappings you prefer. These are only suggestions.)\n\n3. Stop procrastinating and write (God knows I should).\n\n\n## Table of Contents\n\n- [Commands](#commands)\n- [Mappings](#mappings)\n- [Options](#options)\n- [See also](#see-also)\n\n\n## Commands\n\n#### `:Ditto` and `:NoDitto`\n\n`: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.\n\n`:NoDitto`, you guessed it, takes the highlighting away.\n\n#### `:DittoSent`, `:DittoPar` and `:DittoFile`\n\nThese three commands run `:Ditto` on *each sentence*, *each paragraph* or on your *whole file*, respectively.\n\n#### `:DittoOn`, `:DittoOff` and `:DittoUpdate`\n\nIf 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 `autocmd`s to keep the highlighting up to date and highlight new words as soon as you type them.\n\nBy default, `:DittoOn` will update the highlighting every time you insert a `\u003cspace\u003e` or add/remove a line from your file. If you don't like that, you can also run `:DittoUpdate` from your own `autocmd`s:\n\n    au CursorHold,CursorHoldI * DittoUpdate\n\nSo 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`).\n\n`: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 `autocmd`s, you can use `:DittoOn!`, with the exclamation mark.\n\nAs for `:DittoOff`, you guessed it again, it removes the highlighting and the `autocmd`s.\n\n#### `:DittoSentOn`, `:DittoParOn` and `:DittoFileOn`\n\n`:DittoOn` uses the [`g:ditto_mode`](#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.\n\n#### `:ToggleDitto`\n\nLast but not least, `:ToggleDitto` does `:DittoOn` when Ditto's off and `:DittoOff` when it's on. :sweat_smile:\n\n\n## Mappings\n\n#### `\u003cPlug\u003eDitto`\n\nCall Ditto for the current selection (in visual mode) or operator movement (in normal mode).\n\n#### `\u003cPlug\u003eDittoNext` and `\u003cPlug\u003eDittoPrev`\n\nMap 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.\n\n#### `\u003cPlug\u003eDittoGood` and `\u003cPlug\u003eDittoBad`\n\nIf you run DittoOn on a big file, soon you will find a few words that you think it's ok to repeat.\n\nUse these plugs to ignore or stop ignoring the word under the cursor.\n\nBy default, your good words are added to the first readable directory in your `runtimepath` plus `/Ditto/dittofile.txt`.\n\n#### `\u003cPlug\u003eDittoMore` and `\u003cPlug\u003eDittoLess`\n\nWhen you run any of the Ditto commands you'll see the words you use the most. Use `\u003cPlug\u003eDittoMore` to show the second word you use the most, and then the third, fourth and so on. And then, of course, use`\u003cPlug\u003eDittoLess` to go back.\n\nWhen 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 `\u003cPlug\u003eDittoMore` and `\u003cPlug\u003eDittoLess` and see what the other words are.\n\n#### `\u003cPlug\u003eDittoOn`, `\u003cPlug\u003eDittoOff`, `\u003cPlug\u003eDittoUpdate` and `\u003cPlug\u003eToggleDitto`\n\nThese are the same as the eponymous commands.\n\n\n## Options\n\n#### `g:ditto_min_word_length`\n\nWords shorter than this will never be highlighted.\n\nDefault: `4`\n\n#### `g:ditto_min_repetitions`\n\nWords repeated fewer times than this in each scope won't be highlighted.\n\nDefault: `3`\n\n#### `g:ditto_hlgroups`\n\nThis 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.\n\nDefault: `['SpellRare']`\n\n#### `g:ditto_mode`\n\nUse this variable to set the scope used by `:DittoOn`. The current options are:\n\n```vim\nlet g:ditto_mode = \"sentence\"\nlet g:ditto_mode = \"paragraph\"\nlet g:ditto_mode = \"file\"\n```\n\nDefault: `\"paragraph\"`\n\n#### `g:ditto_file`\n\nThe name of the file Ditto should use to save its ignored words.\n\nDefault: `dittofile.txt`\n\n#### `g:ditto_dir`\n\nThe directory where Ditto should save `g:ditto_file`. It can be a comma separated list.\n\nDefault: `\u0026l:runtimepath . \"/Ditto\"`\n\n\n## See also\n\nYou may also be interested in my other plugins:\n\n- [Dialect: project specific spellfiles](https://github.com/dbmrq/vim-dialect) :speech_balloon:\n- [Redacted: the best way to ████ the ████](https://github.com/dbmrq/vim-redacted) :no_mouth:\n- [Chalk: better fold markers](https://github.com/dbmrq/vim-chalk) :pencil2:\n- [Howdy: a tiny MRU start screen for Vim](https://github.com/dbmrq/vim-howdy) :wave:\n\n\nAlso check out [wordy](https://github.com/reedes/vim-wordy) and [Reedes](https://github.com/reedes)' [many other great plugins](https://github.com/reedes?tab=repositories).\n\nAlso I'm very susceptible to compliments. Just saying.\n\n\n----------\n\nAnd that's it!\n\nHere's a song for you, replace \"Lido\" with \"Ditto\" in your head:\n\n[![Ditto Shuffle](http://img.youtube.com/vi/HQZBaJAngH8/0.jpg)](http://www.youtube.com/watch?v=HQZBaJAngH8)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbmrq%2Fvim-ditto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbmrq%2Fvim-ditto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbmrq%2Fvim-ditto/lists"}