Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Are the VIM devs on crack?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
23 posts • Page 1 of 1
Author
Message
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

Are the VIM devs on crack?

  • Quote

Post by routerguy » Wed May 26, 2004 4:58 am

Why on earth did they decide to map h, j, k, and l to left, down, up, and right? This means that every time I want to move, I have to lift my hand and move it away from standard typing form! Shouldn't left, down, up, and right be mapped to j, k, l, and ;? I know that ; conflics with :, but that is only when caps is on.

is it recommended to remap the keys? If it is, then how? I'm just learning, so if there is some hidden reason for putting the commands on those keys, just tell me.

BTW, I'm learning VIM and so far, it is worlds better than gedit / notepad / nano.
Top
Bushwack
n00b
n00b
Posts: 14
Joined: Fri Jan 16, 2004 7:26 pm

  • Quote

Post by Bushwack » Wed May 26, 2004 5:25 am

Good question, I've never considered that.

Personally I find most of my cursor movements are downs, and 'j' is the easiest key to hit so it works well for me.
Top
farrioth
Apprentice
Apprentice
User avatar
Posts: 282
Joined: Sun Nov 23, 2003 6:53 am
Location: Auckland

  • Quote

Post by farrioth » Wed May 26, 2004 5:26 am

This is a historic thing from Vi. I use arrow keys personally. Fell free to remap them. Some people like j, k, i, l (left, down, up, right).

Mapping is performed by "map char func" in .vimrc, so:

Code: Select all

map j <Left>
map k <Down>
map l <Up>
map ; <Right>
[code]
Top
ptolomy
n00b
n00b
User avatar
Posts: 34
Joined: Fri Jan 09, 2004 5:10 pm

  • Quote

Post by ptolomy » Wed May 26, 2004 7:40 am

To me, the vim bindings feel pretty natural and make sense
once learned.

Your right hand (dominant hand in most) is over the movement keys
except 'h'. It could be over all of the movement keys, but they you lose
the pinkey on ":", which is probably the other big important one.

Now that I've gotten used to those, I really hate the slowness that
finding the arrow keys brings.
Top
farrioth
Apprentice
Apprentice
User avatar
Posts: 282
Joined: Sun Nov 23, 2003 6:53 am
Location: Auckland

  • Quote

Post by farrioth » Wed May 26, 2004 10:52 am

I use Dvorak, so hjkl are nonsensical to me anyway. I'm using a notebook-style keyboard, so tha arrows aren't really a problem.
Top
meteor
n00b
n00b
Posts: 54
Joined: Wed Oct 30, 2002 8:35 pm
Location: Old School Europe
Contact:
Contact meteor
Website

  • Quote

Post by meteor » Wed May 26, 2004 11:22 am

In fact this is a very nice feature of Vim. Initially I had to force myself to use it, but it is worth it. It does let you type faster, specifically if you're used to the 10-finger system typing. Also you'll find a lot of other applications, which support these key bindings.
Top
Anior
Guru
Guru
User avatar
Posts: 317
Joined: Thu Apr 17, 2003 10:52 pm
Location: European Union (Stockholm / Sweden)

  • Quote

Post by Anior » Wed May 26, 2004 1:40 pm

H, J, K and L are found on the same place on all qwerty-keyboards I have found. ";" moves around a bit. On swedish keyboards that key is used to type "Ö".
Top
docbill
n00b
n00b
Posts: 9
Joined: Tue May 18, 2004 4:19 pm

Re: Are the VIM devs on crack?

  • Quote

Post by docbill » Wed May 26, 2004 1:53 pm

Mystic0 wrote:Why on earth did they decide to map h, j, k, and l to left, down, up, and right? This means that every time I want to move, I have to lift my hand and move it away from standard typing form! Shouldn't left, down, up, and right be mapped to j, k, l, and ;? I know that ; conflics with :, but that is only when caps is on.

