{"id":13850502,"url":"https://github.com/terryma/vim-expand-region","last_synced_at":"2025-05-16T10:06:34.933Z","repository":{"id":7747769,"uuid":"9115072","full_name":"terryma/vim-expand-region","owner":"terryma","description":"Vim plugin that allows you to visually select increasingly larger regions of text using the same key combination.","archived":false,"fork":false,"pushed_at":"2024-06-28T01:56:54.000Z","size":1105,"stargazers_count":1113,"open_issues_count":15,"forks_count":45,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T06:25:58.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"VimL","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/terryma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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":"2013-03-30T11:47:45.000Z","updated_at":"2025-04-13T00:08:21.000Z","dependencies_parsed_at":"2024-09-30T11:01:06.686Z","dependency_job_id":null,"html_url":"https://github.com/terryma/vim-expand-region","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.1428571428571429,"last_synced_commit":"966513543de0ddc2d673b5528a056269e7917276"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-expand-region","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-expand-region/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-expand-region/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-expand-region/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terryma","download_url":"https://codeload.github.com/terryma/vim-expand-region/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509476,"owners_count":22082891,"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-08-04T20:01:14.988Z","updated_at":"2025-05-16T10:06:34.917Z","avatar_url":"https://github.com/terryma.png","language":"VimL","funding_links":[],"categories":["VimL","Vim Script","Included Plugins","Tools"],"sub_categories":["Install for multiple users","Editing"],"readme":"# vim-expand-region\n\n## About\n[vim-expand-region] is a Vim plugin that allows you to visually select increasingly larger regions of text using the same key combination. It is similar to features from other editors:\n\n- Emac's [expand region](https://github.com/magnars/expand-region.el)\n- IntelliJ's [syntax aware selection](http://www.jetbrains.com/idea/documentation/tips/#tips_code_editing)\n- Eclipse's [select enclosing element](http://stackoverflow.com/questions/4264047/intellij-ctrlw-equivalent-shortcut-in-eclipse)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.github.com/terryma/vim-expand-region/master/expand-region.gif\" alt=\"vim-expand-region\" /\u003e\n\u003c/p\u003e\n\n## Installation\nInstall using [Pathogen], [Vundle], [Neobundle], or your favorite Vim package manager.\n\n## Quick Start\nPress ```+``` to expand the visual selection and ```_``` to shrink it.\n\n## Mapping\nCustomize the key mapping if you don't like the default.\n\n```\nmap K \u003cPlug\u003e(expand_region_expand)\nmap J \u003cPlug\u003e(expand_region_shrink)\n```\n\n## Setting\n### Customize selected regions\nThe plugin uses __your own__ text objects to determine the expansion. You can customize the text objects the plugin knows about with ```g:expand_region_text_objects```.\n\n```vim\n\" Default settings. (NOTE: Remove comments in dictionary before sourcing)\nlet g:expand_region_text_objects = {\n      \\ 'iw'  :0,\n      \\ 'iW'  :0,\n      \\ 'i\"'  :0,\n      \\ 'i''' :0,\n      \\ 'i]'  :1, \" Support nesting of square brackets\n      \\ 'ib'  :1, \" Support nesting of parentheses\n      \\ 'iB'  :1, \" Support nesting of braces\n      \\ 'il'  :0, \" 'inside line'. Available through https://github.com/kana/vim-textobj-line\n      \\ 'ip'  :0,\n      \\ 'ie'  :0, \" 'entire file'. Available through https://github.com/kana/vim-textobj-entire\n      \\ }\n```\n\nYou can extend the global default dictionary by calling ```expand_region#custom_text_objects```:\n\n```vim\n\" Extend the global default (NOTE: Remove comments in dictionary before sourcing)\ncall expand_region#custom_text_objects({\n      \\ \"\\/\\\\n\\\\n\\\u003cCR\u003e\": 1, \" Motions are supported as well. Here's a search motion that finds a blank line\n      \\ 'a]' :1, \" Support nesting of 'around' brackets\n      \\ 'ab' :1, \" Support nesting of 'around' parentheses\n      \\ 'aB' :1, \" Support nesting of 'around' braces\n      \\ 'ii' :0, \" 'inside indent'. Available through https://github.com/kana/vim-textobj-indent\n      \\ 'ai' :0, \" 'around indent'. Available through https://github.com/kana/vim-textobj-indent\n      \\ })\n```\n\nYou can further customize the text objects dictionary on a per filetype basis by defining global variables like ```g:expand_region_text_objects_{ft}```.\n\n```vim\n\" Use the following setting for ruby. (NOTE: Remove comments in dictionary  before sourcing)\nlet g:expand_region_text_objects_ruby = {\n      \\ 'im' :0, \" 'inner method'. Available through https://github.com/vim-ruby/vim-ruby\n      \\ 'am' :0, \" 'around method'. Available through https://github.com/vim-ruby/vim-ruby\n      \\ }\n```\n\nNote that this completely replaces the default dictionary. To extend the default on a per filetype basis, you can call ```expand_region#custom_text_objects``` by passing in the filetype in the first argument:\n\n```vim\n\" Use the global default + the following for ruby\ncall expand_region#custom_text_objects('ruby', {\n      \\ 'im' :0,\n      \\ 'am' :0,\n      \\ })\n```\n\n### Customize selection mode\nBy default, after an expansion, the plugin leaves you in visual mode. If your ```selectmode```(h:selectmode)) contains ```cmd```, then the plugin will respect that setting and leave you in select mode. If you don't have ```selectmode``` set, but would like to default the expansion in select mode, you can use the global setting below:\n\n```vim\nlet g:expand_region_use_select_mode = 1\n```\n\n[vim-expand-region]:http://github.com/terryma/vim-expand-region\n[Pathogen]:http://github.com/tpope/vim-pathogen\n[Vundle]:http://github.com/gmarik/vundle\n[Neobundle]:http://github.com/Shougo/neobundle.vim\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/terryma/vim-expand-region/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterryma%2Fvim-expand-region","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterryma%2Fvim-expand-region","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterryma%2Fvim-expand-region/lists"}