LocateOpen


Ⅰ. 插件描述

Open files without having to supply a path

Ⅱ. 基本信息

创建日期:  2003-12-14
使用用户:  1
Github星:  3
插件作者:  Ciaran McCreesh

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This script is now being maintained by user "yokomizor" on Github. See https://github.com/yokomizor/LocateOpen for updates.

This script uses slocate (or a similar application) to allow the user to open a file without having to enter a path. If multiple files are found the user is given the choice of which file to open.

Usage:

:LocateEdit somefile.txt
:LocateSplit somefile.txt
:LocateSource somefile.vim
:LocateRead somefile.txt

Options:

To enable case insensitive mode:
:let g:locateopen_ignorecase = 1

To disable smart case mode:
:let g:locateopen_smartcase = 0

To enable always prompt mode:
:let g:locateopen_alwaysprompt = 1

Requirements:

You need 'slocate' or a similar application. This probably means that you need to be on Linux, or possibly another Unix-like OS. Most Linux distributions seem to ship with slocate by default, so this probably isn't a problem. This script will almost certainly not work on Windows, sorry.

An up-to-date locate database helps, too. If you find that this script gives out of date information (eg doesn't list some files or still shows old files), you may want to consider putting updatedb on a cron...

Finally, I've not tested on Vim below 6.2.

Possible Todo List:

  • Help document
  • Less inefficient 'array' handling

添加新评论