Re: Insert mode and arrow keys philosophy
Pavel Shevaev wrote: On 2/21/07, DervishD <[EMAIL PROTECTED]> wrote: Hi Laurent :) Unfortunately, I still have problems using 'h' :( That's my biggest problem at the moment as well, as a blind typer i can't get used to it...oh, i think i just should stop whining and exercise more ;) I think I understand the issue; one sort of expects to use a different finger for each motion. I've sort of gotten used to shifting my right hand "one key" to the left when I intend to move the cursor, thus I get right index finger == h right middle finger == j right ring finger == k right little finger == l Of course, that means whenever I use OtherEditors, such as with certain mail clients, I end up with jjkkllhhh#)*&()*& sequences :O . Regards, Chip Campbell
Re: Insert mode and arrow keys philosophy
Hi Pavel :) * Pavel Shevaev <[EMAIL PROTECTED]> dixit: > On 2/21/07, DervishD <[EMAIL PROTECTED]> wrote: > >Unfortunately, I still have problems using 'h' :( > > That's my biggest problem at the moment as well, as a blind typer i > can't get used to it...oh, i think i just should stop whining and > exercise more ;) Me too! ;)) My problem is not really blind typing or touch typing, I can do it. My problem is that my brain doesn't associate movement "one key at the left". I have my fingers over jklñ (a spanish keyboard), so moving around with those four keys is OK to me, but hjkl is a bit more difficult. I suppose I can map them, but if I learn moving around using hjkl I want to learn it to be able to use it in any vim or vi I use. As you very intelligently said: I should stop whining and exercise more! ;))) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen!
Re: Insert mode and arrow keys philosophy
On 2/20/07, DervishD <[EMAIL PROTECTED]> wrote: Hi Laurent :) * vim <[EMAIL PROTECTED]> dixit: > The idea behind using h/j/k/l is to avoid moving your hand/wrist too > often while going back and forth between your keyboard and the arrow set > (although the use of h/j/k/l might have originated for other reasons > back in the old 'vi' days). Hitting ESC doesn't make your wrist move? I may have a very small hand, but I have to move my left hand for hitting ESC. I suspect that the main reason behind the hjkl (which is very unnatural for me, the arrows have a much better design with the inverted T at least IMHO) was that the first keyboards used to develop/use vi probably hadn't arrow keys, or they were very far at the right of the keyboard. The keyboard on which the original author of vi (Bill Joy) worked indeed did not have the arrow keys. See http://en.wikipedia.org/wiki/Vi for the layout and the name of the keyboard. Yakov
Re: Insert mode and arrow keys philosophy
On 2/21/07, DervishD <[EMAIL PROTECTED]> wrote: Hi Laurent :) Unfortunately, I still have problems using 'h' :( That's my biggest problem at the moment as well, as a blind typer i can't get used to it...oh, i think i just should stop whining and exercise more ;) -- Best regards, Pavel
Re: Insert mode and arrow keys philosophy
Hi Laurent :) * vim <[EMAIL PROTECTED]> dixit: > About the wrist movement that's just as bad when you hit ESC as when > you use the arrow keys: just do the movement in slow motion for > yourself: Yes, I've done it: the distance (in my keyboard at least) from touch typing position to ESC and arrows is more or less the same (measured from little finger to key). I have to move the same set of parts and muscles, only in different directions (northwest for ESC, southeast for arrows). Having the ESC key remapped DOES make a difference. I've tested a bit and I move a bit faster (not counting errors due to insist that 'j' is left instead of 'h') mapping ESC to 'jj' and using hjkl. Unfortunately, I still have problems using 'h' :( > If it is true that at first some of the shortcuts are a bit > 'unnatural' and could feel like you type twice more to reach the same > results as with using the keyboard-provided keys, in the long term, > once you've mastered motion in Vim, you'll realise that it's tuely > priceless and it does speed up your typing. You must take into account another thing: in any other program you end up moving using the arrows and movement keys. So, doing movement without thinking in vim is difficult to me, because a whole lot other programs I use force me to use the arrows (no problem, because I don't type as much text there, so I can keep my hand on the arrows). Learning two sets of movements are not that difficult, but anyway *is* difficult. And of course, I'm not discussing that having the hand at touch typing position really improves performance at the keyboard: that's true. And blind typing does, too. The point I try to make is that ESC is a very bad key to switch modes, but a simple mapping solves that, really. > Good luck with it! Thanks ;)) I'm still learning motion commands appart from hjkl, and probably I will make a plan: learn to move by chars (done), after that do it by words and later go to more sophisticated commands like 'f'. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen!
Re: Insert mode and arrow keys philosophy
Hi all, In my first reply to this topic, I had in mind the 'small' keyboards without arrows keys (I first started to code BASIC on an Apple 2 and the T arrows weren't on the keyboard). This is why I said "although the use of h/j/k/l might have originated for other reasons back in the old 'vi' days". Thanks to Gene to confirm this and here is a picture of an ADM-3a keyboard: http://neil.franklin.ch/Computers/ADM-3A/IMG_0344.JPG. About the wrist movement that's just as bad when you hit ESC as when you use the arrow keys: just do the movement in slow motion for yourself: Hitting ESC is merely a little stretch with your hand (I use my middle finger to hit ESC) while you have to move your arm, elbow, forearm and hand to use the arrows keys. Don't forget either that in 'motion' mode you have tons of other shortcuts that will speed up your typing and avoid you to 'move' your hand to HOME, END, PG-UP and PG-DOWN etc. And as Raimon pointed out, ESC can be remapped to anything you want that could be easier for you to use. If it is true that at first some of the shortcuts are a bit 'unnatural' and could feel like you type twice more to reach the same results as with using the keyboard-provided keys, in the long term, once you've mastered motion in Vim, you'll realise that it's tuely priceless and it does speed up your typing. Good luck with it! All the best; Laurent
Re: Insert mode and arrow keys philosophy
On Tue, 20 Feb 2007 17:28:37 -0500, "Gene Kwiecinski" <[EMAIL PROTECTED]> wrote: > Pretty much so. Early dumbterminals (think ADM-3a and similar critters) > didn't have arrow keys, but they *did* go so far as to have little arrow > marks on the keycaps themselves, underneath the letters, on -- you > guessed it -- h/j/k/l. I remember using that sort of terminal. At one point I also had to use one where the escape key was so far from the rest of the keys that I almost had to get up and walk across the room to reach it, so for a long time I was accustomed to using Ctrl-[ in place of escape. As for getting into the "correct" habits, I don't think it matters. Use whatever works. If you're frequently moving between keyboards with different layouts then it helps to stick with the main key block as much as possible, but otherwise use what is the most comfortable. When editing a file I usually use hjkl for movement, but if all I'm doing is viewing a file then I rest my right hand next to the cursor keys and use them instead, as I find it to be a more relaxed position. If there is a vi philosophy it's a matter of being familiar with all the ways of moving around and being able to use them. For example, if you're on the word "moving" in the previous sentence and want to add something before the full stop then a vi master will type f.i or t.a to get there, while someone less advanced might hit w until they're in the right place, then i. The wrong way to do it is to hit the right arrow key over and over again or to reach for the mouse: that's the notepad way of working, and it tarnishes the soul. -- Matthew Winn
Re: [Fwd: Re: Insert mode and arrow keys philosophy]
Hi Tony :) * A.J.Mechelynck <[EMAIL PROTECTED]> dixit: >> to hit the ESC and change modes fast, but I hadn't and now hitting ESC >> is very unnatural to me, even though I use it in my shell to clean the >> command line!. > If the Esc key is too far, you may try using Ctrl-[ instead -- Vim > sees it as Esc. Worst for me: I have to move both hands: Ctrl is... well, Ctrl, too low, and my [ key is on the far right and, normally, it would need Alt-Gr to be pressed. I prefer the mappings you've posted below ;))) > One of my most precious maps is > > imap jk > imap jj > > provided you don't have any other > imap that starts with jj or jk (you will have to wait for the timeout), > and you don't type words with that two letters next to other (I doubt > spanish has any) it's very handy. I don't use any language with something like 'jk' or 'jj' (although I've written that combination some times in *this* thread!), so they fit pretty well and avoids me hitting ESC. Sometimes I just forget how powerful are vim mappings. It doesn't seem natural to me to map letters in insert mode O:))) Thanks for your help, as always! Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen!
Re: Insert mode and arrow keys philosophy
Hi Gene :) * Gene Kwiecinski <[EMAIL PROTECTED]> dixit: > >I suspect that the main reason behind the hjkl (which is very > >unnatural for me, the arrows have a much better design with the > inverted > >T at least IMHO) was that the first keyboards used to develop/use vi > >probably hadn't arrow keys, or they were very far at the right of the > >keyboard. > > Pretty much so. Early dumbterminals (think ADM-3a and similar > critters) didn't have arrow keys, but they *did* go so far as to have > little arrow marks on the keycaps themselves, underneath the letters, > on -- you guessed it -- h/j/k/l. I did see this in an old Ultrix terminal. Don't ask me which model, because this was back in the university and I don't remember. I just remember vi from that machine and was very painful. I was used to "boxer", a DOS editor (very powerful for 1992, I must say), so original vi didn't fit my expectations ;)) > Hit *control* instead, for ^H (backspace), ^J (linefeed), ^K (vertical > tab), and ^L (formfeed), and you get the cursor motions > left/down/up/right, respectively. Thanks! I always wondered why those letters where control chars for movements (or quasi-movements) :)) > Gawd, I feel old... Me too XDD Nice answer, you've provided a couple of very useful information, at least for me (I'm *very* curious) ;) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen!
[Fwd: Re: Insert mode and arrow keys philosophy]
Apparently the original message was bounced by the listbot. Best regards, Tony. Original Message Subject:Re: Insert mode and arrow keys philosophy Date: Tue, 20 Feb 2007 11:58:45 -0800 From: Raimon Grau <[EMAIL PROTECTED]> To: A.J.Mechelynck <[EMAIL PROTECTED]> CC: vim <[EMAIL PROTECTED]>, "VIM mail list" References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> On 2/20/07, *A.J.Mechelynck* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: DervishD wrote: > Hi Laurent :) > > * vim <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> dixit: >> The idea behind using h/j/k/l is to avoid moving your hand/wrist too >> often while going back and forth between your keyboard and the arrow set >> (although the use of h/j/k/l might have originated for other reasons >> back in the old 'vi' days). > > Hitting ESC doesn't make your wrist move? I may have a very small > hand, but I have to move my left hand for hitting ESC. > > I suspect that the main reason behind the hjkl (which is very > unnatural for me, the arrows have a much better design with the inverted > T at least IMHO) was that the first keyboards used to develop/use vi > probably hadn't arrow keys, or they were very far at the right of the > keyboard. > > Of course I may be wrong here, I wasn't there ;)) but at least in my > case, the most moving I do is *when inserting text* (well, when > modifying existing text, to be more precise), and using ESC and the > different motion commands slows down my editing a lot. Using the arrow > keys and the Home/End, PgUp/PgDn keys makes my editing much faster. I'm > a touch typer, and I can find my position again in the keyboard pretty > fast, but I find more difficult to do it after hitting ESC than after > using the arrow keys. > > In addition to this, my touch typing position is with my index > finger on the 'j', and not the 'h'. To hit 'h' I must displace my index > finger and that's slower for motion than having my fingers on the > inverted "T". > > Weren't for the ESC key to go to normal mode, I will never use the > arrows, just because having the hands in touch typing position is much > faster, period. But hitting the ESC key to go to normal mode, hit a > couple of keys for doing the movement and hitting 'i' again is slower > than keeping in insert mode and using the arrows, at least for me. > > Probably if I had learnt to use an editor with vi, I will get used > to hit the ESC and change modes fast, but I hadn't and now hitting ESC > is very unnatural to me, even though I use it in my shell to clean the > command line!. > > It's just a mental attitude, I know, but... What I try to mean with > this message is that hjkl is not necessarily faster even if you touch > type. > > Raúl Núñez de Arenas Coronado > If the Esc key is too far, you may try using Ctrl-[ instead -- Vim sees it as Esc. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 50. The last girl you picked up was only a jpeg. One of my most precious maps is imap jk imap jj provided you don't have any other imap that starts with jj or jk (you will have to wait for the timeout), and you don't type words with that two letters next to other (I doubt spanish has any) it's very handy. Best regards from Spain
RE: Insert mode and arrow keys philosophy
>I suspect that the main reason behind the hjkl (which is very >unnatural for me, the arrows have a much better design with the inverted >T at least IMHO) was that the first keyboards used to develop/use vi >probably hadn't arrow keys, or they were very far at the right of the >keyboard. Pretty much so. Early dumbterminals (think ADM-3a and similar critters) didn't have arrow keys, but they *did* go so far as to have little arrow marks on the keycaps themselves, underneath the letters, on -- you guessed it -- h/j/k/l. The reason for that is similar to subdued numbers/characters on keycaps on laptops and the like, where there's no separate numeric keypad, so you hit or or whatever your laptop has, and those keys send the char in the subdued text instead of the char they normally send. Hit *control* instead, for ^H (backspace), ^J (linefeed), ^K (vertical tab), and ^L (formfeed), and you get the cursor motions left/down/up/right, respectively. If you recall the old termcaps/terminfo entries for such critters, you'd see usually the same values for cub1/kcub1, cud1/kcud1, cuu1/kcuu1, and cuf1/kcuf1, as ^H/^J/^K/^L. Only later with discrete arrow keys did you start getting ANSIish escape sequences like "\[[A"/"\[[B"/"\[[C"/"\[[D". Gawd, I feel old...
Re: Insert mode and arrow keys philosophy
DervishD wrote: Hi Laurent :) * vim <[EMAIL PROTECTED]> dixit: The idea behind using h/j/k/l is to avoid moving your hand/wrist too often while going back and forth between your keyboard and the arrow set (although the use of h/j/k/l might have originated for other reasons back in the old 'vi' days). Hitting ESC doesn't make your wrist move? I may have a very small hand, but I have to move my left hand for hitting ESC. I suspect that the main reason behind the hjkl (which is very unnatural for me, the arrows have a much better design with the inverted T at least IMHO) was that the first keyboards used to develop/use vi probably hadn't arrow keys, or they were very far at the right of the keyboard. Of course I may be wrong here, I wasn't there ;)) but at least in my case, the most moving I do is *when inserting text* (well, when modifying existing text, to be more precise), and using ESC and the different motion commands slows down my editing a lot. Using the arrow keys and the Home/End, PgUp/PgDn keys makes my editing much faster. I'm a touch typer, and I can find my position again in the keyboard pretty fast, but I find more difficult to do it after hitting ESC than after using the arrow keys. In addition to this, my touch typing position is with my index finger on the 'j', and not the 'h'. To hit 'h' I must displace my index finger and that's slower for motion than having my fingers on the inverted "T". Weren't for the ESC key to go to normal mode, I will never use the arrows, just because having the hands in touch typing position is much faster, period. But hitting the ESC key to go to normal mode, hit a couple of keys for doing the movement and hitting 'i' again is slower than keeping in insert mode and using the arrows, at least for me. Probably if I had learnt to use an editor with vi, I will get used to hit the ESC and change modes fast, but I hadn't and now hitting ESC is very unnatural to me, even though I use it in my shell to clean the command line!. It's just a mental attitude, I know, but... What I try to mean with this message is that hjkl is not necessarily faster even if you touch type. Raúl Núñez de Arenas Coronado If the Esc key is too far, you may try using Ctrl-[ instead -- Vim sees it as Esc. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 50. The last girl you picked up was only a jpeg.
Re: Insert mode and arrow keys philosophy
Hi Laurent :) * vim <[EMAIL PROTECTED]> dixit: > The idea behind using h/j/k/l is to avoid moving your hand/wrist too > often while going back and forth between your keyboard and the arrow set > (although the use of h/j/k/l might have originated for other reasons > back in the old 'vi' days). Hitting ESC doesn't make your wrist move? I may have a very small hand, but I have to move my left hand for hitting ESC. I suspect that the main reason behind the hjkl (which is very unnatural for me, the arrows have a much better design with the inverted T at least IMHO) was that the first keyboards used to develop/use vi probably hadn't arrow keys, or they were very far at the right of the keyboard. Of course I may be wrong here, I wasn't there ;)) but at least in my case, the most moving I do is *when inserting text* (well, when modifying existing text, to be more precise), and using ESC and the different motion commands slows down my editing a lot. Using the arrow keys and the Home/End, PgUp/PgDn keys makes my editing much faster. I'm a touch typer, and I can find my position again in the keyboard pretty fast, but I find more difficult to do it after hitting ESC than after using the arrow keys. In addition to this, my touch typing position is with my index finger on the 'j', and not the 'h'. To hit 'h' I must displace my index finger and that's slower for motion than having my fingers on the inverted "T". Weren't for the ESC key to go to normal mode, I will never use the arrows, just because having the hands in touch typing position is much faster, period. But hitting the ESC key to go to normal mode, hit a couple of keys for doing the movement and hitting 'i' again is slower than keeping in insert mode and using the arrows, at least for me. Probably if I had learnt to use an editor with vi, I will get used to hit the ESC and change modes fast, but I hadn't and now hitting ESC is very unnatural to me, even though I use it in my shell to clean the command line!. It's just a mental attitude, I know, but... What I try to mean with this message is that hjkl is not necessarily faster even if you touch type. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen!
RE: Insert mode and arrow keys philosophy
>If you ask me, I advise you to feel free to use arrows in any mode. >"Arrows not working in insert mode" was the worst annoyance >of the original vi, as far as I remember. *Really*? I feel just the opposite, that allowing arrowing when still in insert was more annoying than not, because you *could* successfully arrow around to a different position on the screen, then start typing "wwwdw" or something, and end up with "dw" in the text itself, instead of popping over 3 words and deleting the errant word. I keep forgetting to turn that off in the '.vimrc', so mentally have to make a note to keep banging the key at regular intervals. :D
Re: Insert mode and arrow keys philosophy
Pavel Shevaev wrote: Hi folks! AFAIK usage of arrow keys in vim should be avoided at all costs since h/j/k/l allows one to be more efficient in command mode. But how about insert mode? Should one avoid using arrow keys in insert mode as well and switch to command mode and then back to insert mode instead? There is no "at all costs", no dogma in Vim (except maybe about not running the shell in a window). Some people have been taught dactylography from tachers who would severely punish them if they moved their hands, and they still feel guilty if they do. hjkl is for them. Others have learnt it by themselves, maybe after taking piano lessons, and they are still able to move their hands. If they prefer to use arrow keys, why not? Vim often has several different ways of achieving the same goal: use whatever works best for you. Since I use 'wrap' and some of my file have very long lines, I have taken advantage of the ":map" command to remap the up and down arrow keys to move by "screen" lines, leaving jk to move by "file" lines, as follows: map gk map gj if exists("*pumvisible") inoremappumvisible() ? "\Down>" : "\C-O>gj" inoremap pumvisible() ? "\Up>" : "\C-O>gk" else inoremap gj inoremapgk endif Now they aren't synonymous anymore, and I use jk (in Normal/Visual mode only, or prefixed by Ctrl-O in Insert mode) or (in Normal/Visual or Insert/Replace modes) according to where I want to go. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 49. You never have to deal with busy signals when calling your ISP...because you never log off.
Re: Insert mode and arrow keys philosophy
Hi, Insert mode is to insert something in your text. If you want to move again, just hit ESC and you'll be back in motion mode. The idea behind using h/j/k/l is to avoid moving your hand/wrist too often while going back and forth between your keyboard and the arrow set (although the use of h/j/k/l might have originated for other reasons back in the old 'vi' days). If you touchtype, just hit ESC and stick with h/j/k/l as often as you can, using arrows will waste your time. If you don't touchtype, you won't really 'get' how great h/j/k/l is so don't worry too much about it and use the arrows whenever you want it. Laurent Yakov Lerner wrote: On 2/20/07, Pavel Shevaev <[EMAIL PROTECTED]> wrote: > Can you clarify which costs you are willing to > pay/sacrifice to avoid use of arrows ? Actually I'm just trying to follow the best vim practices and it's really hard for me to get used to h/j/k/l combination after working with some other text editors. That's why I'm asking how vim gurus work the most efficient way in insert mode... BTW, i type English symbols without looking at the keyboard(we call it "blind typing" in Russia) and the basic position of my right hand is on j/k/l/; buttons, that's why it's kinda hard to get used to switch to h/j/k/l position. I wonder if anybody remaps h/j/k/l => j/k/l/; and ; => h ;) If you ask me, I advise you to feel free to use arrows in any mode. "Arrows not working in insert mode" was the worst annoyance of the original vi, as far as I remember. Yakov Yakov
Re: Insert mode and arrow keys philosophy
On 2/20/07, Pavel Shevaev <[EMAIL PROTECTED]> wrote: > Can you clarify which costs you are willing to > pay/sacrifice to avoid use of arrows ? Actually I'm just trying to follow the best vim practices and it's really hard for me to get used to h/j/k/l combination after working with some other text editors. That's why I'm asking how vim gurus work the most efficient way in insert mode... BTW, i type English symbols without looking at the keyboard(we call it "blind typing" in Russia) and the basic position of my right hand is on j/k/l/; buttons, that's why it's kinda hard to get used to switch to h/j/k/l position. I wonder if anybody remaps h/j/k/l => j/k/l/; and ; => h ;) If you ask me, I advise you to feel free to use arrows in any mode. "Arrows not working in insert mode" was the worst annoyance of the original vi, as far as I remember. Yakov Yakov
Re: Insert mode and arrow keys philosophy
Can you clarify which costs you are willing to pay/sacrifice to avoid use of arrows ? Actually I'm just trying to follow the best vim practices and it's really hard for me to get used to h/j/k/l combination after working with some other text editors. That's why I'm asking how vim gurus work the most efficient way in insert mode... BTW, i type English symbols without looking at the keyboard(we call it "blind typing" in Russia) and the basic position of my right hand is on j/k/l/; buttons, that's why it's kinda hard to get used to switch to h/j/k/l position. I wonder if anybody remaps h/j/k/l => j/k/l/; and ; => h ;) Yakov -- Best regards, Pavel
Re: Insert mode and arrow keys philosophy
On 2/20/07, Pavel Shevaev <[EMAIL PROTECTED]> wrote: Hi folks! AFAIK usage of arrow keys in vim should be avoided at all costs "at all costs" sounds too fanatic to me. When keyboard has arrows, I really prefer arrows now, even though I've been using vi since 1989. Can you clarify which costs you are willing to pay/sacrifice to avoid use of arrows ? Yakov
Re: Insert mode and arrow keys philosophy
I agree that using h/j/k/l is most efficient and its hard to follow them in insert mode. But, if you are aware of the command CTRL-O in insert mode that will get you to a temporary-normal mode, you can execute one normal mode command, after which you will be taken back to insert mode. Once you are in normal mode, you could use [count] w/b/W/B commands, instead of h/j/k/l, if that is appropriate. On 2/20/07, Pavel Shevaev <[EMAIL PROTECTED]> wrote: Hi folks! AFAIK usage of arrow keys in vim should be avoided at all costs since h/j/k/l allows one to be more efficient in command mode. But how about insert mode? Should one avoid using arrow keys in insert mode as well and switch to command mode and then back to insert mode instead? -- Best regards, Pavel
Insert mode and arrow keys philosophy
Hi folks! AFAIK usage of arrow keys in vim should be avoided at all costs since h/j/k/l allows one to be more efficient in command mode. But how about insert mode? Should one avoid using arrow keys in insert mode as well and switch to command mode and then back to insert mode instead? -- Best regards, Pavel