pyxis-vim


Ⅰ. 插件描述

A simple script that provides mechanisms to quickly find and open files in vim.

Ⅱ. 基本信息

创建日期:  2011-03-16
使用用户:  1
Github星:  1
插件作者:  Gustaf Sjöberg

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Pyxis

A simple script that provides mechanisms to quickly find and open files.

A major design goal was ease-of-installation; the script does not depend on
vim being compiled with support for any "special" features. This comes at the
price of not being able to (feasibly) add fancy things like approximate string
matching (overrated anyway, right?) etc.

Installation

Preferred Method

Install [Vundle] and add Bundle 'strange/pyxis-vim' to your .vimrc.

Manual Install

Copy autoload/pyxis.vim and plugin/pyxis.vim into corresponding
directories in your vim plugin directory.

Usage

:Pyxis opens an "input field". A list containing matching files will be
displayed as you start typing (assuming there are files in your cwd that match
what you've typed).

An in-memory cache will be populated during the first run. You can use
:PyxisUpdateCache to manually update the cache.

Something like the following in your .vimrc might be nice:

noremap <leader>e :Pyxis<CR>
noremap <leader>E :PyxisUpdateCache<CR>

Use <Tab>, <S-Tab>, <Down> and <Up> to navigate between entries in the
list.

<CR> opens selected file in currently active window. <C-h> and <C-v>
opens the file in horizontal and vertical splits, respectively. <C-t> opens
the file in a new tab.

/ and _ in quries work as matching delimiters. You can, for example, type
do/ to see all files located in doc/ and help/documentation/, or h_w
to match a file named hello_world.c.

Caveats

The script relies on find to populate the cache at the moment, but I'm
evaluating an implementation that uses the built-in globpath instead. The
native version is a little faster on small dir trees (a few ms), but a lot
slower on large trees (like the Linux kernel where it takes ~5 seconds to
complete on my machine, as opposed to less than 1 second using find).

Current state of the project: works for me and I prefer it over other
solutions.

The script stores a list of all files in cwd in an in-memory cache. You
currently update the cache manually when you remove or add files. I might fix
this some day.

添加新评论