X Marks the Spot


Ⅰ. 插件描述

Vim plugin for easier marks navigation

Ⅱ. 基本信息

创建日期:  2012-08-05
使用用户:  1
Github星:  7
插件作者:  John Louis del Rosario

Ⅲ. 安装方法

使用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 mark y in the current cursor location, where y is the next
  1. mark.
  • <leader>X: Delete all marks at the current line.
  • <BS>: Go to the previous closest mark (mode 1) or the previously
  1. 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
  1. 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
  1. when initializing X Marks The Spot for the current buffer.
  • let g:X_MARKS_RESET_MARKS_ON_BUF_READ = 1 - Clear all buffer
  1. 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 location
  • let 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 via mx, etc.)
  • :call ClearXMarks() - Clear all marks and signs (:delmarks doesn't work yet :()

To Do List

  1. Allow mode 1 to "cycle" to the first/last mark when at the last/first mark. (DONE)
  2. Add an option to limit one mark per line. (DONE, but not an option)
  3. Don't store marks in a dict anymore.
  4. Show signs for marks. (DONE)
  5. 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

  1. See :help license.

添加新评论