www-gem words

[Plugin] Extend the vi motions in (neo)vim: vi-motions

Published on

zsh When you’re both a (neo)vim and zsh user, the best of both world meets when you activate the vi motions in zsh with the command bindkey -v in the zsh config file.

This will activate few vi motions. Some of them, even though built-in zsh, needs to be loaded. But if we could do so and add even more vi motions? That’s what the vi-motions offers. There are other plugins but this one simply fill the bill for me in terms of functionalities and simplicity.

Here is the list of motions distributed with zsh that this plugin will load (from the github page):

MapKeybindingMotion
vicmd viins\e[H \e[F (Home/End)beginning/end of line
vicmd vioppa’ a" a`select a quoted string or backticks
vicmd vioppi’ i" i`select in a quoted string or backticks
vicmd vioppa( a[ a{ a< ab a) a] a} a> aBselect a bracketed segment
vicmd vioppi( i[ i{ i< ib i) i] i} i> iBselect in a bracketed segment
vicmdcs ds yschange/delete/add surrounding quotes/brackets
visualSadd surrounding quotes/brackets

This is the list of new motions you’ll get (from the github page):

MapKeybindingMotion
vioppv[motion]Force motion character-wise,
or toggle exclusivity (see :h forced-motion in Vim)
vicmd viopp visual) ( g) g(move forward/back to start/end of command
vicmd vioppas aSselect a command
vicmd vioppis iSselect in a command (exclude terminating ;
and control flow words)
vicmd viopp visual(Not enabled by default)Move forward/back to start/end
of $WORDCHARS-dependant words
vicmd viopp visual(Not enabled by default)Move forward/back to start/end
of shell words

Thanks for your read. Hope it's been useful to you.


Interact with this post using Mastodon or

Comment on wwwgem's post

Copy and paste this URL into the search field of your favourite Fediverse app or the web interface of your Mastodon server.

✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈

More food for thoughts? Check other posts about: #Zsh #Zsh-Plugins