49

GitHub - tommcdo/vim-ninja-feet: Strike from the cursor to either end of a text...

 4 years ago
source link: https://github.com/tommcdo/vim-ninja-feet
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

ninja-feet.vim

In Practical Vim by Drew Neil, a cute illustration outlines the difference between Vim's standard motions and text objects. In short, we see a ninja kicking in one direction (a motion) compared to a ninja kicking in two directions (a text object).

Ninja with feet

While Vim has a great number of wonderful text objects, and plugins can add even more, there is no general way to operate from the cursor to the beginning or end of those text objects.

Well, now there is. ninja-feet.vim lets you do so by putting [ or ] between the operator and the text object. For example, d]i) deletes from the cursor to the end of the current parenthetical term. c[ip changes from the cursor to the beginning of the paragraph.

You can also jump into Insert mode at the beginning or end of a text object (technically, any motion) with z[ and z].


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK