{"id":13706167,"url":"https://github.com/preservim/vim-textobj-sentence","last_synced_at":"2025-04-11T02:10:22.480Z","repository":{"id":13613589,"uuid":"16306728","full_name":"preservim/vim-textobj-sentence","owner":"preservim","description":"Improving on Vim's native sentence text object and motion","archived":false,"fork":false,"pushed_at":"2022-02-13T12:37:33.000Z","size":48,"stargazers_count":99,"open_issues_count":11,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T23:35:16.263Z","etag":null,"topics":["prose","vim","vim-plugin","vim-textobj-user","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-28T08:56:21.000Z","updated_at":"2025-02-21T05:51:27.000Z","dependencies_parsed_at":"2022-09-13T17:42:39.561Z","dependency_job_id":null,"html_url":"https://github.com/preservim/vim-textobj-sentence","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-textobj-sentence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-textobj-sentence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-textobj-sentence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preservim%2Fvim-textobj-sentence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preservim","download_url":"https://codeload.github.com/preservim/vim-textobj-sentence/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":["prose","vim","vim-plugin","vim-textobj-user","writing"],"created_at":"2024-08-02T22:00:52.737Z","updated_at":"2025-04-11T02:10:22.465Z","avatar_url":"https://github.com/preservim.png","language":"Vim script","funding_links":[],"categories":["Vim Script","plugins for writing"],"sub_categories":[],"readme":"# vim-textobj-sentence\n\n\u003e Improving on Vim's native sentence text object and motion\n\nDetecting sentences can be tricky, esp. when the words and punctuation of\na sentence are interspersed with abbreviations, “quotations,”\n(parentheses), [brackets], the \\_\\_markup\\_\\_ from \\*\\*lightweight\\*\\*\nmarkup languages, and hard\u003cbr\u003eline\u003cbr\u003ebreaks.\n\nWhile Vim’s native sentence text object is quite capable, its behavior\nremains hard-coded and cannot be extended. Thus arises the need for\na specialized text object offered by this plugin.\n\nFeatures of this plugin:\n\n* Sophisticated sentence text object, supporting selection, motion, and jump\n* Implemented with regular expressions via the [vim-textobj-user][vt] plugin\n* Supports sentences containing common abbreviations (configurable)\n* Support for sentences containing typographical characters, incl. quotes,\n  em dash, etc.\n* Support for lightweight markup languages (markdown, e.g.)\n* Buffer scoped configuration\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\nThis plugin has an essential dependency that you will need to install:\n\n* [kana/vim-textobj-user][vt] - a Vim plugin to create your own text\n  objects without pain\n\n[vt]: https://github.com/kana/vim-textobj-user\n\n## Configuration\n\nBecause prose benefits more than code from a sentence text object, the\nbehavior of this plugin can be configured per file type. For example, to\nenable sentence  in `markdown` and `textile` files, place in your\n`.vimrc`:\n\n```vim\nset nocompatible            \" this may already be in your .vimrc\nfiletype plugin indent on   \" ...and this too\n\naugroup textobj_sentence\n  autocmd!\n  autocmd FileType markdown call textobj#sentence#init()\n  autocmd FileType textile call textobj#sentence#init()\naugroup END\n```\n\n### Decimal numbers and abbreviations\n\nThough the period `.` glyph/character will normally terminate a sentence,\nit also has other uses. For example, the same glyph is used in\nabbreviations like  ‘M.D.’ for Medical Doctor. These abbreviations, however,\nshould be tolerated when detecting the boundaries of a sentence. The\nfollowing should be considered one text object, rather than four:\n\n```\nMagnum, P.I. lives at Robin’s Nest, located at 11435 18th Ave., Oahu, HI.\n```\n\nThis plugin detects decimal numbers and common abbreviations. By default,\nthe following abbreviations will be recognized:\n\n```\n  let g:textobj#sentence#abbreviations = [\n    \\ '[ABCDIMPSUabcdegimpsv]',\n    \\ 'l[ab]', '[eRr]d', 'Ph', '[Ccp]l', '[Lli]n', '[cn]o',\n    \\ '[Oe]p', '[DJMSh]r', '[MVv]s', '[CFMPScfpw]t',\n    \\ 'alt', '[Ee]tc', 'div', 'es[pt]', '[Ll]td', 'min',\n    \\ '[MD]rs', '[Aa]pt', '[Aa]ve?', '[Ss]tr?',\n    \\ '[Aa]ssn', '[Bb]lvd', '[Dd]ept', 'incl', 'Inst', 'Prof', 'Univ',\n    \\ ]\n```\n\nNote that you can override/modify the above defaults in your `.vimrc`, but\nbe sure to include the declaration before your call to\n`textobj#sentence#init()`.\n\n### Motion commands\n\nMotion commands on text objects are a powerful feature of Vim.\n\nThis plugin overrides Vim’s native commands for sentence selection:\n\n* `as` - select ‘_around_’ sentence with trailing whitespace\n* `is` - select ‘_inside_’ sentence without trailing whitespace\n\n* `(` - move to start of previous sentence\n* `)` - move to start of next sentence\n\nThis plugin adds:\n\n* `g)` - jump to end of current sentence\n* `g(` - jump to end of previous sentence\n\nYou can manipulate text just as with Vim’s original `as` and `is`\ncommands, such as `cis` for change, `vas` for visual selection, `das` for\ndeletion, `yas` for yanking to clipboard, etc.. Note that count isn’t\nsupported at present (due to limitations of the underlying\nvim-textobj-user) but repeat with `.` does work.\n\nIf you prefer to retain the native commands, you can assign other\nkey mappings via your `.vimrc`:\n\n  ```vim\n  let g:textobj#sentence#select = 's'\n  let g:textobj#sentence#move_p = '('\n  let g:textobj#sentence#move_n = ')'\n  ```\n\n## See also\n\nIf you find this plugin useful, check out these others originally by\n[@reedes][re]:\n\n* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer\n* [vim-lexical][lx] - building on Vim’s spell-check and\n  thesaurus/dictionary completion\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-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[re]: https://github.com/reedes\n[cp]: https://github.com/preservim/vim-colors-pencil\n[lx]: https://github.com/preservim/vim-lexical\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[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-textobj-sentence/issues\n\n\u003c!-- vim: set tw=74 :--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-textobj-sentence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreservim%2Fvim-textobj-sentence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreservim%2Fvim-textobj-sentence/lists"}