
Why was '~' chosen to represent the home directory? - rawland
http://unix.stackexchange.com/questions/34196/design-question-why-was-chosen-to-represent-the-home-directory
======
sdoering
I really liked the additional info on the vim-navigation-keys. Really
interesting to see, how the design of specific hardware shaped the "how to
use" for generations to come.

I really have my problems, to wrap my head around "hjkl", as there is (imho)
no logical mnemonic for the directions. It is sadly just "learn by rote".

~~~
anonymouz
Put this in your .vimrc:

    
    
      " Disable arrow keys
      noremap <Up> <nop>
      noremap <Down> <nop>
      noremap <Left> <nop>
      noremap <Right> <nop>
    

You'll have one or two frustrating days, but after that your muscle memory
will take care of remembering "hjkl" for you.

~~~
SiVal
Every keyboard now has a set of hardware arrowkeys sensibly arranged in an
inverted-T, where up means up, left means left, etc. Since everyone is used to
that arrangement without any mental effort, macho vim types tell you to force
yourself to write with your feet basically to show how hardcore you are. They
tell you to use your customization ability in .vimrc to block the sensible
arrangement in order to force yourself to learn a ridiculous one that has no
advantage other than being the one that we old-timers had to learn before
there were sensible arrowkeys.

I used that arrangement back in the 1980s myself, but when keyboards evolved,
so did I. I remapped the movement keys to match the other movement keys
(arrowkeys).

If you're going to go to the effort of customizing your vim to force yourself
to learn a new keyboard arrangement, customize it so that the movement keys
are ijkl instead of hjkl, so that both of your sets of arrowkeys are in the
same, natural, modern, inverted-T arrangement. Then you don't have to
deactivate those real arrowkeys, because there won't be any temptation to use
them with the ijkl keys in the same arrangement and easier to reach.

"Oh, no!" people half my age will shriek. "Then what happens to the 'i' key?
This would be impossible." Just use the now-unused key on the left ('h') for
your insert-on-left. Reach left to insert on left. There, easy.

Funny how those who insist that YOU should relearn something as fundamental as
the entire inverted-T arrowkey structure built into the hardware of every
keyboard and used by almost all apps on all platforms including kids' game
boxes find relearning a single, arbitrary 'i' key such an insurmountable
obstacle to themselves.

But what if you have to use a copy of vim on a machine without your customized
.vimrc? Sorry, but that's just an argument against ANY useful customization of
vim. It's just not a problem, because the real arrowkeys on the keyboard are
in the arrangement you're used to using on the ijkl keys. Just use the real
arrowkeys temporarily or copy over your .vimrc. I've done it for years.

But what about other editors that have a vi mode? What about something like
zsh with a vi mode? These things can be remapped to match your .vimrc unless
they only offer a couple of keys, in which case they can be treated just like
all apps with their own couple of local keyboard shortcuts.

Really, if the standard advice is, "You'll have one or two frustrating days,
but after that your muscle memory will take care of remembering "hjkl" for
you," then you can take your own advice and keep the inverted-T muscle memory
you already have for the movement keys and reduce your task to learning a
single 'h' key for insertion, and save the next generation from this nonsense.

If a 30-yr user of vi like me isn't stuck with the historical accidents of the
past, why should new users have to be?

~~~
zzleeper
Bravo! From the other comments, I guess you are going against the 'common
sense' of vim users, but actually hjml has been _the_ reason I never bothered
with vim. Having to replace years (or decades) of T-arrowkeys (in windows, and
in every FPS) seems utterly insane to me (and probably to most people that
grew up with them)

~~~
UnoriginalGuy
I wish Linux just came with Edit.com.

Arrow keys for movement, letter keys for input (what a novelty?!), and a
working mouse. All available since MS Dos 6 or earlier.

I understand that some people like VIM and or Emacs, but why must UNIX people
force such arcane editors down people's throats? Edit.com put them to shame
almost twenty years ago.

Yes, I know, if you spend YEARS learning clever key combinations you can be
ever so slightly more efficient, what a novelty...

~~~
msh
Nano and pico gives you that... Available on most unix systems.

~~~
tracker1
+1 for nano... I only make relatively quick config changes from a console...
so nano is much less of a learning curve... I'd rather not have to memorize a
bunch of commands for my general text editing. I do prefer a GUI editor, and
ironically enough, Sublime Text has been increasingly my goto editor (needing
to remember certain hotkeys, but still works for general arrow-key and mouse
editing).

------
robomartin
Funny how all roads lead to a discussion of the merits of vi/m.

At least some of you now understand that these tools were designed as you see
them today because they were dealing with crippled hardware (from today's
vantage point). There was no magical study on keystroke efficiency at the
inception. They had lemons and made lemonade.

Now, quit arguing and get back to reading Facebook!

Yup, that's me ducking in the corner.

