{"id":13540023,"url":"https://github.com/preservim/vim-lexical","last_synced_at":"2025-04-09T18:23:13.130Z","repository":{"id":12884543,"uuid":"15561103","full_name":"preservim/vim-lexical","owner":"preservim","description":"Build on Vim’s spell/thes/dict completion","archived":false,"fork":false,"pushed_at":"2022-02-11T22:37:05.000Z","size":25,"stargazers_count":273,"open_issues_count":10,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T12:27:50.283Z","etag":null,"topics":["prose","vim","vim-plugin","writing"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preservim.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-01T06:05:00.000Z","updated_at":"2024-12-10T22:14:04.000Z","dependencies_parsed_at":"2022-09-01T19:31:10.985Z","dependency_job_id":null,"html_url":"https://github.com/preservim/vim-lexical","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-lexical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-lexical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-lexical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-lexical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preservim","download_url":"https://codeload.github.com/preservim/vim-lexical/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085969,"owners_count":21045244,"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":["prose","vim","vim-plugin","writing"],"created_at":"2024-08-01T09:01:37.772Z","updated_at":"2025-04-09T18:23:13.111Z","avatar_url":"https://github.com/preservim.png","language":"Vim script","funding_links":[],"categories":["Vim Script","plugins for writing"],"sub_categories":[],"readme":"# vim-lexical\n\n\u003e Building on Vim’s spell-check and thesaurus/dictionary completion\n\nFeatures of this plugin:\n\n* Specify the languages to be used in spell-check\n* Specify a list of thesauruses for synonym completion\n* Specify a list of dictionaries for word completion\n* Specify a list of spellfiles for custom word-check additions\n* Opt-in key mappings for _Normal_ mode thesaurus and dictionary completion\n* Buffer-scoped configuration (leaves your global settings alone)\n\nThough principally used as a editor for code, Vim flirts with those of us\nediting documentation and prose by providing spell-check as well as\ncompletion capabilities using both dictionary and thesaurus files.\n\nWhile we can configure these settings in our `.vimrc` files, we often need\nmore granular control, where defaults are leveraged and configuration is\napplied by file type to the current buffer. This plugin fills that gap.\n\n## Installation\n\nYou can install using your favorite Vim package manager. (E.g.,\n[Pathogen][pathogen], [Vundle][vundle], or [Plug][plug].) If you are using\na recent version of vim or neovim, you can also use native package\nsupport. (See [:help packages][packages].)\n\n[pathogen]: https://github.com/tpope/vim-pathogen\n[vundle]: https://github.com/VundleVim/Vundle.vim\n[plug]: https://github.com/junegunn/vim-plug\n[packages]: https://vimhelp.org/repeat.txt.html#packages\n\n## Configuration\n\nBecause spell-check, thesaurus, etc. isn’t needed for all file types, you can \nconfigure it per file type in your `.vimrc`:\n\n```vim\nset nocompatible\nfiletype plugin on       \" may already be in your .vimrc\n\naugroup lexical\n  autocmd!\n  autocmd FileType markdown,mkd call lexical#init()\n  autocmd FileType textile call lexical#init()\n  autocmd FileType text call lexical#init({ 'spell': 0 })\naugroup END\n```\n\nIn the last `autocmd` statement above, dictionaries and thesauruses are\nconfigured for the `text` file type, but spell-check is disabled by\ndefault.\n\n_lexical_ enables spell-check by default for buffers in which it is\ninitialized. You can change that default setting in your `.vimrc`:\n\n```vim\nlet g:lexical#spell = 1         \" 0=disabled, 1=enabled\n```\n\n### Spell-check language configuration\n\nVim’s global `spelllang` (note three `l`s) may already specify a default\nlanguage. You can query it with a simple command:\n\n```vim\n:echo \u0026spelllang\n=\u003e ‘en’\n```\n\nIf desired, you can be more specific, overriding the global `spelllang` in\nyour `.vimrc`:\n\n```vim\nlet g:lexical#spelllang = ['en_us','en_ca',]\n```\n\nAvailable spell files can be found at [ftp.vim.org][sf]. Vim will attempt\nto download those which are not installed locally. For more detail see\n\n```vim\n:help spellfile.vim\n```\n\n[sf]: http://ftp.vim.org/vim/runtime/spell\n\n### Thesaurus configuration\n\nIf you don’t have one already, download a thesaurus, such as Grady Ward’s\nMoby Thesaurus at Zeke's [moby thesaurus][1], or on [Project Gutenberg][2] \nand extract the `mthesaur.txt` file. By default _lexical_ will look for it \nat the following path:\n\n```vim\nlet g:lexical#thesaurus = ['~/.vim/thesaurus/mthesaur.txt',]\n```\n\nYou can specify multiple paths to thesauruses in the list.\n\n[1]: https://raw.githubusercontent.com/zeke/moby/master/words.txt \"On moby-thesaurus site\"\n[2]: https://www.gutenberg.org/ebooks/3202 \"Moby Thesaurus List by Grady Ward\"\n\n### Dictionary configuration\n\nOn Unix-based systems (including OS X) the dictionary will default to:\n\n```vim\nlet g:lexical#dictionary = ['/usr/share/dict/words',]\n```\n\nYou can specify multiple paths to dictionaries in the list.\n\n\n### Spellfile configuration\nOn Unix-based systems (including OS X) the spellfile will default to:\n\n```vim\nlet g:lexical#spellfile = ['~/.vim/spell/en.utf-8.add',]\n```\n\nYou can specify a single path for spellfile in the list.\n\n\n## Commands\n\nVim offers many standard key mappings for spell-checking and completion.\n\n### Spell-check\n\nThese are the _Normal_ mode commands:\n\n* `]s`\t\t\t- Move to next misspelled word after the cursor.\n* `[s`\t\t\t- Like `]s` but search backwards\n* `]S`\t\t\t- Like `]s` but only stop at bad words, not at rare words or words\n  for another region.\n* `[S`\t\t\t- Like `]S` but search backwards.\n\nWith the following key mappings you can use Visual mode selection to select the\ncharacters (including whitespace). Otherwise the word under the cursor is used.\n\n* `zg`\t\t\t- Mark as a good word\n* `zw`\t\t\t- Like `zg` but mark the word as a wrong (bad) word.\n* `zug`     - Unmark as good word\n* `zuw`     - Unmark as wrong (bad) word \n\n* `z=`\t\t\t- For the word under/after the cursor suggest correctly spelled words\n* `1z=`\t\t\t- Use the first suggestion, without prompting\n* `.`       - Redo - repeat last word replacement\n\n* `:spellr` - Repeat the replacement done by `z=` for all matches with the\n  replaced word in the current window\n\nFor spelling suggestions while in _Insert_ mode:\n\n* `«CTRL-X» «CTRL-S»` (or `«CTRL-X» «s»` for terminal users) - suggest spelling, using `«CTRL-P»` and `«CTRL-N»` to navigate.\n\nFor a convenient pop-up list of suggestions from _Normal_ mode, you can map an \navailable key of your choice in your `.vimrc`:\n\n```vim\nlet g:lexical#spell_key = '\u003cleader\u003es'\n```\n\nThis buffer-scoped mapping is strictly opt-in. No key is mapped by default.\n\n### Thesaurus lookup\n\nFor thesaurus lookup while in _Insert_ mode:\n\n* `«CTRL-X» «CTRL-T»` - thesaurus lookup, using `«CTRL-P»` and `«CTRL-N»` to navigate.\n\nFor convenient _Normal_ mode thesaurus lookup from the cursor position,\nyou can map an available key of your choice in your `.vimrc`:\n\n```vim\nlet g:lexical#thesaurus_key = '\u003cleader\u003et'\n```\n\nThis buffer-scoped mapping is strictly opt-in. No key is mapped by default.\n\n### Dictionary completion\n\nFor dictionary completion while in _Insert_ mode:\n\n* `«CTRL-X» «CTRL-K»` - dictionary completion, using `«CTRL-P»` and `«CTRL-N»` to navigate.\n\nFor convenient _Normal_ mode dictionary lookup from the cursor position,\nyou can map an available key of your choice in your `.vimrc`:\n\n```vim\nlet g:lexical#dictionary_key = '\u003cleader\u003ek'\n```\n\nThis buffer-scoped mapping is strictly opt-in. No key is mapped by default.\n\n### Define your own commands\n\nSometimes you need a highly-customized environment for spell-check and\ncompletion. You can define your own commands in your `.vimrc` to meet that\nneed. For example:\n\n```vim\ncommand! -nargs=0 LexMed call lexical#init({\n                    \\ 'spell': 1,\n                    \\ 'spelllang':  ['en', 'medical'],\n                    \\ 'dictionary': ['~/.vim/dictionary/medical_terms.txt',\n                    \\                '/usr/share/dict/words',\n                    \\               ],\n                    \\ 'thesaurus':  ['~/.vim/dictionary/medical_synonyms.txt',\n                    \\                '~/.vim/thesaurus/mthesaur.txt',\n                    \\               ],\n                    \\ 'spellfile':  ['~/.vim/spell/en.add'],\n                    \\ })\n```\n\nThen to quickly configure Vim for the current buffer, enter the command:\n\n```vim\n:LexMed\n```\n\nWhere you are providing an explicit value, it will use that. Where you do\nnot, it will fall back to your specified defaults or global settings.\n\n## See also\n\nThe [ervandew/supertab][st] plugin will make these _Insert_ mode\ncompletions available via the `«tab»` key.\n\nIf you find this plugin useful, you may want to check out these others\noriginally by [@reedes][re]:\n\n* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer\n* [vim-litecorrect][lc] - lightweight auto-correction for vim\n* [vim-pencil][pn] - rethinking Vim as a tool for writers\n* [vim-textobj-quote][qu] - extends Vim to support typographic (‘curly’) quotes\n* [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command\n* [vim-thematic][th] - modify Vim’s appearance to suit your task and environment \n* [vim-wheel][wh] - screen-anchored cursor movement for Vim\n* [vim-wordy][wo] - uncovering usage problems in writing \n* [vim-wordchipper][wc] - power tool for shredding text in Insert mode\n\n[st]: https://github.com/ervandew/supertab\n[re]: https://github.com/reedes\n[cp]: https://github.com/preservim/vim-colors-pencil\n[lc]: https://github.com/preservim/vim-litecorrect\n[pn]: https://github.com/preservim/vim-pencil\n[qu]: https://github.com/preservim/vim-textobj-quote\n[ts]: https://github.com/preservim/vim-textobj-sentence\n[th]: https://github.com/preservim/vim-thematic\n[wh]: https://github.com/preservim/vim-wheel\n[wo]: https://github.com/preservim/vim-wordy\n[wc]: https://github.com/preservim/vim-wordchipper\n\n## Future development\n\nIf you’ve spotted a problem or have an idea on improving this plugin,\nplease post it to the [GitHub project issue page][issues].\n\n[issues]: https://github.com/preservim/vim-lexical/issues\n\n\u003c!-- vim: set tw=74 :--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-lexical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreservim%2Fvim-lexical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-lexical/lists"}