Live data from Hacker News

Show HN: A New Basic Vim Motion

github.com

11–20 of 43 posts

Re: Show HN: A New Basic Vim Motion

#11
this really is a sorely needed feature. vi/vim's lack of "seeking" was really one of the main reasons why i switched to emacs. emacs has a really nice seek, which is just ctrl+s and type whatever you are searching for w/o you needing to hit enter, and you are there. then ctrl+s again to the next match or ctrl+r for reverse.

anyhow, i don't use vim anymore but when i do, i'll give it a shot. i know i can't live without seeking, it's such an important part of your arsenal.

Re: Show HN: A New Basic Vim Motion

#12
post #10

Another built-in solution to the problem of mismatches when using the jump commands (f, t, F, T) is the use of ; and , Semicolon 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…

Oh, you reminded me to mention that ; and , integration is planned! I'll probably have to work something out with tpope's repeat plugin, or if it's simpler I'll just make a self-contained solution. I want seek to act just like a more selective f. The thing about repeating f is that if you are as little as 5 words away from your target you could be looking at 3-4 repeeats, and by then it wouldn't have been anywhere close the most efficient solution--plus it creates a habit of the read-eval-print loop, aka trial and error. Vim should allow you to always say what you want and get there. I find seek useful even in going to the beginning and end of close words, just use spacebar + char or char + spacebar.

Re: Show HN: A New Basic Vim Motion

#13
How is this better or different than incremental search? Incremental search means it jumps to the first match as soon as you start typing after '/': you don't need to press enter.

Try this combination of options to get functionality similar to emacs's C-s:

:set ignorecase :set smartcase :set incsearch

Re: Show HN: A New Basic Vim Motion

#14

this really is a sorely needed feature. vi/vim's lack of "seeking" was really one of the main reasons why i switched to emacs. emacs has a really nice seek, which is just ctrl+s and type whatever you are searching for w/o you needing to hit enter, and you are there. then ctrl+s again to the next match or ctrl+r for reverse. anyhow, i don't use vim anymore but when i do, i'll give it a shot. i know i can't live withou…

As I stated in a previous comment, it's called "incremental search" and you can do it in vim. Look here for how: http://linuxcommando.blogspot.com/2008/06/smart-case-insensi...

Re: Show HN: A New Basic Vim Motion

#15
post #10

Another built-in solution to the problem of mismatches when using the jump commands (f, t, F, T) is the use of ; and , Semicolon 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…

The problem with ; is that it doesn't work with t. It just leaves the cursor in the same place, because that's exactly what your t command would do if you typed it again.

It's now some years since I used vim regularly but I recall this regularly annoying me when trying to create visual selections. For example, I'd do "vt," (or whatever) expecting the selection to extend to a given point, and then find myself stuck at a , that I hadn't noticed. And then I'd have to move the cursor by hand to fix things, just like you would in some ordinary text editor.

Re: Show HN: A New Basic Vim Motion

#16
post #13

How is this better or different than incremental search? Incremental search means it jumps to the first match as soon as you start typing after '/': you don't need to press enter. Try this combination of options to get functionality similar to emacs's C-s: :set ignorecase :set smartcase :set incsearch

I've had exactly these three settings for a while, and I've just tested and incsearch didn't take to the match without enter. It's a great feature though, but I don't think I'd want it to take me, it would always fire early, say if I would be typing 'th' it would go to 'the' when really I had wanted 'though' some words next.

Re: Show HN: A New Basic Vim Motion

#17
post #15
post #10

Another built-in solution to the problem of mismatches when using the jump commands (f, t, F, T) is the use of ; and , Semicolon 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…

The problem with ; is that it doesn't work with t. It just leaves the cursor in the same place, because that's exactly what your t command would do if you typed it again. It's now some years since I used vim regularly but I recall this regularly annoying me when trying to create visual selections. For example, I'd do "vt," (or whatever) expecting the selection to extend to a given point, and then find myself stuck at…

That's odd. With my configuration I can use ; with t and it will skip over an occurrence of the target if it is the next character, like it seems you expect it to behave. I don't know if this has been fixed/improved in Vim itself or by some plugin that I use, but it does seem to be fixed now.

Re: Show HN: A New Basic Vim Motion

#18
post #14

this really is a sorely needed feature. vi/vim's lack of "seeking" was really one of the main reasons why i switched to emacs. emacs has a really nice seek, which is just ctrl+s and type whatever you are searching for w/o you needing to hit enter, and you are there. then ctrl+s again to the next match or ctrl+r for reverse. anyhow, i don't use vim anymore but when i do, i'll give it a shot. i know i can't live withou…

As I stated in a previous comment, it's called "incremental search" and you can do it in vim. Look here for how: http://linuxcommando.blogspot.com/2008/06/smart-case-insensi...

[deleted]

Re: Show HN: A New Basic Vim Motion

#19
post #14

this really is a sorely needed feature. vi/vim's lack of "seeking" was really one of the main reasons why i switched to emacs. emacs has a really nice seek, which is just ctrl+s and type whatever you are searching for w/o you needing to hit enter, and you are there. then ctrl+s again to the next match or ctrl+r for reverse. anyhow, i don't use vim anymore but when i do, i'll give it a shot. i know i can't live withou…

As I stated in a previous comment, it's called "incremental search" and you can do it in vim. Look here for how: http://linuxcommando.blogspot.com/2008/06/smart-case-insensi...

yea but unfortunately it's not that good ... think it's better than default search but a still too slow as a mean for code navigation (atleast for my taste). it's mainly due to needing to hit enter, which escapes everything, there should be a way to hit next occurrence and prev without leaving the /search box.
Post reply on HN