This repository was archived by the owner on Feb 12, 2026. It is now read-only.
Supported word character before/after [:space:], ^ or $, \W#5
Open
tyru wants to merge 1 commit intolucapette:masterfrom
Open
Supported word character before/after [:space:], ^ or $, \W#5tyru wants to merge 1 commit intolucapette:masterfrom
tyru wants to merge 1 commit intolucapette:masterfrom
Conversation
Support 3 extra cases. - `a_` Keymapping 1. `" [foo_]bar_baz"` 2. `"[foo_]bar_baz"` 3. `":[smile]:"` - `i_` Keymapping 1. `" [foo]_bar_baz"` 2. `"[foo]_bar_baz"` 3. `":[smile]:"` and if no matching text-object is found, both `i_` and `a_` select nothing (functions return `0`). # `a_` Keymapping ## Start Pos Search for... 1\. `_` (`"foo[_]bar[_]baz"`) - This is a supported character currently. Word character after 2\. `[:space:]` (`" [f]oo_bar_baz"`) 3\. `^` (`"[f]oo_bar_baz"`) 4\. `\W` (`":[s]mile:"`) ## End Pos Search for... 1\. `_` (`"foo[_]bar[_]baz"`) - This is a supported character currently. Word character before 2\. `[:space:]` (`"foo_bar_ba[z] "`) 3\. `$` (`"foo_bar_ba[z]"`) 4\. `\W` (`":smil[e]:"`) # `i_` Keymapping ## Start Pos Word character after 1. `_` (`"foo_[b]ar_[b]az"`) - This is a supported character currently. 2. `[:space:]` (`" [f]oo_bar_baz"`) 3. `^` (`"[f]oo_bar_baz"`) 4. `\W` (`":[s]mile:"`) ## End Pos Word character before 1. `_` (`"fo[o]_ba[r]_baz"`) - This is a supported character currently. 2. `[:space:]` (`"foo_bar_ba[z] "`) 3. `$` (`"foo_bar_ba[z]"`) 4. `\W` (`":smil[e]:"`)
|
Tested this and it works great for me! Thanks @tyru 👍 |
|
Agreed, this covers missing functionality for me too, thanks @tyru |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry, almost implementation were rewritten.
However, I thought I should send a pull request
because I hope this saves existing vim-textobj-underscore users too :)
Supported 3 extra cases.
a_Keymapping" [foo_]bar_baz""[foo_]bar_baz"":[smile]:"i_Keymapping" [foo]_bar_baz""[foo]_bar_baz"":[smile]:"and if no matching text-object is found, both
i_anda_select nothing (functions return0).a_KeymappingStart Pos
Search for...
_("foo[_]bar[_]baz")Word character after
[:space:](" [f]oo_bar_baz")^("[f]oo_bar_baz")\W(":[s]mile:")End Pos
Search for...
_("foo[_]bar[_]baz")Word character before
[:space:]("foo_bar_ba[z] ")$("foo_bar_ba[z]")\W(":smil[e]:")i_KeymappingStart Pos
Word character after
_("foo_[b]ar_[b]az")[:space:](" [f]oo_bar_baz")^("[f]oo_bar_baz")\W(":[s]mile:")End Pos
Word character before
_("fo[o]_ba[r]_baz")[:space:]("foo_bar_ba[z] ")$("foo_bar_ba[z]")\W(":smil[e]:")