Ⅰ. 插件描述
Vim plugin for easier marks navigationⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'john2x/x-marks-the-spot'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'john2x/x-marks-the-spot'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'john2x/x-marks-the-spot'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/john2x/x-marks-the-spot.vim
Ⅳ. 文档说明
X Marks The Spot
Vim marks for pirates. Arr!
Easy mappings for creating and navigating through lower-case marks.
Basic usage
Default mappings:
<leader>x: Add markyin the current cursor location, whereyis the next
- mark.
<leader>X: Delete all marks at the current line.<BS>: Go to the previous closest mark (mode 1) or the previously
- mark (mode 2).
<S-BS>: Go to next closest mark (mode 1) or the next assigned mark
(mode 2).
To override them, add the following to your vimrc:
nmap <unique> <leader>x <Plug>XmarksthespotAddmark
nmap <unique> <leader>X <Plug>XmarksthespotRemovemarks
nmap <unique> <S-BS> <Plug>XmarksthespotNextmark
nmap <unique> <BS> <Plug>XmarksthespotPreviousmark
Install
Just place in your .vim/plugins directory. Pathogen ready.
Options
To set options, set their values in your vimrc.
X_MARKS_NAVIGATION_MODE
Choose between two mark navigation modes.
let g:X_MARKS_NAVIGATION_MODE = 1- (default) Move through marks based on position.
Basically just calls['and]'for moving backward and forward, respectively.let g:X_MARKS_NAVIGATION_MODE = 2- Move through marks based on the order of
- assignment (i.e. in alphabetical order), regardless of their positions.
X_MARKS_RESET_MARKS_ON_BUF_READ
let g:X_MARKS_RESET_MARKS_ON_BUF_READ = 0- (default) Don't clear all buffer
- when initializing X Marks The Spot for the current buffer.
let g:X_MARKS_RESET_MARKS_ON_BUF_READ = 1- Clear all buffer
- when initializing X Marks The Spot for the current buffer.
X_MARKS_SHOW_SIGNS
(Experimental)
let g:X_MARKS_SHOW_SIGNS = 0- Don't show signs for mark locationlet g:X_MARKS_SHOW_SIGNS = 1- (default) Show signs for mark location
Utility Functions
:call ResetXMarksOnBuffer()- Use this when X Marks the Spot messes up (e.g. when you add a mark viamx, etc.):call ClearXMarks()- Clear all marks and signs (:delmarksdoesn't work yet :()
To Do List
- Allow mode 1 to "cycle" to the first/last mark when at the last/first mark. (DONE)
- Add an option to limit one mark per line. (DONE, but not an option)
- Don't store marks in a dict anymore.
- Show signs for marks. (DONE)
- Make it work with normal mark creation (e.g.
ma, etc.)
License
Copyright (c) John Louis Del Rosario. Distributed under the same terms as Vim
- See
:help license.