{"id":15387309,"url":"https://github.com/rhysd/vim-textobj-ruby","last_synced_at":"2025-04-14T10:04:47.189Z","repository":{"id":5388107,"uuid":"6576460","full_name":"rhysd/vim-textobj-ruby","owner":"rhysd","description":"Make text objects with various ruby block structures.","archived":false,"fork":false,"pushed_at":"2019-04-20T19:26:13.000Z","size":22,"stargazers_count":57,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T10:04:42.031Z","etag":null,"topics":[],"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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysd.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":"2012-11-07T09:03:23.000Z","updated_at":"2025-02-06T14:34:13.000Z","dependencies_parsed_at":"2022-07-06T14:31:19.243Z","dependency_job_id":null,"html_url":"https://github.com/rhysd/vim-textobj-ruby","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/rhysd%2Fvim-textobj-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-textobj-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-textobj-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Fvim-textobj-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/vim-textobj-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860296,"owners_count":21173342,"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-10-01T14:53:36.372Z","updated_at":"2025-04-14T10:04:47.141Z","avatar_url":"https://github.com/rhysd.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Make text objects with various ruby block structures\n\nThis Vim plugin makes text objects with various ruby block structures.\nMany end-terminated blocks are parsed using regex, indentation and syntax highlight.\nThis is more correct than parsing text with regex only.\n\nThis plugin requires [vim-textobj-user](https://github.com/kana/vim-textobj-user)\n\n## Simple one operator-pending mapping `r`\n\nOperator-pending mapping `r` is added. `dir`, `yar` and other mappings are available like `diw`, `yi'`.\n`if`, `unless`, `case`, `while`, `until`, `for`, `def`, `module`, `class`, `do`, `begin` blocks are selected as text-objects.\n\nExample:\n\n`#\\%` is the place of your cursor.\n\n```ruby\ndef hoge(yo)\n    if yo\n        puts \"yo!\"\n        #\\%\n    end\n    puts \"everyone!\"\nend\n```\n\nTyping `dar` removes whole `if` block\n\n```ruby\ndef hoge(yo)\n    #\\%\n    puts \"everyone!\"\nend\n```\n\nor `dir` removes innner `if` block.\n\n```ruby\ndef hoge(yo)\n    if yo\n    #\\%\n    end\nend\n```\n\nWhen a cursor places at line 6,\n\n```ruby\ndef hoge(yo)\n    if yo\n        puts \"yo!\"\n        \n    end\n    puts \"everyone!\" #\\%\nend\n```\n\ntype `dir` removes inner `def` block.\n\n```ruby\ndef hoge(yo)\nend\n```\n\nOnly bellow mapping is defined.\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n        \u003cth\u003eBlocks\u003c/th\u003e\n        \u003cth\u003eOperator-pending Mappings\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eany block with end-terminated\u003c/td\u003e\n        \u003ctd\u003eall blocks\u003c/td\u003e\n        \u003ctd\u003er\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Or many operator-pending mappings for Ruby blocks\n\nIf you set `g:textobj_ruby_more_mappings` to `1`, more mappings are defined.\nYou can specify kinds of Ruby blocks.\nIf you remember all mappings, it will be more convenient.\n\nCombinations of textobjects and Ruby blocks are below.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n        \u003cth\u003eBlocks\u003c/th\u003e\n        \u003cth\u003eOperator-pending Mappings\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003edefinitions blocks\u003c/td\u003e\n        \u003ctd\u003emodule, class, def\u003c/td\u003e\n        \u003ctd\u003ero\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eloop blocks\u003c/td\u003e\n        \u003ctd\u003ewhile, for, until\u003c/td\u003e\n        \u003ctd\u003erl\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003econtrol blocks\u003c/td\u003e\n        \u003ctd\u003edo, begin, if, unless, case\u003c/td\u003e\n        \u003ctd\u003erc\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003edo statement\u003c/td\u003e\n        \u003ctd\u003edo\u003c/td\u003e\n        \u003ctd\u003erd\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eany block including above all\u003c/td\u003e\n        \u003ctd\u003eall blocks\u003c/td\u003e\n        \u003ctd\u003err\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-textobj-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Fvim-textobj-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Fvim-textobj-ruby/lists"}