One of my favorite features of this release, is the inclusion of text objects and visual mode for vi-mode (bindkey -v).
If anyone uses vi-mode instead of the default emacs-mode, they know how sorely text objects support was missing. Here's an example: in normal mode, if the cursor was at "e" in the word "hello", you would have to hit "b" to go to the beginning of the word and then use "ce" or "cw". Now you have the full power of text objects, which means you can use ciw, diw, etc. With visual-mode support, you can even now cut a region, or yank and paste.
If you like the text object support, make sure to check out the select-quoted and select-bracketed functions under Functions/Zle. They implement things like ci" and ci( but you have to manually enable them because they're shell functions. There's also a surround function that works like the popular surround vim plugin.
Also note that ia and aa are text objects for shell arguments using zsh's internal lexer.
2 comments
[ 3.5 ms ] story [ 12.0 ms ] threadIf anyone uses vi-mode instead of the default emacs-mode, they know how sorely text objects support was missing. Here's an example: in normal mode, if the cursor was at "e" in the word "hello", you would have to hit "b" to go to the beginning of the word and then use "ce" or "cw". Now you have the full power of text objects, which means you can use ciw, diw, etc. With visual-mode support, you can even now cut a region, or yank and paste.