Releases: kylechui/nvim-surround
v2.0.0
2.0.0 (2023-03-11)
⚠ BREAKING CHANGES
Note: The majority of this document is auto-generated, and I don't fully remember if anything else has changed in the diff since v1.0.0. If you notice anything missing, please open an issue and I can add it here!
- The function
get_char
has been moved fromutils
toinput
. - The function
get_delimiters
has been moved fromutils
toconfig
. - The
textobject
field forconfig.get_selection
has been deprecated; please usemotion
instead. See this comment.- To update your functions, prepend 'a' to the
textobject
key, i.e.(
→a(
- To update your functions, prepend 'a' to the
- The highlight group used has been renamed from
NvimSurroundHighlightTextObject
toNvimSurroundHighlight
. See this comment. - User defined
invalid_key_behavior
handlers will be activated for control characters that don't have definedsurrounds
. In other words,<C-a>
is now a valid input that can be passed toinvalid_key_behavior
. See this comment.- Note:
<C-c>
is still invalid, and terminates the input.
- Note:
- Smart quotes have been removed. Modifying quotes will now always operate on the immediately surrounding pair of quotes. See this comment.
Features
- Add
node
field toconfig.get_selection
, allowing users to retrieve selections based on treesitter nodes. - Add
indent_lines
field tosetup
, allowing users to configure what indentation program should be used for certain line-wise surrounds (if any). - Add
<Plug>
mappings; decouple mappings. (af10059) - Add
exclude
key toconfig.get_selections
. (e2c22a6) - Implement basic query-matching. (a634889)
Bug Fixes
<Plug>(nvim-surround-insert)
mapping. (#176) (6b45fbf)- Add indentation when using line mode. (#185) (9da7ced)
- Add protected call around Tree-sitter module. (d91787d)
- Change
reset_cursor
semantics. (a207e3b) - Change type annotations to
|nil
from?
. (1ac5abf) - Correctly restore visual selection marks. (#155) (c6a1993)
- Failing test cases due to Tree-sitter dependency. (c057fb8)
- Fix catastrophic error that broke everything. (c323fa5)
- Fix quote bug, closes #172. (58b0a55)
- Handle special characters for
getchar
. (#170) (1f79449) - Improper look-behind for quotes. (1d83fec)
- Improper table handling for
add
, resolves #191. (d51d554) - Minor bugs. (7f7ca04)
- Properly handle linewise normal surrounds. (90821ad)
- Remove
remap = true
from keymaps. (#219) (89c82e7) - Revert some changes. (ce01942)
- Revert to pattern-based function calls by default. (ba19320)
- Support Lua 5.1 instead of only LuaJIT. (#169) (fa7648e)
- Tweak pattern for function calls. (3accef6)
- Update function pattern. (c0835d2)
- Use
line_mode
parameter when possible. (#194) (ad56e62) - utils: Ensure chars is a table in ipairs. (#192) (64e2106)
- Error when
vim.o.selection='exclusive'
. (#158) (81f672a)
Additional Notes
Sorry for the long time in between releases everybody, I thought I could implement queries support in a sensible way in a short amount of time, but it quickly became much more to handle than I had thought. Moving forwards, I aim to make the plugin "more stable" and to improve the user experience:
- Be more consistent with SemVer releases (i.e. version more frequently)
- Improve the automated testing suite
- Improve the documentation (considering automated documentation)
- Improve the customizability of the plugin (it should do what you think it does)
- This is somewhat accomplished in the current release, as more fields can be set to
false
, but could still use some work
- This is somewhat accomplished in the current release, as more fields can be set to
Thanks again to everyone for using this!
v1.0.0
This marks the first official release of nvim-surround
! 🎉
Features
- Add/delete/change surrounding delimiter pairs
- Function calls and HTML tags have built-in support
- Use functions to define what pairs to add to the buffer
- Use functions to define what selections to modify
- Vim text-objects and Lua patterns have first-class support
- Dot-repeat previous surround actions
- Jump to the "nearest" surrounding pair for modification
- Alias characters to represent other keys
- Highlight selections to be surrounded or modified
Future Goals
As of right now, nvim-surround
uses built-in Vim text-objects or Lua patterns to find the "parent selection" that contains a surrounding pair. I intend on expanding this ideology to Tree-sitter nodes as well, so things can be run properly, even if nvim-treesitter-textobjects
is not installed.
Thanks
Massive thanks goes out to everybody that's helped me out with feedback and ideas on how to design this plugin, especially those that have submitted PRs. Also thanks to everybody that's filed a feature request or bug report.
Thanks for using nvim-surround
, I hope it's as much of a joy to use as it is for me to write 💖