Merge: Vim autocomplete search in doc and 2 new useful Vim functions
authorJean Privat <jean@pryen.org>
Tue, 10 Mar 2015 10:10:31 +0000 (17:10 +0700)
committerJean Privat <jean@pryen.org>
Tue, 10 Mar 2015 10:10:31 +0000 (17:10 +0700)
commit2d606e8d7ddab2a0c326398de3f38a9576a6f7f1
tree8cf14631458602ffc89213abfbc047298f9b3385
parent27be7768f904c3a2d953bab2a1ce040de877b34b
parentca3f0e5c32134c28ff6ef9d0aba2709be0633cc8
Merge: Vim autocomplete search in doc and 2 new useful Vim functions

* The omnifunc for Nit search for autocomplete suggestions in the doc. So if you write `12.modulo`, then hit `Ctrl-X Ctrl-O` (launching the omnifunc), it will suggest `%` to replace the `modulo` part. This is useful when guessing the name of the wanted entity.

* The Nitdoc function can be mapped to `Ctrl-D` to show the doc associated to the word under the cursor. There is still no semantic analysis here, so it will list all possible docs.

* The NitGitGrep function can be mapped to `Ctrl-G` to find instances of the word under the cursor in the currect directory using `git grep`. It will first try to display any definitions and then its uses. This one is a bit trickier to use, but it can be very useful.

----
Bonus hint! You can select the size of the preview window to 5 lines with `set previewheight=5` (@Morriar)

Pull-Request: #1192
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>