Thanks for the comparison on tree-sitter and LSP. I am not sure if it's just me ... but the end is the best. I feel unsatisfied or missing out on something ;)
Well we ended up talking about more stuff on stream, but it didn't make sense to leave it all in the video. Sometime in the future, I will probably demo more things with tree sitter.
I recently switched from ST3 to VIM (then nvim, thanks) & yesterday i stumbled upon a problem, can treesitter be configured to create custom multiline textobjects?: I wanted to copy just the query that was structured like this: (" SELECT epstein, did, not FROM kill ORDER BY himself ") Noticed that yi" did not work as i expected, after a quick googling i found out vim doesn't do multiline textobjects inside quotes (kinda weird since it can do it inside (){}[] etc etc) & i did not find alot of good solutions to my problem, so i did a big brain move & did yi( instead, great, now i can use ds" to get rid of the quotes, turns out, nope, surround also seem to rely on the built in textobjects So, is it worth me experimenting with treesitter & implement a way to include quotes into the list of multiline textobjects? Is that something tresitter can do? Also, i guess you guys will never ever add " to the (){}[] list of multilines/block objects in nvim since it's out of spec for VIM? (and i guess it would break to many peoples workflow/configs)
I think there are plugins to do something like this. I suppose it's possible with tree sitter. You might want to check out either vim-surround, vim-sandwhich or maybe some other plugin that makes custom text objects. I think one of those would probably do what you're hoping for. Also, great example LUL
@@teej_dv Thanks for the reply 👍 I tested those but did not get them to work as i expected, i'm an idiot so thats probably why :D Anyways, eventually ended up with these plugins: Plug 'kana/vim-textobj-user' Plug 'kana/vim-textobj-indent' Plug 'beloglazov/vim-textobj-quotes' Works good enough for me now but not a big fan of loading/using 3 plugins for such a simple task but hey atleast it works ;)
TJ, you are a gold mine of info. Thank you for sharing this kind of stuff!
My pleasure! 😁
Thanks for the comparison on tree-sitter and LSP. I am not sure if it's just me ... but the end is the best. I feel unsatisfied or missing out on something ;)
Well we ended up talking about more stuff on stream, but it didn't make sense to leave it all in the video.
Sometime in the future, I will probably demo more things with tree sitter.
why it ends when the interesting part comes!?!?
Great content man! ✌️
I recently switched from ST3 to VIM (then nvim, thanks) & yesterday i stumbled upon a problem, can treesitter be configured to create custom multiline textobjects?:
I wanted to copy just the query that was structured like this:
("
SELECT
epstein,
did,
not
FROM
kill
ORDER BY
himself
")
Noticed that yi" did not work as i expected, after a quick googling i found out vim doesn't do multiline textobjects inside quotes (kinda weird since it can do it inside (){}[] etc etc) & i did not find alot of good solutions to my problem, so i did a big brain move & did yi( instead, great, now i can use ds" to get rid of the quotes, turns out, nope, surround also seem to rely on the built in textobjects
So, is it worth me experimenting with treesitter & implement a way to include quotes into the list of multiline textobjects? Is that something tresitter can do?
Also, i guess you guys will never ever add " to the (){}[] list of multilines/block objects in nvim since it's out of spec for VIM? (and i guess it would break to many peoples workflow/configs)
I think there are plugins to do something like this. I suppose it's possible with tree sitter. You might want to check out either vim-surround, vim-sandwhich or maybe some other plugin that makes custom text objects. I think one of those would probably do what you're hoping for.
Also, great example LUL
@@teej_dv Thanks for the reply 👍
I tested those but did not get them to work as i expected, i'm an idiot so thats probably why :D
Anyways, eventually ended up with these plugins:
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-indent'
Plug 'beloglazov/vim-textobj-quotes'
Works good enough for me now but not a big fan of loading/using 3 plugins for such a simple task but hey atleast it works ;)
Thanks sir
do you do grep Vids
thanks
Comparison: th-cam.com/video/c17j09vY5sw/w-d-xo.htmlsi=7SyimfUTqKutf4SY&t=215