sponsor Vim development Vim logo Vim Book Ad

copypath.vim : Copy current editing file path to clipboard.

 script karma  Rating 17/18, Downloaded by 2604  Comments, bugs, improvements  Vim wiki

created by
omi taku
 
script type
utility
 
description
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.

   :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.
 
install details
1. Unzip copypath.zip ,
   and extract there to your vim runtimepath directory ,
   $HOME/vimfiles/plugin or $HOME/.vim/plugin directory directory.

   Refer to ':help add-plugin', ':help add-global-plugin' and ':help runtimepath'
   for more details about Vim plugins.

2. Restart Vim.
3. To run this script, Vim needs to be compiled with "+clipboard" option.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
copypath.zip 1.0 2009-12-16 6.0 omi taku o  change script package file format to zip format.
o  unnamed register copy option is added.
copypath.vim 0.1.2 2006-02-03 6.0 omi taku document is updated.
copypath.vim 0.1.1 2006-02-02 6.0 omi taku fix bug.
copypath.vim 0.1 2006-02-02 6.0 omi taku Initial upload
ip used for rating: 13.59.218.147

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github