rename.vim


Ⅰ. 插件描述

Rename the current file in the vim buffer + retain relative path.

Ⅱ. 基本信息

创建日期:  2011-08-12
使用用户:  11
Github星:  10
插件作者:  Henrik Nyh

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'henrik/rename-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'henrik/rename-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'henrik/rename-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Git branch of http://www.vim.org/scripts/script.php?script_id=1928

rename.vim - Rename a buffer within Vim and on the disk

Copyright June 2007 by Christian J. Robinson (infynity@onewest.net).

Updated August 2011 by Dan Rogers (dan@danro.net).

Updated February 2012 with fixes by Andrew Raw, added by Henrik Nyh.

Distributed under the terms of the Vim license. See ":help license".

Usage:

Give the current file a new name in the same directory:

:Rename bar.txt

Give the current file a new name in a directory relative to the working directory:

:Rename sub/bar.txt
:Rename ../sibling/bar.txt

Give the current file a new name in an absolute directory:

:Rename /tmp/bar.txt

Add a bang to create the directories if they don't exist:

:Rename create/these/dirs/bar.txt!
:Rename! create/these/dirs/bar.txt

The bang is required so typos don't create unintended directories.

添加新评论