LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Using Vi In Debian (https://www.linuxquestions.org/questions/debian-26/using-vi-in-debian-559639/)

brucewayne3210 06-06-2007 10:44 AM

Using Vi In Debian
 
When using etch (debain ) I try to vi a file. then when i try to use the number pad on the right side of the key board it puts in weird characters and adds a new line. is their something i can set in the shell or something that will allow me to use the keypad while in vi insert mode.

khaan 06-06-2007 10:53 AM

Not sure it helps, but if you are using the old-school vi, try switching to vim (vi improved).
To do so install the package "vim" and add
alias vi='vim'
to your ~/.bashrc (or other shell configuration file if you are using another shell).

IsaacKuo 06-06-2007 11:00 AM

The "vi" in Debian is actually vim, just like virtually any other Linux distribution. The arrow keys work just fine for me, unless I'm su'd as root (which is rather often). I never bothered learning how to fix it, because I'm an grizzled old vi user who has "hjkl" ingrained in the skull.

Once you have "hjkl" mastered, reaching over to the arrow keys takes too much time. Reaching all the way over to the number pad? Not for me!

arbulus 06-06-2007 11:53 AM

From what I understand, Vi is deprecated now. Vim has replaced it. You can access it just the same way you do Vi:

Code:

vim /filename/here
All of the same Vi commands still work, and you should be able to use the keypad just fine.

BillyGalbreath 06-06-2007 12:07 PM

That's very good advice about Vim, but to answer the poster's original question:

The numeric keypad doesn't work in "vi" when the term is set to "vt100" or "xterm". However, if you set your term type to 'ansi', then it will work. The recommended solution if you want to use the numeric keypad on a regular basis is to create a shell script.

EXAMPLE:
Code:

#!/bin/sh
set TERM=ansi
export TERM
exec /usr/bin/vi $@


brucewayne3210 06-06-2007 01:45 PM

Yo billy you are the man. that worked and it was exactly what i was looking for. That is the everest of finds. I am work with brainy unix admins who didnt know the answer.

brucewayne3210 06-06-2007 01:47 PM

dont you rate replies someone tell me how to rate replies so i can give billy a 10 out of 10.

JimBass 06-07-2007 08:43 AM

They used to have an affero system here, but they dropped it some time ago. I usually use the posts count to determine if the poster knows what they are talking about. Obviously Acid Kewpie with his 27,000+ posts can still make mistakes, and somebody who just finds this site might have only 1 post and have it be truly brilliant, but a fairly rough metric is the more posts, the better the chances are the info is good.

Peace,
JimBass


All times are GMT -5. The time now is 11:28 PM.