snapshot.vim


Ⅰ. 插件描述

Take snapshots of codes which you can revert to

Ⅱ. 基本信息

创建日期:  2014-11-11
使用用户:  2
Github星:  24
插件作者:  Jit

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

snapshot.vim

Installation

Use your favourite Plugin manager (e.g. Vim-Plug, Vundle, Pathogen)

The Github repository can be found at gelguy/snapshot.vim

Usage

This plugin lets you create snapshots of regions of code. This allows
you to quickly switch between snapshots of code you have taken.
Suppose you need to do a quick refactoring of your code.

  foo() {
    // long code
  }

You can take a snapshot of the code and then attempt to refactor.

  foo() {
    // Code breaks now
  }

Your code breaks, and you just need to revert the snapshot to restore
your work.

Each buffer can have multiple snapshot regions, with each region
having its own list of snapshots. You can revert to any snapshot or
back to the current state.

WARNING:
Please read the Bugs section before using!

Do not use Snapshot as a saving function as the snapshots can be lost.

Rather, use it for convenience for quick editing.

Default Mappings

<leader>a Create Snapshot Region (defines where the snapshot starts and ends)

<leader>s Take snapshot

<leader>S View and select snapshots (using <Tab> and <S-Tab>)

<leader>A View and select Region

添加新评论