markjump.vim


Ⅰ. 插件描述

Code transversal functions, move to prev/next marker, insert/strip markers.

Ⅱ. 基本信息

创建日期:  2002-11-14
使用用户:  1
Github星:  1
插件作者:  Robert KellyIV

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This is a normal PLUGIN not ftplugin.

Marker chars are configurable.
You can define global or buffer variables to specify the marker chars for both left and right chars. Buffer vars if present are used before global chars
g:L_Marker
b:L_Marker
g:R_Marker
b:R_Marker

The default marker chars are the same as Luc Hermitte's bracketing.base.vim which is the same as Stephen Riehm's braketing macros. Which is to say «»

If you do not have digraphs enabled these chars are still easy to insert via
<c-k><< which gives you  '«' and <c-k>>> which is '»' (far easier to use the included commands however)

:MN        Search forward for the next occurance of marker chars
:MP        Search backwards for the next occurance of marker chars
:MI          Insert marker chars, usefull for <c-o>:MI text to have markers around it<cr>
:MIV       Wrap the visual selection (single line) with marker chars
:MA        Append marker chars (like a)
:MAV     Same as :MIV
:MS        Strip marker chars, positioning is a touch picky; place cursor in the markers and all is well.

Insert mode mappings:
<plug>MjMark         Defaults to ¡mark!        Insert marker chars, cursor AFTER the marker chars.
<plug>MjJump        Defaults to ¡jump!        Jump to the next marker (as :MN)

VISUAL mode mappings:
<plug>MjMark         Defaults to ¡mark!        Wrap marker chars around the selection. (as MIV)

NOTE if you already have insert and or visual mappings for ¡mark!/¡jump! these will NOT be made.

Key mappings:
<plug>MjPrev           Defaults to <M-Insert> in normal, insert and visual.       Jumps to previous markers, as :MP
<plug>MjNext             Defaults to <M-Del> in normal, insert and visual.        Jumps to next marker, as :MN
<plug>MjInsMarker        Defaults to <M-m> in insert.       Shortcut for <c-o>:MI Just hit <m-m>type your words<cr>

If there is gui and has menu adds the following plugin menu items:
Plugin.markjump.Prev  Marker
Plugin.markjump.Next Marker
Plugin.markjump.Insert Marker
Plugin.markjump.Append Marker
Plugin.markjump.Strip Markers

Strip markers mens to remove the marker chars from either side; cursor generally needs to be within the marker chars.

This script would not be what it is with out Luc Hermitte's input!

添加新评论