vim-dirvish


Ⅰ. 插件描述

Directory viewer for Vim :zap:

Ⅱ. 基本信息

创建日期:  2014-06-04
使用用户:  338
Github星:  700
插件作者:  Justin M. Keyes

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'justinmk/vim-dirvish'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'justinmk/vim-dirvish'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'justinmk/vim-dirvish'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/justinmk/vim-dirvish

Ⅳ. 文档说明

dirvish.vim :zap:

Path navigator designed to work with Vim's built-in mechanisms and
complementary
plugins.

Features

  • Simple: Each line is just a filepath
  • Flexible: Mash up the buffer with :g, automate it with g:dirvish_mode
  • Safe: Never modifies the filesystem
  • Non-intrusive: Impeccable defaults. Preserves original/alternate buffers
  • Fast: 2x faster than netrw
  • Intuitive: Visual selection opens multiple files
  • Powerful: :Shdo[!] generates shell script
  • Reliable: Less code, fewer bugs (96% smaller than netrw). Supports Vim 7.2+

Concepts

Lines are filepaths

Each Dirvish buffer contains only filepaths, hidden by conceal.

  • Use plain old y to yank a path, then feed it to :r or :e or whatever.
  • Sort with :sort, filter with :global. Hit R to reload.
  • Append to quickfix (:'<,'>caddb), iterate with :cdo.
  • Script with :Shdo[!].
  • :set ft=dirvish on any buffer to enable Dirvish features:

    git ls-files | vim +'setf dirvish' -

Buffer name is the directory name

So commands and plugins that work with @% and @# do the Right Thing.

  • Create directories:

    :!mkdir %foo
  • Create files:

    :e %foo.txt
  • Use @# to get the Dirvish buffer from a :Shdo buffer:

    :Shdo
    mkdir <C-R>#.bk
    Z!

Edit Dirvish buffers

For any purpose. It's safe and reversible.

  • Use :sort or :global to re-arrange the view, delete lines with d, etc.
    Then :%Shdo the result.
  • Pipe to :! to see inline results:

    :'<,'>!xargs du -hs
  • Type u to undo, or R to reload.

Work with the :args list

The arglist is an ad-hoc list of filepaths.

  • Type x to add files to the (window-local) arglist.
  • Iterate with standard commands like :argdo, or plugin features like ]a.
  • Run :Shdo! (mapping: [count].) to generate a shell script from the arglist.

Extensions

Some people have created plugins that extend Dirvish:

Credits

Dirvish was originally forked (and completely rewritten) from
filebeagle by Jeet Sukumaran.

Copyright 2015 Justin M. Keyes.

添加新评论