vim-signjump


Ⅰ. 插件描述

Jump to signs just like other object motions. A feature that is oddly absent from Vim.

Ⅱ. 基本信息

创建日期:  2018-04-09
使用用户:  3
Github星:  8
插件作者:  Alex George

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

vim-signjump

Jump to signs just like other object motions. A feature that is oddly absent from Vim.

Jump Around

Most plugins that make use of the sign column supply mappings or commands that
jump to their respective signs. This plugin aims to provide the same behavior as
a generic motion that works in any file with signs.

Usage

Using SignJump is simple. By default, the plugin defines mappings for jumping to
the next, previous, first or last sign with mappings akin to Tim Pope's
Unimpaired plugin. Use ]s to jump to the next sign, and [s to jump to
the previous sign. An optional count can be given to jump n signs at a time.
Likewise, capital S variants jump to the first and last signs in the buffer.

Jumps are relative to the cursor position. If there is no sign in the jump
direction, or no signs in the current buffer at all, the cursor will not move.

In addition, there are supplementary commands that offer the same functionality.
See :h signjump-commands for details.

Installation

No special steps are required for installation. Refer to your plugin manager's
documentation for detailed and specific setup and plugin installation

  1. Or, if you prefer to do things the hard way, you can manually
  2. SignJump by adding its directories to your ~/.vim directory.

Using Vim-Plug or Vundle

Using Vim-Plug:

Plug 'ZeroKnight/vim-signjump'

Run :PlugInstall in Vim.

Using Vundle:

Plugin 'ZeroKnight/vim-signjump'

Run :PluginInstall in Vim.

Using Pathogen

cd ~/.vim/bundle
git clone git://github.com/ZeroKnight/vim-signjump.git

Run :Helptags in Vim.

Using Vim or Neovim packages

Vim, as of version 7.4.1486, and Neovim have native package management that
doesn't require any third-party plugins.

The default package path depends on whether you are using Vim or Neovim, so be
sure to use the appropriate path. You may need to create it first, if it does
not exist.

cd ~/.vim                    # Vim 8.0
cd ~/.local/share/nvim/site  # Neovim

Create the package directory. (Neo)Vim will look for packages under the 'pack'

  1. Each package can contain one or more plugins. Here, we
  2. you'll put your plugins installed via git in a package called

'git-plugins', but you can name this whatever you'd like.

mkdir -p pack/git-plugins/start

Clone the repository.

git clone https://github.com/ZeroKnight/vim-signjump pack/git-plugins/start/vim-signjump

You'll need to generate tags for the help file in order to view it with :help.
You can do this manually, or add the following to the end of your
vimrc/init.vim:

" Load packages now so that they are in 'runtimepath', otherwise helptags won't
" be able to find them.
packloadall

" Quietly generate tags for help files.
silent! helptags ALL

Configuration

See :h signjump-configuration for options.

Background

SignJump is my first Vim plugin. I was inspired to write it by this [Vi & Vim
Stack Exchange question][3].

I thought that it was very peculiar that Vim doesn't have a user-friendly way
to jump to signs. The closest thing would be :sign jump ..., but having to supply
a specific ID and buffer/file name is hardly user-friendly, and there's no
mapping equivalent.

I hope that you find this plugin useful, and appreciate its simplicity and
light weight. I wrote this plugin with the vision that it be one of those
"must have missing features" type plugins that anyone would want in their Vim
configuration.

Acknowledgements

  • Andreas Louv - Early code review.
  • Luc Hermitte - Insightful early code review
    and suggestions; drove several refactors. Answered my neophyte questions.
    Thank you!

添加新评论