Solved

press the escape key from a text file in vim

Posted on 2006-07-19
4
207 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
Comment Utility
echo -e "\033" >file
cat file

or simply

echo -e  "\033"

0
 
LVL 15

Accepted Solution

by:
bpmurray earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

14 Experts available now in Live!

Get 1:1 Help Now