vi editor for SUN OS


 
Thread Tools Search this Thread
Operating Systems Solaris vi editor for SUN OS
# 1  
Old 06-03-2008
vi editor for SUN OS

I need to change the editor to vi in SUN OS. I need to use the options that vi gives while I am typing on the command line. I can vi any file and make changes to it. But my problem is when I am using the command line. Currently I cannot use the vi options while doing so. Hence, while I am typing a command if I need to go back to the first work and make some modifications I have to delete all typed words and retype the whole command. In AIX I used to run 'set vi -o' command or run it in my .profile. But that is not working in SUN OS.
# 2  
Old 06-03-2008
you didn't say what shell you're using.
If ksh or bash:
Code:
set -o vi

# 3  
Old 06-04-2008
This will be for ksh...
Damn..I was trying set vi -o
Novice mistake..
Thank you for your help..
# 4  
Old 06-06-2008
you can run

bash -o vi

or

ksh -o vi

depending on your shell.

after that just to esc+k (press 'k' key and hold it there) will recall all the commands.

Beware tho, if more than one person logging on using same unix id running commands and trying esc+k at the same time, before you 'enter' make sure you look carefully first. example

You run ls -l as root in /
Your friend in maybe /export/home runs command rm -r *
you esc+k and press enter key without looking you may end up running rm -r * in / and you're big dodo Smilie



also try pressing esc+j and see what happens

Last edited by sparcguy; 06-06-2008 at 01:36 AM..
# 5  
Old 06-06-2008
use either of the following:
TERM=vt100;export TERM
EDITOR=vi;export EDITOR
TERM=sun; export TERM

use "stty erase + <backspace_key>" to make deletion easier
# 6  
Old 06-06-2008
Thank you all for your responses. the 'set' command worked with. I have included that line in both the .profile
# 7  
Old 06-09-2008
Question VI editor

Hello,

I want same linux(redhat,centos) vi editor in my solaris10. Is there any option or any package for sunsolaris10?


Please let me know.



Prashant.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

2. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

3. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

4. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

5. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

6. UNIX for Advanced & Expert Users

Help: Sun Disk partitioning for Sun V240 & StorEdge 3300

Dear Sun gurus, I have Sun Fire V240 server with its StorEdge 3300 disk-array. Following are its disks appeared in format command. I have prepared its partitions thru format and metainit & metattach (may be i have made wrong steps, causing the errors below because I have done thru some document... (1 Reply)
Discussion started by: shafeeq
1 Replies

7. UNIX for Dummies Questions & Answers

Text editor on Sun OS 3.0

I trying to setup a netranger security box. I don't know unix and went to view a filein the text editor. What is command to exit text editor. I tried esc q and ctrl q. HELP!!! STUCK IN TEXT EDITOR :) (2 Replies)
Discussion started by: malic
2 Replies
Login or Register to Ask a Question