Show HN: A New Basic Vim Motion
github.com
Show HN: A New Basic Vim Motion
1–10 of 43 posts
Re: Show HN: A New Basic Vim Motion
#2Re: Show HN: A New Basic Vim Motion
#3You should lower your ambitions and just make this a function one can key bind to a char of their choice.
Have you tried submitting this to vim as a patch instead? I doubt it would be approved, for a good reason. Nice work though.
Re: Show HN: A New Basic Vim Motion
#4I like the idea, but am more reluctant about the keybindings--I use `s` almost every day. More importantly, I'm infatuated with the marriage Vim has between motions and actions-over-a-range, and think it's very weird to have motion commands that are only available after {d, c, y}.
Regarding the motions with d, c and y, just to clarify the seek motion is available anytime. As for the others, they work similarly to iw, i" &c, and I think these operator pending motions add a great layer of flexibility to vim without needing extra base keys.
Re: Show HN: A New Basic Vim Motion
#5Re: Show HN: A New Basic Vim Motion
#6Interesting, but I am not willing to surrender a basic key binding like `s` with what can be done with /. It is only an extra key to do the same thing. You should lower your ambitions and just make this a function one can key bind to a char of their choice. Have you tried submitting this to vim as a patch instead? I doubt it would be approved, for a good reason. Nice work though.
Re: Show HN: A New Basic Vim Motion
#7EasyMotion allows make any movement, say "w" for forward by word, and will then highlight the beginning of every word on the screen with a "target key". Pressing that target key will take you to that word. Similarly, doing "j" will do the same, but with every line down from your line (j=down), making jumping to any line, anywhere, as easy as "j{letter}". I have EasyMotion bound to the "space" key, and I use a fork of EasyMotion that automatically highlight with 2 letters instead of one (the default is to higlight with one, and if anything is ambiguous, after pressing the first key you'll get another key to press. With this fork, you never have to "press a key then wait", you always press the two keys that appear). I also have the letters to use mapped to something like: "asdfghjkl", e.g. the homerow keys in order, because if I mistype one of the keys, EasyMotion will take me pretty near.
Re: Show HN: A New Basic Vim Motion
#8This sounds very similar to EasyMotion, which is an amazing plugin that I hope everyone tries. EasyMotion allows make any movement, say "w" for forward by word, and will then highlight the beginning of every word on the screen with a "target key". Pressing that target key will take you to that word. Similarly, doing " j" will do the same, but with every line down from your line (j=down), making jumping to any line, a…
So I find EasyMotion great for getting across lines and around the screen, but within the line I think seek is a more fundamental solution.
Re: Show HN: A New Basic Vim Motion
#9This sounds very similar to EasyMotion, which is an amazing plugin that I hope everyone tries. EasyMotion allows make any movement, say "w" for forward by word, and will then highlight the beginning of every word on the screen with a "target key". Pressing that target key will take you to that word. Similarly, doing " j" will do the same, but with every line down from your line (j=down), making jumping to any line, a…
I should have mentioned EasyMotion in the readme! Or should I.. I should right? I love it, and also recommend everyone to try. But there's just one thing about it: you need to trigger it first to see what you have to press to get to your target. By creating seek I was able to literally make it a three-keystrokes action, I don't need to wait a split second to know what I need to type as the target, I'm already looking…
And I think you should mention EasyMotion in the Readme, I'm probably not the only one around who uses that plugin and many people probably have the same question/
Re: Show HN: A New Basic Vim Motion
#10Semicolon will repeat the last jump command, and comma will repeat it in the opposite direction.
I find this very useful not only for mismatches that I didn't see, but also for help with quickly formatting text. Along side . to repeat an action, it's incredibly fast to use ; to repeat your last jump (like to delete the surrounding html tag). This is a just one example, but it's a quick and easy pattern I use to do things like selectively stripping html tags within a string that has some inline html, or moving around quickly within arrays.