Pre-release v2.0.0 #141
Replies: 2 comments 21 replies
-
As far as I can tell, the only purpose of filetype setup is to declare which tree-sitter node defines target object. Is this the case? If it is indeed, I would recommend using more tree-sitter native approach to solving this problem by relying on queries. Here how this is done in nvim-treesitter/nvim-treesitter-textobjects. Basically, for every filetype there is a file which with help of tree-sitter query magic defines captures which can be used along with other nodes. You can either create your own queries (maybe by cherry-picking ones from nvim-treesitter-textobjects) with "namespaced" captures or tell users how to get/set those queries. This is the way I decided to go in 'mini.ai' and soon will be the case in 'mini.surround'. With this approach there is no need to create all these autocommands but rather use something like |
Beta Was this translation helpful? Give feedback.
-
I think |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody! This thread will be dedicated to discussing the upcoming
v2.0.0
and its new feature set/tweaked user configuration interface. Please feel free to express your thoughts on the update in the comments below: suggestions, bug fixes, and general comments are all welcome! I would really like to stabilize the user configuration interface once and for all, so if there are names that are even slightly confusing/seem out of place, please tag me and let me know.Here's the list of breaking changes since
v1.0.0
. They're all relatively minor renames, so hopefully it's not too bad :)New Features
:h nvim-surround.config.get_selection()
nvim-surround
indentation can be disabled by setting the new keyindent_lines = false
; see:h nvim-surround.config.indent_lines
Here's a small example of how the new Tree-sitter nodes can be used to discern what patterns could not:
treesitter_demo_2.mp4
I'm still not 100% sure on whether or not I want to set up filetype-specific surrounds by default, but the list that I was planning on using can be found here.
Beta Was this translation helpful? Give feedback.
All reactions