You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select item in a list of items separated with , . Although treesitter parsers already do this for code (#58) via the in argument mechanic nvim-treesitter-textobjects, it would be useful to have it for lists in pure text, e.g.
This is a list of items in: rst, md, txt, text, mail files.
Also could come in handy for comments in code scripts that list stuff.
The syntax would be i<separator> for inner and a<separator> for outer. Here <separator> can be ,, ;, ...
Inner/Outer Difference
In it's simplest use-case - inner i, would not take the separator, and around a, would e.g. if your cursor is on text then:
This is a list of items in: rst, md, txt, text, mail files.
|--| inner
outer |----|
Edge cases would be the first element:
the right bound is the ,
the left bound:
if there is a : or - starting the list than it is taken as a bound of the first item,
if not then the first item could be a single word.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, for example "bump", and it will be kept open.
Textobj requested
Select item in a list of items separated with
,
. Although treesitter parsers already do this for code (#58) via the in argument mechanic nvim-treesitter-textobjects, it would be useful to have it for lists in pure text, e.g.Also could come in handy for comments in code scripts that list stuff.
The syntax would be
i<separator>
for inner anda<separator>
for outer. Here<separator>
can be,
,;
, ...Inner/Outer Difference
In it's simplest use-case - inner
i,
would not take the separator, and arounda,
would e.g. if your cursor is ontext
then:This is a list of items in: rst, md, txt, text, mail files. |--| inner outer |----|
Edge cases would be the first element:
,
:
or-
starting the list than it is taken as a bound of the first item,And for the last element:
.
and
if there is one,
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: