
Can someone :help me? - Watabou
http://ajh17.github.io/2014/05/25/can-someone-help-me/index.html
======
tikhonj
If you're curious, Emacs does all this—and more—with various C-h commands. If
you want to see a full list of these, start with

    
    
        C-h ?
    

Here are my favorites:

If you want to see a specific keybinding, like checking what C-w is bound to:

    
    
        C-h k C-w
    

If you want to see the documentation for a function:

    
    
        C-h f function-name
    

If you want to see details about your current mode:

    
    
        C-h m
    

This is incredibly useful because it lists all the mode-specific keybindings.
That's how I learn how to use new modes!

If you want to see or interact with a variable:

    
    
        C-h v
    

If you want to see _something_ where you remember just part of the name:

    
    
        C-h a *regexp*
    

(a stands for "apropos")

If you want to see the incredibly detailed manual for Emacs or all of the info
manuals on your computer:

    
    
        C-h r
        C-h i
    

If you want to see info about your input mode (how do I type ℕ in TeX-input-
mode?):

    
    
        C-h I
    

Actually, for that one, I have another handy trick: copy and paste an ℕ into
your buffer, go over it and use

    
    
        C-u C-x =
    

which brings up detailed information about the given character... including
how to type it in your current input mode (if applicable). This also includes
useful info like its Unicode designation and category.

I've found all of these tricks exceptionally helpful when learning more about
Emacs. They also help me overcome my fear of memorization: its so easy to look
stuff up, I don't have to bother. Then, if I use something enough, I remember
it without especially effort. It's like a cache in my mind.

~~~
grdvnl
Better still, if you want to execute a command and if you approximately know
what it could be called as, you get list of potential commands in an
alternative buffer, by Alt-x, and then start typing part of the command. This
I feel is great to explore commands as you need them, before binding new keys
to those commands.

Without getting into emacs vs vim war, the author would be impressed in a
bigger way once the emacs documentation is explored!

~~~
Watabou
I'm sure I would be. I actually like emacs very much, and used to use it in my
uni days. These days though, I like the modal way of editing more.

I think emacs' documentation does come close but I still think Vim's help is
much more easy to use and to search for. For example, a new user coming to
emacs can't search for help on C-x C-f by invoking C-h C-x C-f

~~~
rwl
> For example, a new user coming to emacs can't search for help on C-x C-f by
> invoking C-h C-x C-f

That's true. It's C-h _k_ C-x C-f. :)

~~~
Watabou
Whoops, thanks. Sort of hard to type it though. :)

------
euphemize
I think if the idea is to help newcomers with Vim, this is the wrong approach.
Nobody tries to learn something new by checking out what a random key does,
using :help X. When I was trying to learn Vim, the most useful info was
actually search results for "how to do X with Vim", because everybody knows A)
another editor, probably B) what they want to achieve. After that you slowly
discover features one after the other, which can only happen by using the
editor a lot. It's good to have a "help X" around, but most of the time, if
you're starting out, you don't know that X is what you need in the first
place.

People learning git don't start with typing "git rebase --help" just to see
what it does. You learn to add, commit, push, (probably from a tutorial) and
then go from there.

~~~
jeorgun
Hence vimtutor. The "going from there", in git, _does_ consist in part of "git
rebase --help" or "man git-rebase", which are roughly equivalent to :help.

------
leorocky
> No other software product that I've ever come across or used has had a
> better documentation.

Vim requires so much documentation just to be usable. There is no GUI to hint
at how to do anything. No toolbars, no application menus, no context menus or
buttons. Vim's documentation is probably somewhat responsible for its
popularity. I've never not found something I needed in Vim's documentation.

~~~
dredmorbius
Which also means no GUI to get in the way.

I'm not saying there isn't a time and a place for that, but after your 2nd or
3rd decade of using a tool, sometimes you just want to see the text you're
working on.

~~~
PhasmaFelis
You may have hit on my fundamental frustration with Unix command line. Every
tool is designed around the basic assumption that the user has a couple of
decades of experience and wants the tool to get out out of the way and let
them work. That's great for veterans, but actively hostile to newbies.

You'd think there could be some sort of middle ground.

~~~
danielbarla
I suppose one of the advantages of a GUI is that it shows you what options are
available; it's kind of inherently "explorable".

There's probably a few factors that confound this. First, a GUI for something
as abstract and powerful as VI is difficult to create, and still keep usable.
The only way I can really imagine it is a kind of tutorial overlay which
presents common options on the screen. Similar problem for the shell, I guess,
there are just too many things you can / want to do in there to distill into a
GUI.

Second, I suspect that these tools come from an age where people had different
expectations, and with those, different ways of looking for help. I guess most
*nix people are aware of man-pages, and are pretty efficient at reading it's
syntax. Despite it's lack of GUI, VIM tries pretty hard to point you to the
help (e.g. on my installation, the help commands are always shown when you
start it - I guess this is by default).

~~~
VLM
> it's kind of inherently "explorable"

The CLI version of this is using two "things" at the same time, one thing in
the CLI and another thing in some form of docs or tutorial or google result or
whatever. Where "thing" equals window, monitor, screen/tmux, console tab,
whatever. (edited to add, I've never learned a programming language any other
way, in the olden days we used ink on paper books as the "other screen")

> different ways of looking for help

Windows / GUI way is one huge app that does absolutely everything and includes
the entire world within it including all documentation and tutorials and its a
failure to ever need anything outside that app, no matter if its a tool or a
doc. This doesn't scale very well.

