Ⅰ. 插件描述
Pan, zoom, and map a 2D text plane (for vim)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'q335r49/microviche'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'q335r49/microviche'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'q335r49/microviche'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/q335r49/microviche
Ⅳ. 文档说明
#microViche
MicroViche is sort of like a microfiche reader: it lets you pan and zoom through text. Installation is simple: download nav.vim, open Vim, <samp>:source nav.vim</samp>, and press f10. Check out the youtube video!
Commands
Use the mouse to pan or evoke commands with f10:
| h j k l y u b n | pan (takes count) | f1 | help and warnings | |
|---|---|---|---|---|
| r M | redraw visible / all | o | open map | |
| A D | append / delete split | L | insert label | |
| S W | settings / save settings | q esc | quit | |
In the map (f10 o):
| h j k l y u b n | move (takes count) | f1 | help and warnings | |
|---|---|---|---|---|
| H J K L Y U B N | pan (takes count) | z | zoom | |
| g enter doubleclick | goto label | c C | center cursor / view | |
| click drag | select / pan | q esc | quit | |
| p P | prev / next in history | |||
Labels
Labels are lines that start with a label marker (default <q>txb:</q>) and specify an anchor, title, or both. When the map is updated (f10 r, o, and M), displaced labels are reanchored by inserting or removing immediately preceding blank lines. Anchoring failures are shown in the map.
The syntax is <q>marker(anchor)(:)( title#highlght#comment)</q>, but let's just consider some examples:
<samp>txb:345 blah blah </samp> anchor to line 345
<samp>txb:345: Intro#Search </samp> anchor 345, title <q>Intro</q>, color <q>Search</q> (Note the : separator).
<samp>txb: Intro </samp> just title <q>Intro</q>
<samp>txb: Intro## blah blah </samp> just title <q>Intro</q>
Tips
- To resolve labeling conflicts, the case-insensitive alphabetically first title starting with <q>!</q> will be shown, eg, <q>txb:321: !aaaImportant</q>. On cursor-over, the rest will be shown in line number order.
- Terminal emulators work better than gVim since the latter doesn't support mousing in map mode or automatic redrawing on window / font resize. Cygwin (and the bundled mintty terminal emulator) is a great Windows setup.
- To disable scrollbinding: f10 Settings→ change <q>autoexe</q> to <samp>se </samp><samp>no</samp><samp>scb nowrap</samp>→apply all
- Keyboard-free navigation is possible: dragging to the topleft corner opens the map and clicking the topleft corner closes it. (Terminal emulator only; <samp>ttymouse</samp> must be set to <samp>sgr</samp> or <samp>xterm2</samp>.)
- If you have an inaccessible hotkey, <samp>:call TxbKey('S')</samp> for Settings.
- To highight labels, try: <samp>syntax match Title +^txbS: zs.1+ oneline display</samp>
- #n ↩