Updates of ‘mini.surround’: tree-sitter support and more

update
reddit
Tree-sitter support, “last”/“next” extended mappings, aliases, and more
Author

Evgeni Chasnovski

Published

August 28, 2022

Originally posted on Reddit

Hello, Neovim users!

I am happy to announce new features of ‘mini.surround’ - module of ‘mini.nvim’ for surrounding actions (add, delete, replace, find, highlight surrounding characters). All actions are dot-repeatable out of the box and operate on highly customizable set of surrounding identifiers. By default it defines mappings with common s prefix (sa for add, sd for delete, sr for replace, sf for find, sh for highlight), but setup similar to ‘tpope/vim-surround’ is, of course, also possible.

This update was prompted after the release of ‘mini.ai’ which can create custom textobjects. Its initial implementation was based on ‘mini.surround’ but in the process it got transformed into much more powerful design (at cost of some code and documentation complexity). Ironically, ‘mini.surround’ is now updated to share as much with ‘mini.ai’ as possible, which provides more integrated experience.

New features:

Check it out and tell me what you think. Thanks!