LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-06-2007, 10:44 AM   #1
brucewayne3210
LQ Newbie
 
Registered: May 2004
Location: everywhere
Distribution: red hat 9
Posts: 14

Rep: Reputation: 0
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.
 
Old 06-06-2007, 10:53 AM   #2
khaan
LQ Newbie
 
Registered: Feb 2007
Distribution: ubuntu
Posts: 24

Rep: Reputation: 15
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).
 
Old 06-06-2007, 11:00 AM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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!
 
Old 06-06-2007, 11:53 AM   #4
arbulus
LQ Newbie
 
Registered: Mar 2007
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
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.
 
Old 06-06-2007, 12:07 PM   #5
BillyGalbreath
Member
 
Registered: Nov 2005
Location: Houston Texas
Distribution: Debian Sid
Posts: 379

Rep: Reputation: 31
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 $@
 
Old 06-06-2007, 01:45 PM   #6
brucewayne3210
LQ Newbie
 
Registered: May 2004
Location: everywhere
Distribution: red hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 06-06-2007, 01:47 PM   #7
brucewayne3210
LQ Newbie
 
Registered: May 2004
Location: everywhere
Distribution: red hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
dont you rate replies someone tell me how to rate replies so i can give billy a 10 out of 10.
 
Old 06-07-2007, 08:43 AM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub issues: dual boot Debian i386 & Debian amd64 ErrorBound Debian 1 03-09-2007 07:41 PM
Dual boot Debian Etch and XP with GRUB - Debian installed First - one HDD bence8810 Debian 11 01-07-2007 10:45 AM
ndiswrapper-1.10 debian debian sarge BCM4306 802.11b/g ]x-k[ Linux - Wireless Networking 3 03-12-2006 12:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration