Saturday, April 4, 2015

Re: quickly viewing a directory of files

Le samedi 04 avril 2015 à 21:21, Chris Lott a écrit:
> I have a directory of files with names like 'clips-20150101'
> 'clips-20150102' etc. I need to open a file, jump to a particular string,
> optionally yank some arbitrary text, and repeat for every file in the
> directory. What's the quickest way to do this in Vim?

What about simply passing the filenames as arguments to Vim, something
like "vim clips-*" (assuming you're on *nix), then use "n" to repeat
the search (after you've defined it once) and jump where you want,
yank your text, then ":next" to the next file?

If the text you want to yank is predictible (I'd guess from the
search), you can automate the whole process with "gn" (visual mode on
the last search) and "y".

Best,
Paul

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: