rupa / z

z - jump around
Do What The F*ck You Want To Public License
16.37k stars 1.17k forks source link

how to support vim? #240

Closed cizel closed 6 years ago

cizel commented 6 years ago

RT, how to support vim

alphaCTzo7G commented 6 years ago

What do you mean by support vim?

alphaCTzo7G commented 6 years ago

z is a command line utility.. If you want to us it inside vim, you can use it with vim's argslist, as far as I can see: http://vimcasts.org/episodes/meet-the-arglist/..

for example.. when I need to perform very complex search for specific text in my file-systems across specific types of files, modified on specific dates etc.. I typically use the following command:

noautocmd vim /Users.*\n*.*code/gfind /home/username ( -type f -regextype posix-extended -regex '.' ) -exec grep -lI '.' {} \;``

Here find /home/username \( -type f -regextype posix-extended -regex '.*' \) -exec grep -lI '.*' {} \;

is passed as a argslist to vimgrep, even thought find and grep are command line utilities.

You dont actually have to type this out everytime, as vim saves your command line history. You can just type q: to have access to your commandline history and use a previous command over and over again.

You can probably do the same with z as well.

cizel commented 6 years ago

thanks~