06-05-2017
You gave us no details. Makes it hard to help you.
An overview of what you want:
.exrc is a setup file for vi, where you define keystrokes to be macros.
Create the macros you need in the
.exrc file in your home directory.
Here are examples of how to do that:
my .exrc
Now you need to tell us what exactly you mean by 'regular expression from string'
This User Gave Thanks to jim mcnamara For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:1,10 s/yes/no/g
this ex command will substitute yes with no everytime it is found within the first 10 lines of the file.
:s/yes/no/g
this ex command will substitute yes with no everytime it is found for the line where the cursor is on
my question is how could this substitution be... (4 Replies)
Discussion started by: theDirtiest
4 Replies
2. UNIX for Dummies Questions & Answers
I want to copy lines say from 2-5 to line after 20 in vi editor. Can I achieve this in a single command in vi editor.
Thanks. (2 Replies)
Discussion started by: tselvanin
2 Replies
3. UNIX for Dummies Questions & Answers
Here is my problem,
I manage a SunOs 5.8 Server, vi is the default command line
editor, I have a line on each users .kshrc profile as follows:
export EDITOR=/bin/vi
I want to use vim as the command line editor, the below line
doesn't work
export EDITOR=/bin/vim
Thank you (1 Reply)
Discussion started by: tony3101
1 Replies
4. UNIX for Dummies Questions & Answers
Is there a Command to find out user creation date ?
or any other possible ways to find the same. (6 Replies)
Discussion started by: Crazy_murli
6 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
Here is an example, I would wan to search for all string consists of IMP but not IMP-00015. Values other than 00015 is fine, is there anyone knows how to do that?
Thanks. (2 Replies)
Discussion started by: *Jess*
2 Replies
6. Shell Programming and Scripting
I've this command in a script which edits the file ...
bash$ cat temp_file.txt
THREAD #2 2 Running
bash$ (echo "s/THREAD #2/d"; echo 'wq') | ex -s temp_file.txt
bash$ cat temp_file.txt
THREAD #2 2 Running
If i've more than 1 line it easily deletes the line, but if it is the last line... (3 Replies)
Discussion started by: prash184u
3 Replies
7. OS X (Apple)
Is it possible to find all files based on the date of creation? And if so, how? I've been looking at the find command but it seems that only modification times are used as an option. (1 Reply)
Discussion started by: Straitsfan
1 Replies
8. UNIX for Dummies Questions & Answers
Hi Folks
I have opened a log file in Vi editor
vi abc.logPlease advise me how to finally quit from Vi editor, which command is there..!
Is it :q<Enter> (1 Reply)
Discussion started by: KAREENA18
1 Replies
9. Shell Programming and Scripting
I have input file
04000912|100:|||||]|101:||]|creDate:1451876825000|1441324800000:]|1444003200000:]|1446595200000:]|1449187200000:]|1451865600000:]
I have to get output as below
ID|Re_Date|Re_Value|Re_date
04000912|100|40.0|44
04000912|100|50.0|55
04000912|100|60.0|66... (4 Replies)
Discussion started by: shabeena
4 Replies
10. UNIX for Beginners Questions & Answers
Hi Guru's,
I'm new at Unix. I am tasked to monitor the filesystem utilization on OS level (Unix) and DB (Sybase) for multiple systems. I am thinking to use vi editor and make a file, execute that file and all the file systems I need to monitor will be be shown.
My script inside vi goes in... (8 Replies)
Discussion started by: Xworks
8 Replies
ELVIS(1) General Commands Manual ELVIS(1)
NAME
elvis, ex, vi - The editor
SYNOPSIS
elvis [flags] [+cmd] [files...]
DESCRIPTION
Elvis is a text editor which emulates vi/ex.
On systems which pass the program name as an argument, such as Unix and Minix, you may also install elvis under the names "ex", "vi",
"view", and "input". These extra names would normally be links to elvis; see the "ln" shell command.
When elvis is invoked as "vi", it behaves exactly as though it was invoked as "elvis". However, if you invoke elvis as "view", then the
readonly option is set as though you had given it the "-R" flag. If you invoke elvis as "ex", then elvis will start up in the colon com-
mand mode instead of the visual command mode, as though you had given it the "-e" flag. If you invoke elvis as "input" or "edit", then
elvis will start up in input mode, as though the "-i" flag was given.
OPTIONS
-r To the real vi, this flag means that a previous edit should be recovered. Elvis, though, has a separate program, called elvrec(1),
for recovering files. When you invoke elvis with -r, elvis will tell you to run elvrec.
-R This sets the "readonly" option, so you won't accidentally overwrite a file.
-t tag This causes elvis to start editing at the given tag.
-m [file]
Elvis will search through file for something that looks like an error message from a compiler. It will then begin editing the
source file that caused the error, with the cursor sitting on the line where the error was detected. If you don't explicitly name a
file, then "errlist" is assumed.
-e Elvis will start up in colon command mode.
-v Elvis will start up in visual command mode.
-i Elvis will start up in input mode.
-w winsize
Sets the "window" option's value to winsize.
+command or -c command
If you use the +command parameter, then after the first file is loaded command is executed as an EX command. A typical example
would be "elvis +237 foo", which would cause elvis to start editing foo and then move directly to line 237. The "-c command" vari-
ant was added for UNIX SysV compatibility.
FILES
/tmp/elv*
During editing, elvis stores text in a temporary file. For UNIX, this file will usually be stored in the /tmp directory, and the
first three characters will be "elv". For other systems, the temporary files may be stored someplace else; see the version-specific
section of the documentation.
tags This is the database used by the :tags command and the -t option. It is usually created by the ctags(1) program.
.exrc or elvis.rc
On UNIX-like systems, a file called ".exrc" in your home directory is executed as a series of ex commands. A file by the same name
may be executed in the current directory, too. On non-UNIX systems, ".exrc" is usually an invalid file name; there, the initializa-
tion file is called "elvis.rc" instead.
SEE ALSO
ctags(1), ref(1), virec(1), elvis(9).
Elvis - A Clone of Vi/Ex, the complete elvis documentation.
BUGS
There is no LISP support. Certain other features are missing, too.
Auto-indent mode is not quite compatible with the real vi. Among other things, 0^D and ^^D don't do what you might expect.
Long lines are displayed differently. The real vi wraps long lines onto multiple rows of the screen, but elvis scrolls sideways.
AUTHOR
Steve Kirkendall
kirkenda@cs.pdx.edu
Many other people have worked to port elvis to various operating systems. To see who deserves credit, run the :version command from within
elvis, or look in the system-specific section of the complete documentation.
ELVIS(1)