vim-refactor


Ⅰ. 插件描述

Generic Refactoring Plugin for Vim

Ⅱ. 基本信息

创建日期:  2008-10-28
使用用户:  7
Github星:  83
插件作者:  Luc Hermitte

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-refactor v2.0.0 Last release Project Stats

Features

lh-refactor is a generic refactoring plugin.

So far it supports the following refactorings (v0.2.2):

    • Extract Function,
    • Extract Variable,
    • Extract Type,
    • Extract Getter & Extract Setter, (it's more a generate than an extract actually)
    1. the following languages: C, C++, Java, Pascal, VimL.

    The list of languages supported can be extended (however some refactoring work in the plugin is required to simplify that part)

    The complete documentation can be browsed in the repository

    Mappings

    Visual-mode Mappings (not available in Select-mode)

    • <C-X>f to eXtract a Function
    • <C-X>v to eXtract a Variable
    • <C-X>t to eXtract a Type

    Normal-mode Mappings

    • <C-X>g to eXtract a Getter, and <C-X>s to eXtract a Setter
    • <C-X>p and <C-X>P to Put back the definition that as been extracted

    Note

    The extraction refactorings don't put back anything. The position in the code
    where the extracted things are to be placed are left to end-user appreciation.
    This has to be done with <C-X>p and <C-X>P.

    Installation

    ActivateAddons lh-refactor
    • or you can clone the git repositories (expecting I haven't forgotten anything):
    git clone git@github.com:LucHermitte/lh-vim-lib.git
    git clone git@github.com:LucHermitte/lh-tags.git
    git clone git@github.com:LucHermitte/lh-dev.git
    git clone git@github.com:LucHermitte/lh-style.git
    git clone git@github.com:LucHermitte/lh-brackets.git
    git clone git@github.com:LucHermitte/vim-refactor.git
    • or with Vundle/NeoBundle (expecting I haven't forgotten anything):
    Bundle 'LucHermitte/lh-vim-lib'
    Bundle 'LucHermitte/lh-tags'
    Bundle 'LucHermitte/lh-dev'
    Bundle 'LucHermitte/lh-style'
    Bundle 'LucHermitte/lh-brackets'
    Bundle 'LucHermitte/vim-refactor'

    See also

    添加新评论