{"id":15655591,"url":"https://github.com/hgiesel/vim-motion-sickness","last_synced_at":"2025-05-05T14:42:23.857Z","repository":{"id":111571145,"uuid":"61657364","full_name":"hgiesel/vim-motion-sickness","owner":"hgiesel","description":"Vim motions to the max","archived":false,"fork":false,"pushed_at":"2019-06-25T20:50:45.000Z","size":381,"stargazers_count":23,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T04:52:58.089Z","etag":null,"topics":["vim","vim-motions"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hgiesel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06-21T18:30:33.000Z","updated_at":"2024-07-01T08:37:17.000Z","dependencies_parsed_at":"2023-03-14T05:00:52.100Z","dependency_job_id":null,"html_url":"https://github.com/hgiesel/vim-motion-sickness","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/hgiesel%2Fvim-motion-sickness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgiesel%2Fvim-motion-sickness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgiesel%2Fvim-motion-sickness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgiesel%2Fvim-motion-sickness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hgiesel","download_url":"https://codeload.github.com/hgiesel/vim-motion-sickness/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516174,"owners_count":21760741,"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":["vim","vim-motions"],"created_at":"2024-10-03T12:59:55.339Z","updated_at":"2025-05-05T14:42:23.849Z","avatar_url":"https://github.com/hgiesel.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# motion-sickness.nvim ![Build Status](https://travis-ci.org/hgiesel/vim-motion-sickness.svg?branch=master) ![Build Status](https://travis-ci.org/hgiesel/vim-motion-sickness.svg?branch=devel)\n\nThis plugin adds a slew of new possible text objects. [Vader](https://github.com/junegunn/vader.vim)\nensures they all work as intended. Only Neovim is supported at the moment.\n\nEach type of text object can be disabled with `let g:sickness#{type}_enabled = 0`, e.g.:\n\n```vim\nlet g:sickness#symbol#enabled = 0\nlet g:sickness#view#enabled = 0\n```\n\nIf you only want the `\u003cplug\u003e` metakeys and want to define the mappings yourself, set\n`let g:sickness#{type}#use_default_maps = 0`, e.g.:\n\n```vim\nlet g:sickness#symbol#use_default_maps = 0\nlet g:sickness#view#use_default_maps = 0\n```\n\n#### List of text objects\n\n* **bracket text objects**:\n  * [alias text objects](#alias-text-objects)\n  * [expression text objects](#expression-text-objects)\n  * [field text objects](#field-text-objects)\n\n* **other text objects**:\n  * [indentation text objects](#indent-text-objects)\n  * [line text objects](#line-text-objects)\n  * [view text objects](#view-text-objects)\n  * [symbol text objects](#symbol-text-objects)\n\n## Alias text objects\n\n* inspired by [Tim Pope's vim-surround](https://github.com/tpope/vim-surround)\n\n| text object  | effect                |\n|--------------|-----------------------|\n| `ir`/`ar`    | Aliases for `i[`/`a[` |\n| `ia`/`aa`    | Aliases for `i\u003c`/`a\u003c` |\n\n* with these added, you have three full sets of text objects for the common brackets:\n\n|              |  parentheses | braces    | square brackets | angle brackets |\n|--------------|--------------|-----------|-----------------|----------------|\n| *char*       | `ib`/`ab`    | `iB`/`aB` | `ir`/`ar`       | `ia`/`aa`      |\n| *opendelim*  | `i(`/`a(`    | `i{`/`a{` | `i[`/`a[`       | `i\u003c`/`a\u003c`      |\n| *closedelim* | `i)`/`a)`    | `i}`/`a}` | `i]`/`a]`       | `i\u003e`/`a\u003e`      |\n\n* these text objects are exactly equal in functionality\n  * this fact is important for the upcoming [expression text objects](#expression-text-objects) and [field text objects](#field-text-objects)\n\n## Expression text objects\n\n* inspired by [vim-textobj-functioncall](https://github.com/machakann/vim-textobj-functioncall)\n\nExpression text objects are a generalization of *function calls*, *function definitions*, *arrays*, *C++ templates*, and more.\nThe general expression of an expression text object is `[text][opendelim][text][closedelim]`.\nAll of the following follow this criteria:\n\n```c\nfunction_call(argument1, argument2, argument3)\nlet dict = { \"key1\": value1, \"key2\", value2 }\nlet a = [\"hello\", \"world\"]\nArray\u003cint\u003e val = new Array\u003cint\u003e\n```\n\n**Expression text objects** have the structure \"{`[ia]`}`e`{`[b()]`/`[B{}]`/`[r[\\]]`/`[a\u003c\u003e]`}\".\n\n`ie*` selects the whole bracket (like \"`a\u003cbracket\u003e`\") preceded by `[count]` [words](https://stackoverflow.com/questions/22931032/vim-word-vs-word).\n\n`ae*` selects the whole bracket (like \"`a\u003cbracket\u003e`\") preceded by `[count]` [WORDs](https://stackoverflow.com/questions/22931032/vim-word-vs-word).\nHowever, if you don't supply a count, it will not default to \"1 WORD\" but rather it\nwill jump to the start of the line.\n\nWith both `ie*` and `ae*`, `motion-sickness` will be smart not to include partial brackets, etc.\n\nThe variable `g:sickness#expression#preferred_shortcut_map` can be set use an alternative set of mappings.\nUtilizing the fact, that `ib`, `i(`, `i)` are [the same](#alias-text-objects), you can set\nthem to the shorter version. Just put either of the following into your vimrc.\n\n```vim\nlet g:sickness#expression#preferred_shortcut_map = 'opendelim'  \" uses {i,a}{(,{,[,\u003c} for expression text objects\nlet g:sickness#expression#preferred_shortcut_map = 'closedelim' \" uses {i,a}{),},],\u003e} for expression text objects\nlet g:sickness#expression#preferred_shortcut_map = 'char'       \" uses {i,a}{b,B,r,a} for expression text objects\n\n\" or if you want to set your own mappings\nlet g:sickness#expression#use_default_maps = 0\n\nomap ieb \u003cplug\u003e(textobj-sickness-expression-parenthesis-i)\nxmap ieb \u003cplug\u003e(textobj-sickness-expression-parenthesis-i)\nomap aeb \u003cplug\u003e(textobj-sickness-expression-parenthesis-a)\nxmap aeb \u003cplug\u003e(textobj-sickness-expression-parenthesis-a)\n\nomap ieB \u003cplug\u003e(textobj-sickness-expression-brace-i)\nxmap ieB \u003cplug\u003e(textobj-sickness-expression-brace-i)\nomap aeB \u003cplug\u003e(textobj-sickness-expression-brace-a)\nxmap aeB \u003cplug\u003e(textobj-sickness-expression-brace-a)\n\nomap ier \u003cplug\u003e(textobj-sickness-expression-bracket-i)\nxmap ier \u003cplug\u003e(textobj-sickness-expression-bracket-i)\nomap aer \u003cplug\u003e(textobj-sickness-expression-bracket-a)\nxmap aer \u003cplug\u003e(textobj-sickness-expression-bracket-a)\n\nomap iea \u003cplug\u003e(textobj-sickness-expression-chevron-i)\nxmap iea \u003cplug\u003e(textobj-sickness-expression-chevron-i)\nomap aea \u003cplug\u003e(textobj-sickness-expression-chevron-a)\nxmap aea \u003cplug\u003e(textobj-sickness-expression-chevron-a)\n```\n\n## Field text objects\n\n* inspired by [vim-textobj-argument](https://github.com/gaving/vim-textobj-argument)\n\n**Field text objects** have the structure \"{`i`,`a`}`f`{`b`/`(`/`)`,`B`/`{`/`}`,`r`/`[`/`]`,`a`/`\u003c`/`\u003e`}\".\n\nAn *inner field* selects the current field, enclosed in the specific brace. Think of\narguments in function, list elements, dictionary entries, etc.\n\nAn *all field* selects an inner field, together with the field delimiter (usually a comma)\n\nThe variable `g:sickness#expression#maps` can be set use an alternative set of mappings.\nUtilizing the fact, that `ib`, `i(`, `i)` are [the same](#alias-text-objects), you can set\nthem to the shorter version. Just put either of the following into your vimrc.\n\n```vim\nlet g:sickness#field#preferred_shortcut_map = 'opendelim'  \" uses {i,a}{(,{,[,\u003c} for field motions\nlet g:sickness#field#preferred_shortcut_map = 'closedelim' \" uses {i,a}{),},],\u003e} for field motions\nlet g:sickness#field#preferred_shortcut_map = 'char'       \" uses {i,a}{b,B,r,a} for field motions\n\n\" or if you want to set it entirely yourself\nlet g:sickness#field#use_default_maps = 0\n\nomap ifb \u003cplug\u003e(textobj-sickness-field-parenthesis-i)\nvmap ifb \u003cplug\u003e(textobj-sickness-field-parenthesis-i)\nomap afb \u003cplug\u003e(textobj-sickness-field-parenthesis-a)\nvmap afb \u003cplug\u003e(textobj-sickness-field-parenthesis-a)\n\nomap ifB \u003cplug\u003e(textobj-sickness-field-brace-i)\nvmap ifB \u003cplug\u003e(textobj-sickness-field-brace-i)\nomap afB \u003cplug\u003e(textobj-sickness-field-brace-a)\nvmap afB \u003cplug\u003e(textobj-sickness-field-brace-a)\n\nomap ifr \u003cplug\u003e(textobj-sickness-field-bracket-i)\nvmap ifr \u003cplug\u003e(textobj-sickness-field-bracket-i)\nomap afr \u003cplug\u003e(textobj-sickness-field-bracket-a)\nvmap afr \u003cplug\u003e(textobj-sickness-field-bracket-a)\n\nomap ifa \u003cplug\u003e(textobj-sickness-field-chevron-i)\nvmap ifa \u003cplug\u003e(textobj-sickness-field-chevron-i)\nomap afa \u003cplug\u003e(textobj-sickness-field-chevron-a)\nvmap afa \u003cplug\u003e(textobj-sickness-field-chevron-a)\n```\n\n4 types of list styles are supported.\nIn other words, these are basis for the unit tests, and for the algorithm governing\nthese text objects.\n\n#### short style\n\n```c\nfoo(arg1, arg2, arg3)\n```\n\n#### opening delimiter-indented style\n\n```c\nfoo_function(arg1, arg2,\n             arg3, another_arg)\n```\n\n#### trailing-symbol style\n\n```c\nfoo_function(\n    arg1,\n    arg2,\n    arg3\n)\n```\n\n#### leading-symbol style\n\n```c\nFoo ( arg1\n    , arg2\n    , arg2\n    , arg3\n    )\n```\n\nThe following gif showcases some examples of expression and field text objects:\n\n![expression text objects cast](https://media.giphy.com/media/dApCdA2gycwomwrIGO/giphy.gif)\n\n## Indent text objects\n\n* inspired by [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object)\n\nThese text objects are meant to support the `ip` and `ap` text objects for selecting\nparagraphs. `ip` and `ap` simply disregard indentation.\n\n| text object  | effect                                        |\n|--------------|-----------------------------------------------|\n| `iip`/`aip`  | Similar to `ip`/`ap`, except it does not exceed the current indentation level. Does accept counts. Mnemonic is \"inner/all indentation paragraph\"|\n| `iil`/`ail`  | Selects the entire current indentation level excluding / including leading and trailing empty lines. Does not accept counts. Mnemonic is \"inner/all indentation level\".|\n| `iib`/`aib`  | Like `ail` and it selects one line of lower indent before and after the section. Does accept counts. Mnemonic is \"inner/all indentation block\". |\n| `iit`/`ait`  | Like `ail` and it selects one line of lower indent before the section. Does accept counts. Mnemonic is \"inner/all indentation top\". |\n\n![Indent text objects cast](https://media.giphy.com/media/hSEh6Plw8e40MhPf2e/giphy.gif)\n\nIn a text like like the following, if you execute `iil` on any line within the\nfunction definition, the line featuring `argument3` will not be selected, but will\nbe detected as probably belonging to the preceding line. This behavior is governed by\nthe `g:sickness#indentation#exclude_leading_indents` variable.\n\n```c\nint my_function(int argument1, int argument2,\n                int argument3) { // \u003c- will not be included in `iil` or `ail` text object\n                                 // if you set g:sickness#indentation#excluse_leading_indents to 0\n    line1();\n    line2();\n    line3();\n    ...\n    lineN();\n}\n```\n\nIf you wish to set the indent mappings yourself, you can do so:\n\n```vim\nlet g:sickness#indentation#use_default_maps = 0\n\nomap iip \u003cplug\u003e(textobj-sickness-indentation-paragraph-i)\nvmap iip \u003cplug\u003e(textobj-sickness-indentation-paragraph-i)\nomap aip \u003cplug\u003e(textobj-sickness-indentation-paragraph-a)\nvmap aip \u003cplug\u003e(textobj-sickness-indentation-paragraph-a)\n\nomap iil \u003cplug\u003e(textobj-sickness-indentation-level-i)\nvmap iil \u003cplug\u003e(textobj-sickness-indentation-level-i)\nomap ail \u003cplug\u003e(textobj-sickness-indentation-level-a)\nvmap ail \u003cplug\u003e(textobj-sickness-indentation-level-a)\n\nomap iib \u003cplug\u003e(textobj-sickness-indentation-block-i)\nvmap iib \u003cplug\u003e(textobj-sickness-indentation-block-i)\nomap aib \u003cplug\u003e(textobj-sickness-indentation-block-a)\nvmap aib \u003cplug\u003e(textobj-sickness-indentation-block-a)\n\nomap iit \u003cplug\u003e(textobj-sickness-indentation-top-i)\nvmap iit \u003cplug\u003e(textobj-sickness-indentation-top-i)\nomap ait \u003cplug\u003e(textobj-sickness-indentation-top-a)\nvmap ait \u003cplug\u003e(textobj-sickness-indentation-top-a)\n```\n\n## Line text objects\n\n* inspired by [vim-textobj-line](https://github.com/kana/vim-textobj-line)\n\n| text object  | effect                             |\n|--------------|------------------------------------|\n| `il`         | Select the current line excluding leading/trailing blank characters (from `^` to `g_`). Does not accept a count. |\n| `al`         | Select the current line including leading/trailing blank characters (from `0` to `$`). Does not accept a count. |\n\nIf you wish to set the mappings yourself, you can do so:\n\n```vim\nlet g:sickness#line#use_default_maps = 0\n\nomap il \u003cplug\u003e(textobj-sickness-line-i)\nxmap il \u003cplug\u003e(textobj-sickness-line-i)\nomap al \u003cplug\u003e(textobj-sickness-line-a)\nxmap al \u003cplug\u003e(textobj-sickness-line-a)\n```\n\n## View text objects\n\n| text object  | effect                             |\n|--------------|------------------------------------|\n| `iv`         | Selects the currently visible window (from `H` to `L`). Does not accept a count. Saves the current position in the [jump list](http://vimdoc.sourceforge.net/htmldoc/motion.html#jumplist).|\n| `av`         | Selects the entire buffer (from `gg` to `G`). Does not accept a count. Saves the current position in the [jump list](http://vimdoc.sourceforge.net/htmldoc/motion.html#jumplist).|\n\nIf you wish to set the mappings yourself, you can do so:\n\n```vim\nlet g:sickness#view#use_default_maps = 0\n\nomap iv \u003cplug\u003e(textobj-sickness-view-i)\nxmap iv \u003cplug\u003e(textobj-sickness-view-i)\nomap av \u003cplug\u003e(textobj-sickness-view-a)\nxmap av \u003cplug\u003e(textobj-sickness-view-a)\n```\n\n## Symbol text objects\n\n| text object  | effect                             |\n|--------------|------------------------------------|\n| `i*`/`a*`    | Similar to `i\"`/`a\"`, but for `*`  |\n| `i_`/`a_`    | Similar to `i\"`/`a\"`, but for `_`  |\n| `i-`/`a-`    | Similar to `i\"`/`a\"`, but for `-`  |\n| `i:`/`a:`    | Similar to `i\"`/`a\"`, but for `:`  |\n| `i@`/`a@`    | Similar to `i\"`/`a\"`, but for `@`  |\n| `i!`/`a!`    | Similar to `i\"`/`a\"`, but for `!`  |\n| `i?`/`a?`    | Similar to `i\"`/`a\"`, but for `?`  |\n| `i/`/`a/`    | Similar to `i\"`/`a\"`, but for `/`  |\n| `i%`/`a%`    | Similar to `i\"`/`a\"`, but for `%`  |\n| `i\\|`/`a\\|`  | Similar to `i\"`/`a\"`, but for `\\|` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgiesel%2Fvim-motion-sickness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhgiesel%2Fvim-motion-sickness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgiesel%2Fvim-motion-sickness/lists"}