copypath.vim


Ⅰ. 插件描述

Copy current editing file path to clipboard.

Ⅱ. 基本信息

创建日期:  2006-02-02
使用用户:  5
Github星:  1
插件作者:  Owen Garland

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'bag-man/copypath-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'bag-man/copypath-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'bag-man/copypath-vim-looking-forward'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/bag-man/copypath.vim

Ⅳ. 文档说明

I have forked this, and added a function to copy the relative path of a file from the CWD.
I map "cp" to ":CopyRelativePath<cr>" which makes running tests a lot easier.

Usage:
This script adds two new command ":CopyPath" and ":CopyFileName".
You can use the ":CopyPath" command to copy file path to clipboard,
and you can use the ":CopyFileName" command to copy file name to clipboard.

:CopyPath

   copy current editing file full path to clipboard.
   And, if you set g:copypath_copy_to_unnamed_register option to 1 then,
   copy file full path to unnamed register too.
   Default, not copy to unnamed register.
   

:CopyRelativePath

   copy current editing file relative path to clipboard.
   And, if you set g:copypath_copy_to_unnamed_register option to 1 then,
   copy file full path to unnamed register too.
   Default, not copy to unnamed register.

:CopyFileName

   copy current editing file name to clipboard.
   And, if you set g:copypath_copy_to_unnamed_register option to 1 then,
   copy file name to unnamed register too.
   Default, not copy to unnamed register.

Configuration:
g:copypath_copy_to_unnamed_register

  set this option value to 1 then, copy file path and name to unnamed register too.
  let g:copypath_copy_to_unnamed_register = 1

<

Note:
o To run this script, Vim needs to be compiled with "+clipboard" option.

添加新评论