Unix / CLI way is many tools each perfect at one task, and the perfect tool
for docs might be some tutorial on the net or perhaps a manpage, and that is
philosophically the way it should be. Feature not bug. This scales pretty
well.

GUI way is a swiss army knife. CLI way is a Wiha made in Germany of chromed
hardened tool steel posidriv shape size #1 50mm blade length, which costs as
much as a generic Chinese swiss army knife, but is a world class screwdriver.

~~~
danielbarla
Agreed, although the "perfect tool at one task" becomes slightly complex when
we consider something like vim. Sure, I consider it to be very good at the
"one task" of text editing, but that's such a broad subject, with so many sub
tasks that the argument tends to break down.

Regarding help and explorability, I mean something a bit more than this. Take
man pages for example; if I know what command I want to know more about, it's
great. Without that knowledge, it's much harder to get information. In a weird
GUI equivalent, you could click on an "administration" screen, and see the top
20 functionalities under that category (say, "you might be looking for: chmod,
last, etc). Kind of a hierarchical breakdown of common functionality. Not only
is this situation of zero knowledge more prevalent in today's non-expert PC
user world, but it's also the way we've been "brought up" in the GUI world.

~~~
VLM
I believe the command you're looking for is "apropos". In the modern era
everyone just uses google to answer questions like that anyway, GUI or CLI.

vlm@dev:~$ apropos permissions

access (2) - check real user's permissions for a file

chmod (2) - change permissions of a file

eaccess (3) - check effective user's permissions for a file

euidaccess (3) - check effective user's permissions for a file

faccessat (2) - check user's permissions of a file relative to a directory
file descriptor

fchmod (2) - change permissions of a file

fchmodat (2) - change permissions of a file relative to a directory file
descriptor

ioperm (2) - set port input/output permissions

WWW::RobotRules (3pm) - database of robots.txt-derived permissions

vlm@dev:~$

~~~
qu4z-2
Alternatively

    
    
        man -k permissions
    

works for me even on some systems that don't have the apropos command.

~~~
dredmorbius
apropos is often an alias, shell function, or script wrapper around 'man -k'.

Actually, on my Debian system, it's a symlink to whatis(1).

------
natural219
The documentation is so good, you need a beautifully crafted website with
english sentences, standard typography / web styles, and acommpanying visual
diagrams...simply to learn how to use the "help" feature.

~~~
Watabou
Well I wrote this partly for a friend who wants to give Vim a try. I noticed
if I told him to read the help on a topic, he would just google the question
himself (maybe he doesn't like the terminal interface to read the help doc).

I've also noticed some people will manually go search a plugin on Github just
to read the plugin's doc folder, when the same help doc is available right
inside vim!

So I thought I would help explain why Vim's help is so awesome that people
should use it more and using it more means that you learn more things about
vim.

But I appreciate that you like my website, thanks! :)

~~~
ufmace
The tricky thing about vim help, to me, is that it feels nearly impossible to
navigate until you're already pretty comfortable with moving around in Vim.
Making all of the most basic things so different from the WYSIWYG editors most
people know generates a huge mental load at first, just trying to get the most
basic things done.

When I started using Vim, I found for a while that I couldn't stand writing
code with it for more than an hour or so, because it was too difficult to
think about what the code is doing and how to use the Vim commands to actually
edit the text at the same time. I think it took me several months of poking
around and training myself in basic movement commands to get to where I could
actually work in it effectively.

------
lennydizzy
Any one know how do I search for a shortcut in different modes?

For example, 'ctrl-r' in normal mode means redo, in insert mode means paste
from register. However ':h ctrl-r' only shows the help for normal mode.

~~~
Watabou
I linked that help topic in the article.

`:h help-context` tells you what you need to append for each mode. So for
ctrl-r in insert mode would be: `:h i_Ctrl-r`

------
okasaki
Does no one check their page layout on anything but 4k resolution any more?
Here's what the page looks like on one of my 1280x1024 screens:
[http://i.imgur.com/w6WXYF6.png](http://i.imgur.com/w6WXYF6.png)

Since the screen is physically on my left, it's very annoying to try to read
the text.

~~~
Watabou
Hmm, thanks for that, I'll see what I can do. I don't have a 4k monitor but I
do have a retina MBP. I tested it on mobile and the retina MBP but I don't
have access to a lower resolution computer (hehe).

~~~
DiabloD3
Just change the size of your window.

~~~
mkesper
Or remove it...

------
vsbuffalo
I use vim (after years of being a happy emacs user — switched due to RSI), but
I've never liked its help system. Compared to emacs, it's incredibly hard to
navigate and it just doesn't have anything as powerful as C-h k (what does
this key do?).

~~~
Watabou
What do you feel that Vim's help in that area is lacking?

I think searching for a key binding is pretty straightforward with `:h {key}`.
I like how it's short and simple they are most of the time too so you can read
and get back to whatever you were doing.

------
nutate
Apropos help in emacs is nice. For similar in vim type :help blah<ctrl-d>

------
borplk
Honestly the entire time I was under the impression that the author is being
sarcastic.

------
NYCHacker
Can someone explain to me why people still use Vim and Emacs? Is it more
efficient than GUIs like Sublime Text?

I only ever use Vim for quick edits and fail to see how one can be more
effective in it when you can't click and highlight text.

~~~
Watabou
I can't convince you that Vim or Emacs is more convenient than Sublime Text.
You will have to find that out on your own.

And yes, you can highlight text, using Visual mode or the mouse.