You definitely can't blaim the vim developers for that one. That has been part of vi for at least twenty years, probably longer. I imagine the original key mapping was either choisen somewhat arbitrarily, or based on a program that existed before vi... I've tried remapping the other way, and I have found the hjkl mapping what I find most comfortable. The reason is the pinky is a weak finger. If I press down with it regularly I get a sore hand. It is much more comfortable to reach my index finger over to the h from the j. It does not require moving the rest of my hand, but I do have large fingers. In anycase, when actually typing text you need ^H to erase mistakes, so at least people at the time of vi's development were used to pressing h to go back. Perhaps now, more people use the backspace key, because they aren't use to environments where ^H works.

Bill
Last edited by docbill on Wed May 26, 2004 2:23 pm, edited 1 time in total.
Top
DaveArb
Guru
Guru
Posts: 510
Joined: Thu Apr 29, 2004 2:46 pm
Location: Texas, USA

Re: Are the VIM devs on crack?

  • Quote

Post by DaveArb » Wed May 26, 2004 2:06 pm

docbill wrote:In anycase, when actually typing text you need ^H to erase mistakes, so at least people at the time of vi's development where used to pressing h to go back. Perhaps now, more people use the backspace key, because they aren't use to environments where ^H works.
Also note that when not in Insert mode, the rubout key (that was a common name for backspace when vi was young ;)) does the same thing as h, cursor left.

I think vi was a feature of 1BSD, which was "released" in 1975.

Dave
Top
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Wed May 26, 2004 2:53 pm

Hm, I was picking up my hand every time I wanted to move. I never considered leaving my hand and just moving my index finger one key to the left to type H. However, it still feels more natural to leave my hand in one spot. As far as I know, ; isn't used for anything in VI /VIM. (If it is just tell me) How do I go about remapping it?
Top
rewt
n00b
n00b
User avatar
Posts: 58
Joined: Thu Feb 19, 2004 9:38 am

  • Quote

Post by rewt » Wed May 26, 2004 2:59 pm

Anior wrote:H, J, K and L are found on the same place on all qwerty-keyboards I have found. ";" moves around a bit. On swedish keyboards that key is used to type "Ö".
I think Anior hit the nail on the head here. Infact I was thinking of posting the same until I read his comment
The fact is that keyboard layouts are different in different countries and that area of swiss keyboards (for example) is right where the accented chars are. h,j,k and l are all laid out in the same place on almost all keyboards (Dvorak being an exception that springs to mind), even non querty such as swiss and french
Because sometimes peace is another word for surrender... and secrets have a way of getting out
Top
numpf
n00b
n00b
Posts: 4
Joined: Mon May 17, 2004 3:06 pm

  • Quote

Post by numpf » Wed May 26, 2004 4:31 pm

although I'm not actually old enough myself to know for sure, I'd presume it's because back when vi was first written there were keyboards on which _there were no_ arrow keys, backspace, etc. And we all know how notoriously bad linux is at supporting even the most pathetically obsolete setups. I would hope vim supports changing keybindings, but defaults are fine for me so I never looked.
Top
Unne
l33t
l33t
User avatar
Posts: 616
Joined: Mon Jul 21, 2003 4:23 pm
Contact:
Contact Unne
Website

  • Quote

Post by Unne » Wed May 26, 2004 4:56 pm

I've tried time and time again to use hjkl, but I can't do it. The arrow keys are plenty fast enough for me though. When I type, my hands tend to bounce around, rather than sit on the home row and reach my fingers, so I guess it's my fault. Somehow I always hit : with my middle finger. :? Such is life for those of us who never had a typing class. I doubt any one keyboard layout is going to be perfect for everyone, especially when you get down to the possiblity of detailed keyboard remapping of something like vim.
Top
aroben
n00b
n00b
Posts: 33
Joined: Fri Oct 10, 2003 5:45 pm

  • Quote

Post by aroben » Wed May 26, 2004 10:26 pm

My guess is that most movements will be up or down, so using `j' and `k' puts those right under your strongest fingers (index and middle). Also, there are keybindings such as `w' and `b' for moving forward and back through a line of text, and then you can use `h' and `l' for small adjustments. I'd also agree with docbill that the pinky is no fun to use for any length of time.

-Adam
Top
MacMasta
Guru
Guru
User avatar
Posts: 545
Joined: Thu Apr 18, 2002 5:29 am
Location: Anchorage, AK

  • Quote

Post by MacMasta » Wed May 26, 2004 11:08 pm

