rupa / v Goto Github PK
View Code? Open in Web Editor NEWz for vim
z for vim
V(1) User Commands V(1) NAME v - z for vim SYNOPSIS v [-a] [-c] [-l] [-[0-9]] [--debug] [--help] [regex1 regex2 ... regexn] AVAILABILITY bash, vim INSTALLATION Put v somewhere in $PATH (e.g. /usr/local/bin/). For the manual page, put v.1 somewhere in $MANPATH (e.g. /usr/local/man/man1/). DESCRIPTION v uses viminfo's list of recently edited files to open one quickly no matter where you are in the filesystem. By default, it will open the most recently edited file matching all of the provided regular expressions. OPTIONS -a don't skip deleted files -c restrict matches to subdirectories of the current dir -l when multiple matches, show a list -[0-9] edit nth most recent file --debug dry run --help show a brief help message EXAMPLES v list and choose from all files v -0 reopen most recently edited file v foo bar edit first file matching foo and bar v -c foo bar choose files in current dir matching foo and bar v -l foo bar list and choose files matching foo and bar NOTES Shell variables, such as $, must be escaped if used in regular expres- sions. Behavior The default behavior is to open the most recent file that matches the search terms, even if there are multiple matches. You may find it useful to alias vl='v -l'. When there are multiple matches, this will prompt for a choice, rather than editing the first match. The author is still not sure which behavior should be the default, and has chosen one provisionally. SEE ALSO vim(1), regex(7) Please file bugs at https://github.com/rupa/v/ v February 2011 V(1)
I made v work with fzf. First, modify v not to display the choice dialog when using the -l
flag, then use this shell function to call it:
v() {
if [[ -z "$@" ]]; then
local -r choice="$(command v -l 2>&1 | fzf +s --tac --height 15 --reverse | sed -r 's/^[0-9,. \t]*//')"
if [[ ! -z "$choice" ]]; then
local -r file="${choice/#~/$HOME}"
vim "$file"
fi
else
command v "$@"
fi
}
installation guides would be awesome+ for nubs like me.
thank you.
I adjusted the variable at the top to [ "$vim" ] || vim=nvim
but v
doesn't include files edited with neovim. (Probably, it doesn't use the same ~/.viminfo
.) Could you consider supporting neovim, please?
I noticed there's no open-source license included in this repo (first noticed in #10); unfortunately, that means this project doesn't meet Homebrew's Acceptable Formulae list for inclusion in the core Homebrew tap. Can you either:
v
formula thereIf I haven't heard a reply in the next week or two, I'll open a PR in homebrew-core to delete the v
formula. Thanks in advance for your help ๐
Vim can handle tab completion in ex-commands, it would be neat if it expanded the regex on TAB so that I know what file I'm about to open exactly before I open it
V gives out this error when there are recent edited files with "(" or ")" in the file name. I think the error is caused by echoing unquoted parenthesis. I've been trying, but failed, to escape "(" and ")" in $fl.
Hello,
Wondering if it is possible to have a zsh version of this?
Thanks
Joe
Hi, I created Awesome package manager and I can install your repo using it.
After installing the Awesome:
awesome -i rupa/v
# or
awesome install rupa/v
If you can put it in your README, it will be awesome.
Thanks.
Shin
When you call z
with no arguments, it just prints the frecency list.
When you call v
with no arguments, you're presented with a prompt to enter a choice.
This isn't very useful because most vim users will have many files in their recently accessed list, and after they're presented with the list they can just re-run v
with the filename they want.
dfg
If I have opened file foo.c and bar.c, I can use v foo
and v bar
to open them separately.
The request is that v foo bar
can open both files concurrently in vim.
Even more, we can v multiply files in one line of command.
Thank you! Both z and v are must have for every machine of me!
This is more useful behaviour than matching against every regex.
E.g. if I have
$ v -l
2 ~/.../json/navigation.json
1 ~/.../app.js
0 ~/.../sass/theme.sass
I want v app the
to start vim with two buffers, one of ~/.../app.js
and the other of ~/.../sass/theme.sass
.
(feel free to close this if it's not doable; just thought I'd ask)
The choice numbers are off by one compared to what you would get in vim if you hit '0, '1, etc. within vim. Would it be possible to use the same (your "1" would then become "0", etc).
On a related note, the documentation says [0-9] is allowed but the code has [1-9] :-)
I realise there're also the issue of deleted files that makes it likely to differ anyway but frankly, deleted files are rare and I can live with the two sequences going out of sync if there is one (or I will use "-a").
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.