{"id":21517632,"url":"https://github.com/tek/vim-textobj-ruby","last_synced_at":"2025-07-16T06:32:35.454Z","repository":{"id":147945015,"uuid":"18606892","full_name":"tek/vim-textobj-ruby","owner":"tek","description":"some textobjects for ruby","archived":false,"fork":false,"pushed_at":"2014-10-20T01:44:29.000Z","size":280,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-27T08:24:06.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"VimL","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/tek.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}},"created_at":"2014-04-09T17:46:37.000Z","updated_at":"2023-03-27T08:43:44.413Z","dependencies_parsed_at":"2023-03-27T08:43:44.318Z","dependency_job_id":null,"html_url":"https://github.com/tek/vim-textobj-ruby","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fvim-textobj-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fvim-textobj-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fvim-textobj-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fvim-textobj-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tek","download_url":"https://codeload.github.com/tek/vim-textobj-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226113177,"owners_count":17575436,"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":[],"created_at":"2024-11-24T00:43:52.301Z","updated_at":"2024-11-24T00:43:53.735Z","avatar_url":"https://github.com/tek.png","language":"VimL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nThis defines four ruby text objects – block, class, function and name.\nA block is delimited by the regex in the variable `g:ruby_block_openers` and\n`end`.\nA function is a special case of block, starting with `def`, class works the\nsame way.\nThe inner variant doesn't include the delimiter lines.\n\nA name is a module-scoped identifier like `Module::Klass`.\n\n## Usage\n\nBy default, the omaps `ir` and `ar` are used for a block; `if` and `af` for a\nfunction, `ic`, `ac` for a class and `an` for a name.\n\nSpecifying a count selects outer blocks recursively.\n\n## Customization\n\nThe variable `g:textobj_ruby_inclusive` controls whether leading comments and a\nsingle blank line are included in the `a` object if present, defaulting to 1.\n\nConsult the documentation of [textobj-user][1] for custom mappings.\n\nIf `g:textobj_ruby_inner_branch` is `1`, the inner block object will select the\nlines between `else`, `elsif`, `rescue` and `ensure` (configurable via\n`g:ruby_block_middles`) and the boundaries instead of including all conditional\nbranches.\n\nIf `g:textobj_ruby_no_mappings` is `1`, no actual mappings are created.\n\n## Details\n\nThe plugin uses a consistent line based approach, with the lines containing the\ndelimiters being part of the block.\nThis means that invoking the text object on the word before a `do` will select\nthe block opened by it, which is especially useful on empty blocks.\nWhen the `ir` object is used on the opener line, the selection will begin on\nthe next line.\n\nThe reason for inclusive mode is that when deleting or copying a function, you\nmost likely want to paste it somewhere else and not leave an additional empty\nline around (given that you separate all functions by a single blank line).\nComments directly above a block are most likely connected to it, so leaving\nthem would be impractical.\n\nWhen invoked multiple times in visual mode, the selection grows to the next\nlarger block, just like when invoking the operator with a count.\nTo decide whether to grow, the visual selection is checked – if start and end\ndo not match, it is assumed that the selection is already a block.\nThis can result in faulty behaviour when invoked from visual mode with o\nnonzero selection and the cursor on the end delimiter line – the next outer\nblock will be selected.\n\n## Dependencies\n\n[textobj-user][1]\n\n## License\n\nCopyright (c) Torsten Schmits. Distributed under the terms of the [MIT\nLicense][2].\n\n[1]: https://github.com/kana/vim-textobj-user 'textobj-user'\n[2]: http://opensource.org/licenses/MIT 'mit license'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fvim-textobj-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftek%2Fvim-textobj-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fvim-textobj-ruby/lists"}