News for hackers. Stuff that matters.
Re:Vim's 25th anniversary and the release of Vim 8 by kps on Thursday February 09, 2017 @11:39AM (#13608208)
> when vi was originally produced most popular keyboard was IBM XT.

Probably not, since the IBM XT was five years in the future.

The canonical vi keyboard is the ADM-3A. http://terminals-wiki.org/wiki/index.php/File:Lear_Siegler_A... Escape is almost as accessible as Control.

The ADM-3A also explains why shells use ‘~’ to represent the home directory.

Re:Vim's 25th anniversary and the release of Vim 8 by ntumlin on Thursday February 09, 2017 @11:57AM (#13608433)
I was curious about some keys I hadn't seen before, so for anyone curious, here's the purpose of the "rub" and "here is" keys (from the ADM-3A operators manual[0] page 3-7 and 3-8):

RUB. When the RUB (rubout) key is typed while holding down the SHIFT key, a non-displayable rubout code (ASCII DEL) is transmitted to the computer. The cursor is not advanced and the character code stored in display memory is not overwritten. RUB is normally used to tell the computer that a previous character should be deleted.

HERE IS. If the Answer Back option is installed, typing this key transmits an identification message (stored in a special ADM-3A memory) that identifies the terminal and alerts the host computer that a message is to follow. If no Answer Back option is installed, the key has no function.

[0] http://www.classiccmp.org/dunfield/altair/d/adm3a.pdf

Re:Vim's 25th anniversary and the release of Vim 8 by kps on Thursday February 09, 2017 @12:30PM (#13608815)
For the reason DEL is shifted ‘_’, see your friendly neighbourhood ASCII table, and/or one of the recent HN threads¹. The ADM-3A² is a good example of a bit-paired keyboard³.

¹ https://news.ycombinator.com/item?id=13539552

² https://en.wikipedia.org/wiki/ADM-3A

³ https://en.wikipedia.org/wiki/Bit-paired_keyboard

Re:Vim's 25th anniversary and the release of Vim 8 by a-b on Thursday February 09, 2017 @11:45AM (#13608288)
You're right, thanks for your correction. My main point was a location of the Control key. I guess with IBM XT keyboard CTRL-[ become a most reasonable option https://en.wikipedia.org/wiki/IBM_PC_keyboard#/media/File:IB...
Re:Vim's 25th anniversary and the release of Vim 8 by rthomas6 on Thursday February 09, 2017 @06:15PM (#13611939)
Also notice the arrows on H J K L.
Re:Vim's 25th anniversary and the release of Vim 8 by WildUtah on Thursday February 09, 2017 @09:21PM (#13612806)
Promoting bad habits. Don't use the left-right arrow keys to move around!
Re:Vim's 25th anniversary and the release of Vim 8 by theviajerock on Friday February 10, 2017 @06:59AM (#13614767)
The left - right with the H J K L keys? Or the normal Keys ? And why is this a bad habit?
Re:Vim's 25th anniversary and the release of Vim 8 by WildUtah on Friday February 10, 2017 @11:20AM (#13616454)
Moving around with hjkl is a bad habit to be discouraged. It's not the vi way.

Well, j and k are fine if you're not moving far. A lot of slow scrolling up and down should be { and } or C-d and C-u or <count>[jk]. Even better: Use / and ?. It's bad to be repeatedly tapping j and k or waiting for the keys to repeat.

But h and l are the EMACS approach. You should be moving in a line with w, e, b, f, F, t, T, ^, $, I, A, 0, and the like. Vi provides lots of tools for efficient line editing and h and l are not good.

Beginners should try

    :noremap h <nop>
    :noremap l <nop>
to keep them from the temptation of the nefarious h and l keys.

Lately I use

    :no h ^
    :no l $
which is even better because ^ and $ require moving your hands off the home row even though they're much better than h and l for you.
Re:Vim's 25th anniversary and the release of Vim 8 by falcolas on Friday February 10, 2017 @12:44PM (#13617255)
Huh. The "vim way" goal posts have moved even further. Used to be "no-op your arrow keys and use hjkl", now it's "noop your hjkl keys".

Something I, as a dedicated VIM user, will never do. 'hjkl' work fine, and are a good addition to 'we{}$0' and so forth. I can't personally find the value of hobbling myself for the sake of meeting someone else's definition of the ideal user.

I even occasionally use the arrow keys. Heresy, I know.

Re:Vim's 25th anniversary and the release of Vim 8 by flukus on Thursday February 09, 2017 @09:38PM (#13612861)
> The ADM-3A also explains why shells use ‘~’ to represent the home directory.

Is that also the origin of '^' being start of line in a regex?

Re:Vim's 25th anniversary and the release of Vim 8 by kps on Thursday February 09, 2017 @11:49PM (#13613297)
Good guess, but no. The ADM-3A dates to 1976, but the regular expression syntax is definitely earlier: https://www.bell-labs.com/usr/dmr/www/qedman.html
Re:Vim's 25th anniversary and the release of Vim 8 by j-pb on Friday February 10, 2017 @07:20PM (#13620123)
Wow this is a better and cleaner/streamlined keyboard layout than I have on my 2015 MacBook Pro :(