ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.59k stars 233 forks source link

Where are the key bindings #578

Open lpvm opened 8 years ago

lpvm commented 8 years ago

I can only find references to in https://github.com/the-lambda-church/merlin/wiki/vim-from-scratch

Where can I find other keybindings for merlin in Vim? Edit: I've seen the (or some) commands available, but it'd be nice to have a list of the commands with a small example of usage for each of them.

raphael-proust commented 8 years ago

You can read the help (:help merlin, or open the file https://github.com/the-lambda-church/merlin/blob/master/vim/merlin/doc/merlin.txt)

Note that the help is not organised by-keybinding. Instead, the documentation of each command ends with something like “Bound to t by default in normal mode.”

If you prefer reading VimL source: https://github.com/the-lambda-church/merlin/blob/master/vim/merlin/autoload/merlin.vim has a lot of map commands.

mars0i commented 6 years ago

Merlin is great, but I don't view this form of documentation as very friendly. <LocalLeader>t is not a keybinding, and merlin.txt doesn't say what <LocalLeader> is. However, it does have a determinate default meaning, \, which you can find out by running map in vim without argument. Not everyone will think of that right away, and it means that the merlin keybindings are mixed in with other keybindings in a noisy representation, and keybindings are listed with names that have to be looked up separately in merlin.txt. (Finding and interpreting the keybindings in the source file requires more vim expertise than one should have to have simply to edit OCaml source. LocalLeader is not defined there in any obvious way. I don't know where its definition is given.)

mars0i commented 6 years ago

Closed??

lpvm commented 6 years ago

@mars0i I reopened it because of your interest. I'm just not interested anymore as I moved to another functional language.

mars0i commented 6 years ago

Fair enough. Thanks. I can make a PR if that would be OK.

raphael-proust commented 6 years ago

If you make that PR, you should definitely leave <LocalLeader>: it is the established way that vim plugins add bindings to the editor. It should not be replaced by \ because it is not equivalent.

Adding a link to the documentation of <LocalLeader> could be useful. And also explaining briefly that <LocalLeader> is bound to \ by default. That'd definitely help anyone who hasn't encountered it before.

mars0i commented 6 years ago

Yes, all that I intended to do was to explain that <LocalLeader> is bound to \ by default. I can add a link to the <LocalLeader> documentation, too.