Interact with this post using Mastodon or
[Plugin] Extend the vi motions in (neo)vim: vi-motions
Published on
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):
Map | Keybinding | Motion |
---|---|---|
vicmd viins | \e[H \e[F (Home/End) | beginning/end of line |
vicmd viopp | a’ a" a` | select a quoted string or backticks |
vicmd viopp | i’ i" i` | select in a quoted string or backticks |
vicmd viopp | a( a[ a{ a< ab a) a] a} a> aB | select a bracketed segment |
vicmd viopp | i( i[ i{ i< ib i) i] i} i> iB | select in a bracketed segment |
vicmd | cs ds ys | change/delete/add surrounding quotes/brackets |
visual | S | add surrounding quotes/brackets |
This is the list of new motions you’ll get (from the github page):
Map | Keybinding | Motion |
---|---|---|
viopp | v[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 viopp | as aS | select a command |
vicmd viopp | is iS | select 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.
✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
More food for thoughts? Check other posts about: #Zsh #Zsh-Plugins