mu-marks


Ⅰ. 插件描述

Script inspired by AlphaTk & Stephen Riemhm's bracketing function

Ⅱ. 基本信息

创建日期:  2002-03-11
使用用户:  1
Github星:  1
插件作者:  Gergely Kontra

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Template expander.
Unique feature: one command for insert and visual-mode expansion.

The MarkMap and MarkMapB commands allows you to make global and filetype-specific mappings. MarkMapB commands can be in your ftplugin dir in the appropiate file. The only weirdness is the typing of the command. Well, these weird characters should be configurable. (But I think they're at least readable, and look good)
One example mapping (in my vim.vim)
MarkMapB wh wh «»<CR>¶endw«¡»
After typing wh, and pressing <C-Space> (you can change it) in insert mode, you will get
wh |
endw«»
| symbols the cursor.
So the «» characters are the cursor positions, and the furthers are the jump-points. There can be an explanation text between these 2 chars, so «explanation» is allowed.
If you have a line
echo 'Hello world'
and you select it visually, press <C-Space> and type wh<CR>, you will get
wh |
  echo 'Hello world'
endw
So the ¶ sign is replaced by the visually selected text (adding an extra newline if needed).
If you want to remove the trailing newline (if any) you can use the · symbol.
Notice, that there is no mark after the endw.
Marks, that begin with «¡ are not used in visual mappings.

添加新评论