psearch.vim


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2013-02-12
使用用户:  4
Github星:  10
插件作者:  geck

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

## psearch.vim

v0.3.2

Overview

This plugin shows a preview of all the lines where your search
pattern matches in the currently opened buffers.

Screenshot

Execute the :PSearch command and type something. You'll see a preview
of all the lines where the pattern you gave matches in the currently
opened buffers.

Below there is list of all the mappings you can use to interact with the window:

  • UP, CTRL+K: move up in the list.
  • DOWN, CTRL+J: move down in the list.
  • CTRL+B: move to the bottom of the list.
  • CTRL+T: move to the top of the list.
  • LEFT or CTRL+H, RIGHT or CTRL+L: move across lists of matches of other buffers.
  • RETURN, CTRL+G: go to the selected match.
  • CTRL+A: show jump marks for each result.
  • CTRL+U: clean the pattern.
  • ESC, CTRL+C: close the matches list.

You are allowed to use any pattern that would work with the / and
? vim commands and as the nomagic option would be set.

Pressing CTRL+A in the psearch navigation buffer will add jump marks denoted
in the format <[a-z]> for each search result entry. When the marks have been
displayed entering any of the letters used as mark will jump directly to the
respective entry and close the search navigation. Entering any letter that is
not a mark will discard the action.

Requirements

  • Vim 7.2+
  • Vim compiled with python 2.6+

Installation

Extract the content of the folder into the $HOME/.vim directory or use your favourite
plugin manager.

Commands

PSearch

Opens the preview window. Type something and the window will update
automatically with all the search matches for the current file.

PSearchw

As the PSearch command but uses the word under cursor for the search.
(Equal to the vim * mapping)

Settings

g:pse_max_height

With this setting you can set the maximum height for the window opened with
the PSearch command.

default: 15

g:pse_prompt

With this setting you can customize the look of the prompt used by the
PSearch command.

default: '>> '

Changelog

v0.3.2

  • Added new mapping "CTRL+U" for clearing the current input (thanks to Aaron . Ti).

v0.3.1

  • PSearch can now work with almost any kind of buffer (thanks to Idan Arye).

v0.3

  • Added jump-to-marks functionality for quick access to search results (thanks to Tobias Pflug).
  • Minor bugfixes.

v0.2

  • Searches are now performed in all buffers.
  • Fix issues with some input characters.
  • Add new controls for the PSearch window.

v0.1

  • First release

添加新评论