Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{TipImported
 
{{TipImported
 
|id=230
 
|id=230
|previous=229
+
|previous=228
 
|next=231
 
|next=231
 
|created=April 2, 2002
 
|created=April 2, 2002
Line 9: Line 9:
 
|version=5.7
 
|version=5.7
 
|rating=4/1
 
|rating=4/1
  +
|category1=
  +
|category2=
 
}}
 
}}
 
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.
 
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.
Line 30: Line 32:
   
 
:w %:t c:/Progra~1/Tomcat/webapps/console/pages/
 
:w %:t c:/Progra~1/Tomcat/webapps/console/pages/
  +
  +
----
  +
on a windows environment eg. to tmp dir:
  +
  +
:silent !copy % "c:\tmp\"
   
 
----
 
----

Revision as of 13:19, 6 October 2009

Tip 230 Printable Monobook Previous Next

created April 2, 2002 · complexity basic · author Tabrez Syed · version 5.7


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/

on a windows environment eg. to tmp dir:

:silent !copy % "c:\tmp\"