openrefactory/c笔记 (一)
2015-07-10 20:37
381 查看
openrefactory/c(以下简称or/c)是一个针对C语言的代码重构工具,支持在vim和eclipse中进行代码重构。
相关文档介绍可在此处获取。
由于其官网http://www.http://openrefactory.org 一直进不去,使用https://github.com/rdallman/openrefactory-vim的插件来进行实验,该插件是针对vim开发的,我使用的
操作系统为:ubuntu14.04.2 (64位)
vim版本为:7.4.52
首先是安装,在上面的github页面,安装步骤已经写的很详细了,我大致说一下,
1.安装java,可以参照我之前的博文 Ubuntu14.04安装java
2.安装vundle并使用vundle安装or/c,从https://github.com/VundleVim/Vundle.vim获取资源和安装步骤
2.1 设置Vundle
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2.2配置.vimrc文件(在当前用户目录下)
将以下代码放在.vimrc文件中,注意(“)开头的是注释,把不需要的插件注释掉,只保留我们需要的插件,
打开vim然后执行:BundleInstall就行了。
3.现在就可以在vim中对C文件使用or/c进行代码重构了。
支持的重构方法有:
Rename
Add Local Variable
Add Reflexive Assignment
Move Expression Assignment
Remove Useless Expression
Change Integer Type
Add Integer Cast
Change Integer Type
Replace Arithmetic Operator
期间遇到问题,可以在vim中使用:help openrefactory获取帮助。注意,以上vim中的命令都支持tab键补全。
相关文档介绍可在此处获取。
由于其官网http://www.http://openrefactory.org 一直进不去,使用https://github.com/rdallman/openrefactory-vim的插件来进行实验,该插件是针对vim开发的,我使用的
操作系统为:ubuntu14.04.2 (64位)
vim版本为:7.4.52
首先是安装,在上面的github页面,安装步骤已经写的很详细了,我大致说一下,
1.安装java,可以参照我之前的博文 Ubuntu14.04安装java
2.安装vundle并使用vundle安装or/c,从https://github.com/VundleVim/Vundle.vim获取资源和安装步骤
2.1 设置Vundle
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2.2配置.vimrc文件(在当前用户目录下)
将以下代码放在.vimrc文件中,注意(“)开头的是注释,把不需要的插件注释掉,只保留我们需要的插件,
set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' plugin 'rdallman/openrefactory-vim' "添加我们需要的插件or/c " The following are examples of different formats supported. 下面介绍了几种不同的插件获取方式 " Keep Plugin commands between vundle#begin/end. " plugin on GitHub repo 从github获取插件方式 “Plugin 'tpope/vim-fugitive' 注释掉不需要的插件 " plugin from http://vim-scripts.org/vim/scripts.html 从vim-script获取插件方式 "Plugin 'L9'注释掉不需要的插件 " Git plugin not hosted on GitHub “Plugin 'git://git.wincent.com/command-t.git'注释掉不需要的插件 " git repos on your local machine (i.e. when working on your own plugin) 从本地计算机获取插件方式 ”Plugin 'file:///home/gmarik/path/to/plugin'注释掉不需要的插件 " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. “Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}注释掉不需要的插件 " Avoid a name conflict with L9 ”Plugin 'user/L9', {'name': 'newL9'}注释掉不需要的插件 " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " To ignore plugin indent changes, instead use: "filetype plugin on " " Brief help 这里介绍了 " :PluginList - lists configured plugin 显示要安装的插件 " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate 安装插件 " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal卸载插件,卸载时只需要到此文件.vimrc将要卸载的插件注释掉再执行此命令即可 " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line
打开vim然后执行:BundleInstall就行了。
3.现在就可以在vim中对C文件使用or/c进行代码重构了。
支持的重构方法有:
Rename
Add Local Variable
Add Reflexive Assignment
Move Expression Assignment
Remove Useless Expression
Change Integer Type
Add Integer Cast
Change Integer Type
Replace Arithmetic Operator
期间遇到问题,可以在vim中使用:help openrefactory获取帮助。注意,以上vim中的命令都支持tab键补全。
相关文章推荐
- Linux : chkconfig
- JDK+MyEclipse+Tomcat的配置(修改Tomcat 6.x的端口)
- centos7 lnmp 一键安装脚本
- Linux的SOCKET编程详解
- no installed service named "apache2"
- Nginx源代码分析之I/O模型细节(七)
- 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ...
- linux用户权限管理, chmod, ln
- 配置openssh服务器(学习整理)
- 免费资料库linux公社
- shell下进行文本编辑
- Linux下svn命令switch用法
- [Mac] mac linux 多线程下载利器 axel
- [Mac] mac linux 多线程下载利器 axel
- 网站流量统计,java+jsp 获取访客浏览器,真实ip,操作系统,来源
- shell 编译和运行java文件
- Nginx安装及配置文件nginx.conf详解
- mac-tomcat设置
- opencv中会引起内存泄露的情况
- Linux下使用awk批量删除共享内存