vim-line-jump


Ⅰ. 插件描述

easier way to jump lines in Tagbar and NERDTree

Ⅱ. 基本信息

创建日期:  2014-09-28
使用用户:  0
Github星:  0
插件作者:  rargo ye

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/vim-line-jump-already-like-death'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/vim-line-jump-already-like-death'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/vim-line-jump-already-like-death'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

When in Tagbar and NERDTree, It's not convenient jump lines using 'j','k'.
LineJump is written to make it easier

First, add following default map to your .vimrc
    "LineJump NERDTree key map
    augroup LineJumpNerdTree
        "I find nerdtree's f map to something not that useful!
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> f <ESC>:silent! call LineJumpSelectForward()<cr>
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> ; <ESC>:silent! call LineJumpMoveForward()<cr>
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> b <ESC>:silent! call LineJumpSelectBackward()<cr>
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> , <ESC>:silent! call LineJumpMoveBackward()<cr>

        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> gh <ESC>:silent! call LineJumpMoveTop()<cr>
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> gm <ESC>:silent! call LineJumpMoveMiddle()<cr>
        autocmd BufEnter NERD_tree_d+ nnoremap <buffer> <nowait> <silent> gl <ESC>:silent! call LineJumpMoveBottom()<cr>
    augroup END

    "LineJump TagBar key map
    augroup LineJumpTagbar
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> f <ESC>:silent! call LineJumpSelectForward()<cr>
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> ; <ESC>:silent! call LineJumpMoveForward()<cr>
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> b <ESC>:silent! call LineJumpSelectBackward()<cr>
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> , <ESC>:silent! call LineJumpMoveBackward()<cr>

        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> gh <ESC>:silent! call LineJumpMoveTop()<cr>
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> gm <ESC>:silent! call LineJumpMoveMiddle()<cr>
        autocmd BufEnter Tagbar nnoremap <buffer> <nowait> <silent> gl <ESC>:silent! call LineJumpMoveBottom()<cr>
    augroup END

It has two map key 'f', 'b' and a group of function to jump quickly in NERDTree and Tagbar(if you like, also can be enable in other buffer)

Here is how it works:
    in NERDTree or Tagbar, press 'f'(forward jump) or 'b'(backward jump), the first alpha will be highlight,
    previous selection often will have more than one match,  than:
        When g:LineJumpSelectMethod is 0:
            1. use ';' to move to next match
            2. use ',' to move to previous match
            3. use 'gh' to move to the first match
            4. use 'gm' to move to the middle match
            5. use 'gl' to move to the last match
        When g:LineJumpSelectMethod is 1:
            highlight characters will be shown, press the conreponding
            key to jump to the line

Global option:
    g:LineJumpSelectMethod
        define sub select way, default is 0
        0: sub select by LineJumpSubForward(), LineJumpSubBackward()
            need to map these two functions to some key
        1: sub select by press number and alpha

    g:LineJumpSelectInVisable = 0
        only valid when g:LineJumpSelectMethod == 0,
        if it is not 0, select will extend to the whole buffer,
        not just lines visabled in the window

    g:LineJumpMoveHighlight = 0
        only valid when g:LineJumpSelectMethod == 0,
        if it is not 0, when move using ';',',', the candidate lines will highlight

rargo.m@gmail.com 2014.09.28
Distributed under the same terms as Vim itself.

添加新评论