The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
create users from template rijeshpp Shell Programming and Scripting 0 10-31-2007 07:29 AM
Extracting information from a template Ernst Shell Programming and Scripting 4 03-06-2007 10:18 PM
About template constraints sarwan High Level Programming 0 11-21-2005 01:11 AM
Template for Disaster Recovery steiner Security 5 08-19-2003 05:28 AM
substitution of variable in template supercbw Shell Programming and Scripting 1 04-11-2002 09:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-21-2005
Registered User
 

Join Date: Jul 2005
Posts: 31
vi calling template

Hello.
I want to copy temp files when I make a new file by vi.
For example,
Code:
09:32:52 ~/ $ mkdir test
09:33:03 ~/ $ cd test/
09:33:09 ~/test/ $ ls
09:33:16 ~/test/ $ vi test.cpp
09:34:37 ~/test/ $ cat test.cpp
#include <iostream>
int main()
{

}
09:34:48 ~/test/ $ vi test.bash
09:35:19 ~/test/ $ cat test.bash
#!/bin/bash

09:35:23 ~/test/ $ vi test.pl
09:35:45 ~/test/ $ cat test.pl
#!/usr/bin/perl

exit;
09:35:50 ~/test/ $
when I make "test.cpp",
I want to do
Code:
cp $HOME/.cpp.tmp ./test.cpp
and open test.cpp by vi.
.cpp.tmp is a template file and It contains
Code:
#include <iostream>
int main()
{

}
Of course I can do this by bash script.
But can I do this by writing something in .vimrc ??
Reply With Quote
Forum Sponsor
  #2  
Old 11-22-2005
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,590
It would be easier to put a function in you .bashrc to do this.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0