soheilpro / zsh-vi-search

Adds support for searching the current line (in normal vi mode) to zsh.
MIT License
12 stars 2 forks source link

Can't seem to get it working #1

Closed trosh closed 7 years ago

trosh commented 7 years ago

Hello, hope this is just me being stupid.

My .zshrc looks like this:

...
bindkey -v
...
. $HOME/src/zsh-vi-search/src/zsh-vi-search.zsh
...

When I load a new shell, I do

$ echo hello
$ <esc>?cho

And I'm left in command mode at the current empty command. At best if I use <esc>/ I have basic vi-mode history search behaviour.

Am I doing something wrong ?

I'm putting this as an issue only because I assume I'm doing something wrong and I figured the readme could be slightly more helpful.

Thanks

soheilpro commented 7 years ago

This tool lets you use search to edit the current line, instead of using arrow keys or other vim movement commands.

For example, suppose you have typed this command:

$ curl http://google.com<CURSOR>

and now you want to change "http" to "https".

To do this, press ESC to go into normal mode, then press / to activate search. Now type : and press enter. This will put the cursor just before ::

$ curl http<CURSOR>://google.com

Now, you can simply go back into the insert mode and type s.

trosh commented 7 years ago

Oh yeah OK I get it, I just immediatly assumed it could also jump through history as well

That would make it complete in my opinion but it's already quite good :+1:

soheilpro commented 7 years ago

Thanks. I'm glad you've found this useful :)