{"id":13706172,"url":"https://github.com/preservim/vim-wordchipper","last_synced_at":"2025-04-11T02:09:45.989Z","repository":{"id":43940861,"uuid":"223345533","full_name":"preservim/vim-wordchipper","owner":"preservim","description":"Power tool for shredding text in Insert mode","archived":false,"fork":false,"pushed_at":"2022-02-13T12:38:03.000Z","size":6,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T02:09:39.946Z","etag":null,"topics":["markdown","prose","vim","vim-plugin","writing"],"latest_commit_sha":null,"homepage":null,"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":"2019-11-22T07:14:11.000Z","updated_at":"2024-09-10T09:15:41.000Z","dependencies_parsed_at":"2022-09-12T02:31:55.042Z","dependency_job_id":null,"html_url":"https://github.com/preservim/vim-wordchipper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-wordchipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-wordchipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-wordchipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-wordchipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preservim","download_url":"https://codeload.github.com/preservim/vim-wordchipper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328160,"owners_count":21085261,"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":["markdown","prose","vim","vim-plugin","writing"],"created_at":"2024-08-02T22:00:52.785Z","updated_at":"2025-04-11T02:09:45.963Z","avatar_url":"https://github.com/preservim.png","language":"Vim script","funding_links":[],"categories":["Vim Script","plugins for writing"],"sub_categories":[],"readme":"# vim-wordchipper\n\n\u003e Power tool for shredding text in *Insert* mode\n\n# Features\n\n* Conveniently delete words (and other text objects) while in *Insert* mode\n* Automatically forces a format on current paragraph when Vim’s autoformat\n  is active\n* Useful with writing plugins like [vim-pencil][pn] and when composing\n  code comments\n* Pure Vimscript with no dependencies\n\n# Introduction\n\nThough Vim’s *Insert* mode is typically used for entering new text, it\nnevertheless offers a limited capability to delete existing text with\nsingle keystrokes:\n\n| Key                | Description\n| ------------------ | -------------------------------------------------\n| `\u003cBS\u003e or \u003cC-h\u003e`    | Delete the character before the cursor\n| `\u003cDel\u003e`            | Delete the character under the cursor\n| `\u003cC-w\u003e`            | Delete the word before the cursor\n| `\u003cC-u\u003e`            | Delete all characters before the cursor in the current line\n\nIn addition, with `Ctrl-o` you can execute a command, which will then\nreturn to *Insert* mode. For example `\u003cC-o\u003edw` can delete the word after\nthe cursor.\n\nFor more details, see:\n\n```vim\n:help ins-special-keys\n```\n\nThis plugin can extend that capability, such as to delete the word _after_\nthe cursor with a single keystroke.\n\n## Installation\n\nInstall this plugin using your favorite Vim package manager.\n\n## Configuration\n\nNo keys are mapped by default. You must define the behavior of this plugin\nin your `.vimrc`.\n\nFor example, to re-map the `Ctrl-E` key to delete to the end of the next\n_word_:\n\n```vim\ninoremap \u003cexpr\u003e \u003cC-e\u003e wordchipper#chipWith('de')\n```\n\nwhere `de` deletes text forward to the end of the next _word_, preserving\nany trailing space. (As an alternative, `dw` would consume the trailing\nspace.)\n\nBy default, `Ctrl-W` will delete the _word_ before the cursor. You can\nchange this behavior to work with _WORDS_ instead (i.e., including\npunctuation):\n\n```vim\ninoremap \u003cexpr\u003e \u003cC-w\u003e wordchipper#chipWith('dB')\n```\n\nwhere `dB` deletes backwards to the end of the previous _WORD_.\n\n_wordchipper_ also can work with motions against non-word text objects,\nsuch as remapping `Ctrl-y` to delete to the end of the sentence:\n\n```vim\ninoremap \u003cexpr\u003e \u003cC-y\u003e wordchipper#chipWith('d)')\n```\n\nThis will use Vim’s default sentence text object, or an alternative like\n[vim-textobj-sentence][ts] if installed.\n\n\n### Buffer-local mappings\n\nYou can also specify buffer-local mappings, such as initialized only for\nthe Markdown and text file types...\n\n```vim\naugroup wordchipper\n  autocmd!\n  autocmd FileType markdown,mkd,text\n      \\   inoremap \u003cbuffer\u003e \u003cexpr\u003e \u003cC-e\u003e wordchipper#chipWith('de')\n      \\ | inoremap \u003cbuffer\u003e \u003cexpr\u003e \u003cC-w\u003e wordchipper#chipWith('dB')\n      \\ | inoremap \u003cbuffer\u003e \u003cexpr\u003e \u003cC-y\u003e wordchipper#chipWith('d)')\naugroup END\n```\n\n### Word motions\n\nVim’s standard word motions are available:\n\n* `e` - forward to the end of _word_, inclusive\n* `E` - forward to the end of _WORD_, inclusive\n* `w` - _word_ forward, exclusive\n* `W` - _WORD_ forward, exclusive\n* `ge` - backward to the end of _word_, inclusive\n* `gE` - backward to the end of _WORD_, inclusive\n* `b` - _word_ backward, exclusive\n* `B` - _WORD_ backward, exclusive\n\n‘_word_’ is defined by `iskeyword` option, and generally consists of\nletters, digits, and underscores. ‘_WORD_’ generally consists of non-blank\ncharacters, including punctuation. For more details, consult the\ndocumentation:\n\n```vim\n:help word-motions\n```\n\n## Recommended settings\n\nIn your `.vimrc`, ensure backspace can consume whatever is in its way:\n\n```vim\nset backspace=indent,eol,start\n```\n\nFor more details, see:\n\n```vim\n:help 'backspace'\n```\n\n## Prevent autoformat\n\nIf Vim’s autoformat is active during the *Insert*, such as when using\n_HardPencil_ mode in the _pencil_ plugin, _wordchipper_ will force\na format to the end of the paragraph when invoked. (Without _wordchipper_\nthere would be no force of a format when deleting text, despite autoformat\nbeing active.)\n\nYou can disable the forced format in your `.vimrc` with\n\n```vim\nlet g:wordchipper#autoformat = 0    \" default is 1\n```\n\n## See also\n\nIf you find this plugin useful, check out these others originally by\n[@reedes][re]:\n\n* [vim-pencil][pn] - Rethinking Vim as a tool for writers\n* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer\n* [vim-lexical][lx] - building on Vim’s spell-check and thesaurus/dictionary completion\n* [vim-litecorrect][lc] - lightweight auto-correction for Vim\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-wordy][wo] - uncovering usage problems in writing\n* [vim-wheel][wh] - screen anchored cursor movement\n\n[re]: https://github.com/reedes\n[cp]: https://github.com/preservim/vim-colors-pencil\n[pn]: https://github.com/preservim/vim-pencil\n[lx]: https://github.com/preservim/vim-lexical\n[lc]: https://github.com/preservim/vim-litecorrect\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[wo]: https://github.com/preservim/vim-wordy\n[wh]: https://github.com/preservim/vim-wheel\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-wordchipper/issues\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-wordchipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreservim%2Fvim-wordchipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-wordchipper/lists"}