~~~
stcredzero
HJKL is madness. It's more proof that "The Inmates are Running the Asylum"
when it comes to usability. We programmers are so much more apt at remapping
functions to arbitrary inputs/symbols that we continue to put up with things
like this, decades after the reason disappears. This is also why we need to
make special efforts at understanding non-programmer users.

~~~
rubyrescue
i have tried both and hjkl is just faster. it's "madness" the same way having
88 white unmarked keys on a piano is "madness" to someone who doesn't play.

~~~
robomartin
Sometimes stirring-up shit can be a win-win situation.

I could agree with you and get the anti-vim guys all worked up. I could even
back it up with random links and examples from all over the web.

I could also disagree with you and get pro-vim guys all riled-up. Again,
suitable links, stats and a photo of some guy with carpal-tunnel would do the
trick.

That's great stuff!

To quote one of the most memorable lines in motion picture lore:

"Interesting game. The only way to win is not to play."

I use vim. And I've used everything else. I don't care. All of it pales in
magnitude to the efficiency losses elsewhere in the process of developing a
software product.

My guess is that on a daily basis I waste more time going for a cup of coffee,
shooting the shit, reading/posting on HN, getting pulled in all manner of
directions on the internet than any text editor could save me short of a
brain-to-code interface.

And, of course, there's the actual work of figuring out how to code something.
I've spent days diagraming state machines with, yes, hold-on, paper and
pencil. Once there, an hour or two and the bug-free code is written and
working. Yes, even if you use Notepad.

You want to be more efficient? Get really good at going from problem to
finished, shippable, documented, flexible, reusable and bug-free code. What
you use to enter said code probably does not matter.

I'm going back to polishing my keyboard.

Maybe you guys ought to do the same.

~~~
obscaenvs
robomartin: A voice of reason in a sea of inane babble.

~~~
robomartin
Thanks for the vote of confidence. Now I have the challenge of actually trying
to be that person.

------
ck2
On a side note, stackexchange is getting pretty impressive.

<http://stackexchange.com/sites>

------
kragen
If I recall correctly, control-^ (i.e. 0x1e, aka control-~) would move the
ADM-3A cursor to the "home" location on the screen (i.e. the top left) if sent
from the host. If you were talking to a host that was echoing your keystrokes
(and maybe if you set a DIP switch for half-duplex mode?) then typing
control-^ (aka control-~) would do that too.

The terminfo entry seems to confirm this (apt-get source ncurses-term && less
+/^adm3a ncurses-5.9/misc/terminfo.src):

    
    
        adm3a|lsi adm3a,
            OTbs, am,
            cols#80, lines#24,
            OTma=^K^P, OTnl=^J, bel=^G, clear=\032$<1/>, cr=^M, cub1=^H,
            cud1=^J, cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c,
            cuu1=^K, home=^^, ind=^J, kcub1=^H, kcud1=^J, kcuf1=^L,
            kcuu1=^K, rs2=^N,
    

I think the speculations about ^ in regexps coming from the same source are
misplaced, because I think the ed editor was already using ^ to mean
"beginning of line" before there were any CRT terminals.

The ADM-3A had direct cursor addressing, as referenced in the "cup" capability
in the above terminfo entry, so the "home" feature was, strictly speaking,
redundant. As you can see from the simplicity of the terminfo entry (notably
its almost complete lack of escape sequences) logic was aggressively minimized
in this termainal. I seem to recall from glancing inside the ADM-3As I bought
at auction in my childhood that it was built almost entirely out of discrete
7400-series logic, so every extra control character involved adding several
chips.

In light of this, I suspect that the "home" feature may have been retained for
backwards compatibility with something else — maybe the ADM-3? But the ADM-3
terminfo entry doesn't mention "home", so I don't know.

More details about the ADM-3A can be found at
<[http://manx.classiccmp.org/details/11,5618>](http://manx.classiccmp.org/details/11,5618>).

------
shmerl
Still using Sun Unix keyboard with tilde on the right, and no obnoxious
Windows keys ;) Control in the middle row on the left is also helpful in order
not to stress the pinky.

~~~
wereHamster
You can remap keys in modern operating systems. Any sane person will remap
capslock to something they use more often (eg. ctrl or alt). Who needs
capslock anyway?

~~~
rootbear
I used to think the same way until I suffered neurological damage that affects
the sensory nerves in my fingers. Holding down the shift key while I type some
all-caps text, like "STUPID_SHOUTY_MACRO_NAME", is uncomfortable, so I now
find the caps lock key useful. It would be nice to have it as a control key,
but I would want some other way to activate the caps lock function. Maybe a
double tap on the shift key, like on the iPhone keypad, would work.

~~~
jlgreco
I actually find holding shift nicer for STUPIDLY_LONG_MACROS and whatnot since
those underscores require shift and don't work with capslock.

------
Aardwolf
Why oh why did the ADM-3A keyboard not use a gamer configuration for its arrow
navigation keys. What a noob designed that!

