alquerci / vim-refactoring-toolbox

VIM Php Refactoring Toolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VIM Code Refactoring Toolbox

License: MIT

Fork of adoy/vim-php-refactoring-toolbox. Big thanks to Pierrick Charron (@adoy).

A set of mappings which help you to refactor code in consistent way across languages.

Supported languages

  • PHP
  • SH
    • Extract Method
  • JS
    • Extract Method
    • Extract Variable
  • TypeScript
    • Extract Method
    • Extract Variable

Refactoring Techniques Highlights

To help boy-scout to clean the code.

To extract till you drop.

  • Extract Variable (<LocalLeader>ev)
  • Extract Method (<LocalLeader>em)
  • In-line Variable (<LocalLeader>iv)
  • Extract Property (<LocalLeader>ep)

To make the code easy to read.

  • Rename Method (<LocalLeader>rm)
  • Rename Variable (<LocalLeader>rv)
  • Extract Constant (<LocalLeader>ec)
  • Rename Property (<LocalLeader>rp)

To quickly change code location.

  • Rename Directory (<Leader>rd, required github.com/phpactor/phpactor)

To generate code

  • Create Setters and Getters (<LocalLeader>sg)
  • Create only Getters (<LocalLeader>cog)

Full Documentation

See ./doc/refactoring-toolbox.txt

Installation

  • vim-plug: Plug 'alquerci/vim-refactoring-toolbox'
  • vundle: Plugin 'alquerci/vim-refactoring-toolbox'
  • pathogen: git clone https://github.com/alquerci/vim-refactoring-toolbox.git ~/.vim/bundle/

Running tests

bin/test

How to write tests?

See https://github.com/junegunn/vader.vim

About

VIM Php Refactoring Toolbox

License:MIT License


Languages

Language:Vim Script 96.4%Language:PHP 3.1%Language:Shell 0.5%