HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

using vi editor in hp-ux

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

using vi editor in hp-ux

Hi

I am using vi editor in HP-UX.

I am not able to delete characters by using keys "del" and "back space".

But i can use this same method in linux.
14 REPLIES
Sajjad Sahir
Honored Contributor

Re: using vi editor in hp-ux


Dear Senthil

if u want a delete character u can use x and if u want a line u can use dd
if u want 5 lines
5dd etc... ok

try

sajjad
Ganesan R
Honored Contributor

Re: using vi editor in hp-ux

Hi Senthilkumar,

vi on hpux is different then linux. In linux most people use bash shell which supports those features.

In HP-UX you should use vi keys (x-key to delete and h-key to move one character left)

Best wishes,

Ganesh.
James R. Ferguson
Acclaimed Contributor

Re: using vi editor in hp-ux

Hi:

Use 'vi' and the keys that were meant for it. The "x" deleles a single character.

See the 'vi' manpages for more.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: using vi editor in hp-ux

Hi (again):

A Google search for 'vi' will offer "cheat-sheets" like:

http://www.lagmonster.org/docs/vi.html

Regards!

...JRF...
Ganesan R
Honored Contributor
Solution

Re: using vi editor in hp-ux

Hi,

Important cursor Movement keys

keys Effect
l Move one character right
h Move one character left
j Move one line down
k Move one line up
Move one character right
G Go to last line of the file
nG Go to line number n in the file
$ Go to end of current line
^ Go to start of line
w Go to beginning of next word
b Go to beginning of previous word
e Move to end of word
H Go to first line of screen
M Go to middle line of screen
L Go to last line of screen
( Go to beginning of sentence
) Go to end of sentence
{ Go to beginning of paragraph
} Go to end of paragraph


Text Deletion Commands

Command Effect
x Delete character at current cursor location.
nx Delete n characters starting at current cursor location.
X Delete previous character from the current cursor location.
nX Delete n previous characters from the current cursor location.
dd Delete current line.
db Delete previous word.
dw Delete from current cursor location to the end of word.
dG Delete to the end of file including current line.
Best wishes,

Ganesh.
Johnson Punniyalingam
Honored Contributor

Re: using vi editor in hp-ux

to delete a letter ..press escape key and then press x
to insert a letter .. press i and then insert the letter
to move cursor use arrow keys.
but there is no backsapce deletion in vi editor


Thanks,
JOhnson
Problems are common to all, but attitude makes the difference
Rita C Workman
Honored Contributor

Re: using vi editor in hp-ux

Attached you'll find an old list of vi commands I typed years ago. I copied it recently for some developers here and you might find it handy.

Open it with Wordpad and it will line up right.

Regards,
Rita
Bijeesh
Respected Contributor

Re: using vi editor in hp-ux

hi
In hp you can't delete characters using "del" key. Use x to delete single char.

see vi man page for more details
T G Manikandan
Honored Contributor

Re: using vi editor in hp-ux

.vimrc is the file where you set your environment for the vi editor,

can you make an entry in the .vimrc at your $HOME dir for the user

set bs=2

Let me know.

Thanks.
Patrick Wallek
Honored Contributor

Re: using vi editor in hp-ux

>>.vimrc is the file where you set your
>>environment for the vi editor,

NO, that is NOT correct.

.vimrc is used for the VIM editor (VI Improved). VIM is **NOT** what is included with HP-UX.

For the **STANDARD VI** editor that is included with HP-UX, you must use the .exrc file in your home directory.
avizen9
Esteemed Contributor

Re: using vi editor in hp-ux

hello,

here is very good document for it, to undestand vi editor, please go through it spend only an hour you will be master for vi editor :)..

http://www.docs.hp.com/en/B2355-90164/ch04.html

you can not compare linux vi editor with Unix both are diff,
Suraj K Sankari
Honored Contributor

Re: using vi editor in hp-ux

Hi,
x is using for a single character

for more information please check the below link

http://thomer.com/vi/vi.html

suraj
Steve Post
Trusted Contributor

Re: using vi editor in hp-ux

Your delete and backspace keys have not been mapped. Apparently they are mapped on linux. Mess with the .exrc file as suggested above.

delete key ---> x
backspace key ----> h

It is also possible the backspace key does not work on a normal prompt.
If you hit a backspace and you get junk on the screen?
Fine. Type this:
stty erase
Then hit the backspace
Then hit return
Now you backspace will work for this terminal session.

steve
Steven Schweda
Honored Contributor

Re: using vi editor in hp-ux

> Your delete and backspace keys have not
> been mapped. Apparently they are mapped
> on linux. [...]

Apparently you're not a big Linux user. More
likely, "vi" on the (unspecified) Linux
system is actually "vim", which has
considerably more features than the stone-age
"vi" on (an unspecified version of) HP-UX.

"vi --version" on the Linux system might be
informative.