In Vim, why are the navigation keys HJKL and not JKL;? [closed] - vim

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
How does this not bother anyone? I used to rebind it but recently I've been trying the standard layout just to see what I'm missing. Isn't it easier to not move your finger to H and then back again to J?
And I know VIM has some ancestor(s) that had the same four keys, but that's not really the reason. VIM didn't have to use those keys.

30 years ago, Vim's author created it because he couldn't run vi on his amiga for licensing reasons. The whole point of the existence of Vim was to provide a convincing vi clone so it uses hjkl, just like the original. Vim evolved quite a lot over time but that primary goal didn't go away. If you don't like hjkl map them to something that makes more sense to you.
It may come as a shock to you, but Vi's (and thus Vim's) use of hjkl for cursor movement has literally nothing to do with touch-typing at all.
For reference:
Vim uses hjkl because vi did.
Vi used hjkl because its creator's keyboard didn't have physical cursor keys. Instead, the arrows were printed on the hjkl keys.
The arrow keys were printed on hjkl because the corresponding control codes all moved the cursor in directions roughly similar to the cursor keys: ^H for "backspace, ^J for "line feed", ^K for "upline", and ^L for "forward space".

Related

Is there any data supporting a correlation between carpal tunnels and using keyboard-heavy editors like Emacs or Vim? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have some predisposing factors to developing carpal tunnel and would like to avoid it as much as possible. I do however want to use Vim or Emacs and I would like to learn from the experiences of others.
Has there been any research showing either a correlation or lack of correlation between using a keyboard-heavy editor like Vim or Emacs and developing carpal tunnel syndrome?
Emacs uses a lot of combination key strokes, especially ctrl. Many emacs users bind ctrl to the caps-lock key to make it easy to access with the left pinky. Still if you are worried about carpal tunnel I think less one combo keys would be better, especailly if you tend to do them one handed.
I haven't used vim intensively but from what I remember from mys sysadmin days, it's mostly single keys, although esc is frequent and is a stretch. You could move the esc key and end up with a fairly neutral typing position for most tasks in vim.

How can I use vim to edit my command line? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
For example, when I'm entering a long command and I want to delete the second word, I want to be able to type <Esc> b b dw.
You can use set -o vi to use Vim-like shorcuts.
To make this permanent, you'll want to put this in your shell's rc file (e.g. for bash, put set -o vi in ~/.bashrc).
You should then log out and log back in, or just use $ source ~/.bashrc.
The best strategy depends on your experience with the command line.
I learned and got used to the default emacs-like mappings used in bash way before I started to learn Vim. They are too ingrained in my fingers for me to even consider enabling "vi mode". If you have more experience with bash than with Vim, I'd say that "vi mode" won't help you much. If, on the other hand, you have more Vim experience or are starting out with both, you may like the familiarity of "vi mode".
For what it's worth, I actually believe that "vi mode" is very close to useless. When on the command line, you are inserting text and Vi[m] is not better than others on that front. When you want to edit a command, "vi mode", with all its geeky shine, can't be compared with the power of a proper editor.
<C-x><C-e> provides the best editing experience you could ever dream of so why bother with the limited "vi mode"?
Try fc and fc -l for even more goodness.

Screenscrolling in vim [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
is it possible to make vim scroll by screenlines instead of file lines?
More precisely: i edit texts with large paragraphs, and i put enter only at the end of a paragraph. Thus, for vim, each of my paragraphs is a single line, and these lines are very long. When moving around vim jumps very long distances and i get lost. Vim seems to be suitable only for editing programs?
I know about mapping j to gj and so on (i have done them). However just mapping these is not enough i also want the scrolling to be corrected for screenlines.
I have done some searching , but i cannot find a clear answer to whether screen line scrolling is possible or not.
If it is not possible, would somebody know of an, possibly ugly hack to do it? In its current setting vim is not usable, which is sad because i prefer its other features very much over the other editors around. (i do not like the idea of having to learn emacs ...)
Sorry, the answer is: no.
Browse through this [somewhat] recent nabble thread where Bram Moolenaar himself describes why this hasn't been implemented yet. (basically, it has too much potential for introducing bugs)
http://vim.1045645.n5.nabble.com/Scrolling-screen-lines-I-knew-it-s-impossible-td3358342.html

Is there an interactive way to learn Vim? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Years ago I was looking for a way to learn Vim that didn't involve a wall of text, or scrolling through vimtutor without knowing the commands to do so. I wondered if anything else existed for such a purpose.
I programmed a game just for this purpose! It's an online game where you move the cursor using vim commands and motions. Check it out on http://vim-adventures.com.
The first couple of levels teach hjkl and word navigation. The rest is planned to cost money.
Interactive tutorial:
http://www.openvim.com/
HJKL-learning game:
http://www.vim.org/scripts/script.php?script_id=3409
Screencasts:
http://derekwyatt.org/vim/tutorials/index.html
http://vimcasts.org
To answer your question: vimtutor is the good way to interactively learn vim. If you read through it, it gives you all the necessary commands to go through it, and you actually learn to use vim.
If that's too much effort, I really doubt vim is for you.
Old question, but for others looking for something similar that has not been mentioned: https://www.shortcutfoo.com/
http://kikuchiyos-vim-game.herokuapp.com
Spiked this mid 2011, around time vim adventures was made, but never went nearly as far as vim adventures did. Never got much play, but still a free alternative for anyone interested in getting over the vim learning curve - basic movement and changing modes.
haven't used it, but it looks close to what you're asking for
http://www.openvim.com/tutorial.html
For the very beginner http://vimsnake.com is also a nice one.
It will interestingly improves the muscle memory for keys h,j,k,l, esc and i
Now after getting prepared for those keys, we can move to http://www.vimgenius.com/ for learning. It is just similar and alternative for shortcutfoo.com and more it is vim specific.

Tips and tricks for emacs' viper-mode and the likes [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Basically, I really like vi[m]'s key-bindings, but not the rest of the editor. I really dislike emacs key-bindings, but like the rest of the editor.
viper-mode seems like the best of both worlds, but it's not perfect..
What vim features did you miss in emacs (and more importantly, how did you get them back)? What config-tweaks did you do to make viper-mode nicer to use?
As a start: I really missed vim's visual-selection mode.. vimpulse adds this to emacs!
As far as I know, VIM/VI has always had the :set nu feature to show line numbers along-side the lines themselves. By default, emacs only had line-number-mode which showed the line-number of the current line in the mode-line (not the same thing).
To fix that, I always found linum.el pretty useful. Starting with the upcoming emacs 23, the linum mode would be included in the standard distribution. But for emacs <= 22, one still needs to install it manually.
I also miss the incremental search with / and ? . Something like
what is posted here first in the TODO section.
http://common-lisp.net/project/vial/darcs/extended-viper/vimlike.el
If anyone can provide it, it would be great. Jurta ?
I would recommend you use my version of the emacs starter kit. It is totally customized for heavy (symbiotic) use of emacs and vi/vim (via viper and vimpulse) together.

Resources