Ⅰ. 插件描述vinegar.vim: Combine with netrw to create a delicious salad dressing
:source % :PluginInstall
对于Vundle版本 < 0.10.2，请用上面的Bundle替换Plugin。
:source % :NeoBundleInstall
:source % :PlugInstall
cd ~/.vim/bundle git clone https://github.com/tpope/vim-vinegar
Split windows and the project drawer go together like oil and vinegar. I
don't mean to say that you can combine them to create a delicious salad
- I mean that they don't mix well!
- Drew Neil
You know what netrw is, right? The built in directory browser? Well,
vinegar.vim enhances netrw, partially in an attempt to mitigate the need for
more disruptive "project drawer" style plugins.
Some of the behaviors added by vinegar.vim would make excellent upstream
- Many, the author would probably reject. Others are a bit too wild
- even consider.
-in any buffer to hop up to the directory listing and seek to the
file you just came from. Keep bouncing to go up, up, up. Having rapid
directory access available changes everything.
- All that annoying crap at the top is turned off, leaving you with nothing
but a list of files. This is surprisingly disorienting, but ultimately
very liberating. Press
I to toggle until you adapt.
- The oddly C-biased default sort order is replaced with a sensible application
- File hiding: files are not listed that match with one of the patterns in
If you put
let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
in your vimrc, vinegar will initialize with dot files hidden.
gh to toggle dot file hiding.
.on a file to pre-populate it at the end of a
This is great, for example, to quickly initiate a
:grepof the file or
directory under the cursor. There's also
!, which starts the line off
with a bang. Type
!chmod +x and get
:!chmod +x path/to/file.
y.to yank an absolute path for the file under the cursor.
~to go home.
- Use Vim's built-in
CTRL-6) for switching back to the previous
buffer from the netrw buffer.
Install using your favourite package manager, or use Vim's built-in package support:
mkdir -p ~/.vim/pack/tpope/start cd ~/.vim/pack/tpope/start git clone https://github.com/tpope/vim-vinegar.git
Copyright © Tim Pope. Distributed under the same terms as Vim itself.