Solved

press the escape key from a text file in vim

Posted on 2006-07-19
4
208 Views
Last Modified: 2010-04-22
Hi,

I would like to create a text file, such that when I "cat" the file from xterm, it is as if I am pressing the <escape> button on my keyboard.  Is there a known way to do this?
0
Comment
Question by:bryanlloydharris
  • 2
4 Comments
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 125 total points
ID: 17143279
echo -e "\033" >file
cat file

or simply

echo -e  "\033"

0
 
LVL 15

Accepted Solution

by:
bpmurray earned 125 total points
ID: 17144147
Why not use vim to add the character? You need to use CTRL-V CTRL-[ to add the escape character. Of course, if you're using the windows version, you may have CTRL-V remapped to paste, in which case the default replacement is CTRL-Q, i.e. type CTRL-Q CTRL-[ to add escape to the file.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 17144560
Good point bpmurray.  I was looking at the question rather than the subject.

Just proves again that it is always better to describe the problem you are trying to solve rather than asking how to solve the way you think it should be done.
0
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 17160718
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now