Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LucHermitte/vim-refactor
Generic Refactoring Plugin for Vim
https://github.com/LucHermitte/vim-refactor
refactorings vim vim-plugins
Last synced: 3 months ago
JSON representation
Generic Refactoring Plugin for Vim
- Host: GitHub
- URL: https://github.com/LucHermitte/vim-refactor
- Owner: LucHermitte
- License: other
- Created: 2015-03-16T08:03:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T10:42:16.000Z (over 3 years ago)
- Last Synced: 2024-06-10T01:39:05.193Z (5 months ago)
- Topics: refactorings, vim, vim-plugins
- Language: Vim script
- Homepage:
- Size: 268 KB
- Stars: 109
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# vim-refactor v2.0.0 [![Last release](https://img.shields.io/github/tag/LucHermitte/vim-refactor.svg)](https://github.com/LucHermitte/vim-refactor/releases) [![Project Stats](https://www.openhub.net/p/21020/widgets/project_thin_badge.gif)](https://www.openhub.net/p/21020)
## Featureslh-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)_
and 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](doc/refactor.txt)
## Mappings
### Visual-mode Mappings (not available in Select-mode)
* `f` to eXtract a Function
* `v` to eXtract a Variable
* `t` to eXtract a Type
### Normal-mode Mappings
* `g` to eXtract a Getter, and `s` to eXtract a Setter
* `p` and `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 `p` and `P`.## Installation
* Requirements: Vim 7.+, [lh-vim-lib](http://github.com/LucHermitte/lh-vim-lib), [lh-brackets](http://github.com/LucHermitte/lh-brackets), [lh-dev](http://github.com/LucHermitte/lh-dev) (and thus [lh-tags](http://github.com/LucHermitte/lh-tags)), and [lh-style](http://github.com/LucHermitte/lh-style)
* With [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager), install lh-refactor. This is the preferred method because of the various dependencies.```vim
ActivateAddons lh-refactor
```* or you can clone the git repositories (expecting I haven't forgotten anything):
```
git clone [email protected]:LucHermitte/lh-vim-lib.git
git clone [email protected]:LucHermitte/lh-tags.git
git clone [email protected]:LucHermitte/lh-dev.git
git clone [email protected]:LucHermitte/lh-style.git
git clone [email protected]:LucHermitte/lh-brackets.git
git clone [email protected]:LucHermitte/vim-refactor.git# For experimental function extraction
git clone [email protected]:LucHermitte/mu-template.git
git clone [email protected]:tomtom/stakeholders_vim.git
```* or with Vundle/NeoBundle (expecting I haven't forgotten anything):
```vim
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'" For experimental function extraction
Bundle 'LucHermitte/mu-template'
Bundle 'tomtom/stakeholders_vim'
```## See also
* Klaus Horsten's tip: [Vim as refactoring tool (with examples in C#)](http://vim.wikia.com/wiki/Vim_as_a_refactoring_tool_and_some_examples_in_C_sharp)
* [lh-cpp](http://github.com/LucHermitte/lh-cpp) defines a few other refactoring-like functionalities:
* Generate accessor and mutator (`:ADDATTRIBUTE`),
* Generate default body given a function signature (`:GOTOIMPL`)
* [Refactoring.com](http://www.refactoring.com/catalog/index.html)