factorus


Ⅰ. 插件描述

Refactoring for the rest of us! (automated refactoring in vim)

Ⅱ. 基本信息

创建日期:  2017-06-08
使用用户:  17
Github星:  38
插件作者:  Austin Palmer

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Factorus: automated refactoring in Vim

Factorus is a Vim plugin for automated refactoring. It provides
renaming of methods and classes, encapsulation of variables,
and even method extraction, with a few very intutitive commands.

Features

The following table shows which features Factorus supports for
which languages:

Add ParameterEncapsulate VariableExtract Method (Automated)Extract Method (Manual)Rename ArgumentRename ClassRename MethodRename Field
Java✓✓✓✓✓✓✓✓
Python✓N/A✓✓✓✓✓N/A
C/C++✓N/A✓✓✓N/A✓✓

Additionally, for C/C++, Factorus supports the following refactorings:

Rename TypeRename MacroRename Namespace
C/C++✓✓N/A

NOTE: Factorus support for C++ currently uses the same code as for C; as such, Factorus may not work properly for more complex C++ code.

Factorus also has commands for reverting changes and rebuilding projects, for stability and sanity testing.

Examples

(All code shown either from spring-framework or git)

Rename Class

renameClass

Rename Field

renameField

Rename Method

renameMethod

Rename Type

renameType

Rename Macro

renameMacro

Rename Arg

renameArg

Add Parameter

addParam

Encapsulate Field

encapsulateField

Extract Method

Factorus provides two functions for method extraction. The first, FExtractMethod, automatically finds a block
of code that can be safely extracted:

extractMethod

If you prefer to manually extract a block of code, however, you can use FMExtractMethod (now deprecated, use FExtractMethod:

manualExtractMethod

Installation

There are many ways to install Factorus. You can:

  • Use a plugin manager like pathogen or vim-plug (Recommended),
  • Clone the repository into your 'runtimepath', or
  • Download the tar file from vim.org and extract it into your 'runtimepath'.

Dependencies

Vim 7.0

添加新评论