-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Textobj: item in list "," #58
Comments
In most languages (e.g., lua), you can use the argument textobj from treesitter-textobjects for that already. If your language does not support that, I think it'd make more sense to make a FR there instead of re-implementing the same textobj again here |
Well not really, or at least as much as I know - the argument object works only for arguments in a function call, i.e. it'll work only if the items are bounded by |
as I said, is some languages like in lua, it also works for array elements. If it does not work in your language, it'd therefore make more sense to make a FR there instead of re-implementing the same textobj again here |
Oh you're right - it does work 😅 my bad - I thought I tested it ... |
It would be useful for pure text, e.g. This is a list of items in: rst, md, txt, text, mail files. Here the treesitter solution doesn't work. Also for comments in code scripts that list stuff. Currently I have it working through https://github.com/wellle/targets.vim, it would nice to have it in a nvim plugin. |
Like a sub-sentence? Hmm. I can see a lot of potential edge cases for this (where does the first element in the list start, what about decimal commas and thousand separators, etc.) Could you open a new issue for it since it's somewhat different, and also detail how exactly such a text object should behave? |
Textobj requested
Select item in a list of items separated with
,
and bound by brackets or newlines, e.g:This is similar to argument, but argument is limited to
()
.Inner/Outer Difference
Inner leaves the
,
Outer includes the preceding (following if first item)
,
Vimscript plugin already implementing the textobj
https://github.com/wellle/targets.vim
Filetypes
all
Checklist
The text was updated successfully, but these errors were encountered: