Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #230 - Copy current file to another location from within vim

Created: April 2, 2002 7:26 Complexity: basic Author: Tabrez Syed Version: 5.7 Karma: 4/1 Imported from: Tip#230

I work on jsp pages in my source tree but I have to copy the jsp files over to the tomcat directory in order to view my changes.The following mapping will copy the file being edited to another location.


command Cpage silent !cp '%:p' "c:/Progra~1/Tomcat/webapps/console/pages/%"


Explanation:


% refers to the current buffer

%:p refers to the path to the file

silent suppresses the command prompt window.


Usage:


Cpage

Comments

Why not

w %:t c:/Progra~1/Tomcat/webapps/console/pages/

maxiangjiang--AT--homail.com , April 2, 2002 15:11


Advertisement