He could have gone for wasd or ijkl. But he had to go with hjkl!

Anyway, the fact that j looks like a down arrow is a very good thing that
makes me remember it and allow me to play nethack.

~~~
koralatov
Even worse, it didn't use Cherry red switches, and it looked like crap. Where
were the bright red LEDs, macro shortcut buttons, and elaborate wrist-rest?!

~~~
Aardwolf
Cherry red, the linear ones? Why not Cherry brown or blue?

~~~
koralatov
Reds appear to be preferred by the hardcore gamers that buy those monstrous
gaming keyboards. I think it's because they're lighter, and also because
they're linear.

~~~
Symmetry
Right. Reds are linear better if you're going to be pressing keys and holding
them down, as for moving in an FPS. But Browns, are better if you want a
single keypress event registered, as for using the keyboard to type.

~~~
mwill
I honestly can't tell if this is a legitimate conversation or a parody! : P

But seriously, I spent the longest time assuming that the talk about better
keyboard were exaggerations or placebo effect deals, until I started using the
MBP keyboard, which just felt significantly better than anything I'd used
before, sort of satisfying.

So I've got an open mind now, and am planning on hand-me-downing my apple
wireless to a friend in need. Does anyone have a specific recommendation for a
keyboard for programming that might be a decent replacement?

------
johnlinvc
The ctrl location on that old machine is much more handy. I've changed my caps
lock to ctrl for years.

~~~
koralatov
Same here. I do, however, hate that most keyboards have a `stepped' Caps Lock
key, presumably to stop people accidentally activating it when they type an
`a'. Thankfully, my laptop _doesn't_ , and neither does my keyboard at home.

------
saddino
Ah yes, I used the baby blue version. Probably my favorite terminal until the
HP2621a (which had a _great_ character set, "modern" housing, and nice loud
beep). Since I used the line editor to program I only really used HJKL as
cursor keys in rogue. :-)

------
atuladhar
I use vim a lot, but as I was reading this, I realized that unless I was in a
vim session (or pretended that I was in one), I couldn't remember which of the
hjkl keys mapped to which direction.

~~~
grimgrin
I think playing Crawl a ton is the only reason I remember so well. But playing
too much crawl makes me think I can also move diagonally in vim (yubn).

------
randy909
Looks like it also explains why caret (^) was chosen in regex and vi to mean
"beginning of line".

------
dkhenry
What does the "Rub" key do ?

~~~
shaurz
Delete a character i.e. "rub out", presumably.

~~~
dkhenry
Is that a carryover from the typewriter days ?

~~~
bdunbar
Teletypes, not typewriters, punching out paper tape.

~~~
JoeAltmaier
ANd 'DEL' is 0x7F in ASCII - so it would punch all the holes, the only way to
make 1 char punch turn anything to the same thing.

~~~
kps
And this is why DEL is properly a _forward_ delete operation: it erases the
character under the cursor and advances (the tape) over the next.

I blame the VT220 for screwing this up.

------
B-Con
Badly off-topic, but I found it amusing that the user asking the question was
"Lelouch Lamperouge". The juxtaposition of Lelouch and "home" brought that
series back into my mind full-force.

------
dbbolton
So why was '~' chosen over '^'?

------
DelvarWorld
100+ upvotes for a lmgtfy answer :(

~~~
DanBC
That wasn't a lmgtfy answer. It was a constructive link to an encyclopaedia
article, with a relevant quote from that article, and a relevant image. There
were also links to other sources of information.

lmgtfy is hateful because it often links to the same search that the asker has
previously done, and returns the same not-useful hits. But the answerer
doesn't check the returned hits, and just smugly slaps lmgtfy in to "teach"
the asker a lesson about searching before asking.

------
yeison
Thanks for this post.

~~~
rawland
Welcome! :-)

Actually, I stumbled over that question during my quest of unifying my
keyboard-layouts (Mac=Work and Linux=Private) via xmodmap.

~~~
chimeracoder
Is that even possible? No matter which way I've tried mapping the keys on OS
X, something just can't be placed in the right spot on the keyboard - mostly
because many uses of CTRL are placed on the equivalent of Mod-4 (the Command
key).

Unless you're just trying to simulate an Apple keyboard configuration on
Linux, that is.

------
ebbv
So this is what HN has come to eh? Just random trivia links. Cat pictures
can't be more than two weeks off.

~~~
breck
I disagree. This is a very interesting data point representative of a broader
pattern:

Why do we use X?

Because N years ago, the environment looked like E1, and so X made sense.
Then, people got used to X as a convention, and even though our environment
changed to E2, we still use X because of network effects.

A great way to improve the world is to understand where X came from,
understand how E2 differs from E1, and then invent Y to better fit E2.

The hard part is that Y needs to be significantly better than X so that you
can get people to switch given that X has stronger network effects.