; doesn't get much use; there (as I recall) are some fancy things it does in LaTeXSuite, though.

As you know, : does all sorts of things...

And, for those of us on dvorak, hjkl still sort of make sense; h is under the right index (good place for "go left"), j and k are left-handed, where c and v are on querty, and l is up-and-right, where p is on qwerty. So they're still pretty well-placed.

For the guy higher up who had never taken a typing class, may I suggest switching to the dvorak layout without actually changing your keyboard around? I forced myself to learn to touch-type dvorak by not moving the keys around, just re-mapping the keyboard; now I'm fast (dvorak + touch typing = fast), and multi-keyboard-lingual (if I look at the keys, my start typing qwerty, because that's how I typed qwerty in the old days)

And it has the added advantage of confusing the hell out of your friends.

Code: Select all

setxkbmap [us|dvorak]
in X, or

Code: Select all

loadkeys [us|dvorak]
in console. (assuming your default layout is the US standard layout)

~Mac~
Last edited by MacMasta on Thu Jun 10, 2004 6:44 pm, edited 1 time in total.
Top
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Thu May 27, 2004 12:58 am

I still don't know how to remap keys...
Top
robmoss
Retired Dev
Retired Dev
Posts: 2634
Joined: Tue May 27, 2003 4:42 pm
Location: Jesus College, Oxford
Contact:
Contact robmoss
Website

  • Quote

Post by robmoss » Thu May 27, 2004 1:29 am

Read your own thread then :P
farrioth wrote:This is a historic thing from Vi. I use arrow keys personally. Fell free to remap them. Some people like j, k, i, l (left, down, up, right).

Mapping is performed by "map char func" in .vimrc, so:

Code: Select all

map j <Left>
map k <Down>
map l <Up>
map ; <Right>
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Top
polin8
n00b
n00b
User avatar
Posts: 74
Joined: Thu Oct 03, 2002 7:37 pm
Location: Baltimore, MD USA
Contact:
Contact polin8
Website

  • Quote

Post by polin8 » Thu May 27, 2004 2:00 am

No, the vim devs are not on crack, Bill Joy wrote Vi some 30ish years ago and chose hjkl, vim is much nicer than Vi but its still basically Vi.

old adm3 terminals had hjkl keys that were also the arrow keys, or so rumor has it.

I don't recommend remapping them. It doesn't take long to get used to.

:wq
Jabber: bskahan*AT*jabber*DOT*org
Top
papal_authority
Veteran
Veteran
User avatar
Posts: 1823
Joined: Wed Mar 31, 2004 4:07 am
Location: Canada

  • Quote

Post by papal_authority » Thu May 27, 2004 2:59 am

Well I disagree that vim is nicer than vi. It's definitely larger though (about 46 times the size). So Mystic0 may be on to something regarding the rampant crack use among vim developers :twisted:

Code: Select all

-rwxr-xr-x  1 urban vatican 9500966 May 26 19:39 vim
-rwxr-xr-x  1 urban vatican  207218 May 26 19:36 ex
If I have to use vim I invoke it as vim -C -i NONE -u NONE to make it behave sanely. There's some decent info and history on vi here.
Top
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Wed Jun 09, 2004 11:26 pm

farrioth wrote:Some people like j, k, i, l (left, down, up, right).
Sorry to bring back this thread, but this suggestion peaked my interest. If I were to use this setup, where is a good place to remap "insert"? (Which would now be taken by "up".)

thanks.
Top
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Wed Jun 09, 2004 11:53 pm

Hm, how about "o"? It seems to do the same thing as "i".
Top
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Wed Jun 09, 2004 11:59 pm

Wow, this new setup feels SO much better. :D
Top
MacMasta
Guru
Guru
User avatar
Posts: 545
Joined: Thu Apr 18, 2002 5:29 am
Location: Anchorage, AK

  • Quote

Post by MacMasta » Thu Jun 10, 2004 6:42 pm

Well, 'o' is (originally) 'insert on next line', which is very different from 'i'.

(It's not clear from your post whether you've remapped 'o' too, so I figured I'd tell you what they originally did...)


On the other hand, you may know all of this already.
8O

~Mac~
Top
Post Reply

23 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic