Skip to content

Commit 0c74ae5

Browse files
committed
Update doc page a bit
1 parent ffe13e8 commit 0c74ae5

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

doc/ocp-browser.gif

795 KB
Loading

doc/ocp-index.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Examples:
2424
* `ocp-index type Module.ident`
2525
* `ocp-index complete iden`
2626
* `ocp-index locate Module.ident`
27+
* `ocp-index print Module.ident <format>`
2728

2829
Options:
2930
* `-I` include dirs / loaded libraries
@@ -34,6 +35,20 @@ Options:
3435

3536
* output format: `--color`, `--show`/`--hide` to control the kinds of idents to
3637
display
38+
* `--format FORMAT`, display using the given format string:
39+
<table>
40+
<tr><th>string<th>contents<th>examples
41+
<tr><td><code>%n</code><td>name<td>"map"
42+
<tr><td><code>%q</code><td>qualified ident in context<td>"List.map", "map"
43+
<tr><td><code>%p</code><td>full ident path<td>"List.map"
44+
<tr><td><code>%k</code><td>ident kind<td>"type", "val", "exception", "field(<type>)"...
45+
<tr><td><code>%t</code><td>type<td>('a -> 'b) -> 'a list -> 'a list
46+
<tr><td><code>%d</code><td>ocamldoc comment<td>"Applies the function..."
47+
<tr><td><code>%l</code><td>Implementation location<td>"src/list.ml:83:0"
48+
<tr><td><code>%s</code><td>Interface location<td>"src/list.mli:51:0"
49+
<tr><td><code>%f</code><td>File of origin<td>"_build/list.cmti"
50+
<tr><td><code>%i</code><td>Summary<td>List.map val ('a -> 'b) -> 'a list -> 'b list
51+
</table>
3752

3853
## Build
3954

@@ -57,22 +72,22 @@ You can run the script `tools/emacs-setup.sh` to get hints on the configuration
5772
of emacs for ocp-index (it won't modify any files). Adding the following
5873
line to your `.emacs`:
5974
```lisp
60-
(add-to-list 'load-path "/path/to/ocp-index.el")
75+
(add-to-list 'load-path "/path/to/ocp-index.el/")
6176
(require 'ocp-index)
6277
```
6378
Will give you:
64-
- `C-c TAB` to auto-complete ((global-set-key (kbd "KEY") 'auto-complete) to add
79+
- `C-c TAB` to auto-complete (`(global-set-key (kbd "KEY") 'auto-complete)` to add
6580
your own binding)
6681
- `C-c t` to print the type of the identifier under cursor
6782
- `C-c ;` to jump to the definition of the identifier under cursor (use `C-c C-;` to do that in the current window)
6883
- `C-c :` to jump to the interface of the identifier under cursor (use `C-c C-:` to do that in the current window)
84+
- `C-c /` to lookup all occurences of the ident under point in the current project (ocp-grep)
6985

7086
See `M-x customize ocp-index` for more options.
7187

7288
### Vim
7389

74-
A script `ocp-index.vim`, contributed by
75-
[anyakichi](https://github.com/anyakichi/vim-ocp-index), is available under
90+
A script `ocp-index.vim`, contributed by Daisuke Inajima, is available under
7691
`tools`. It supports:
7792
* omni completion
7893
* type information printing
@@ -108,14 +123,15 @@ If needed, you can specify ocp-index path explicitly: `let g:ocpindex_program =
108123

109124
### Sublime Text
110125

111-
There is a binding written by Peter Zotov at https://github.com/whitequark/sublime-ocp-index
126+
There is a binding written by Peter Zotov on [Github](https://github.com/whitequark/sublime-ocp-index)
112127

113128
### ocp-browser
114129

115-
A small ncurses-based browser based on ocp-index is also included. You will need
116-
lambda-term installed to build it:
117-
```
118-
$ opam install lambda-term
119-
$ ./configure
120-
$ make ocp-browser
121-
```
130+
<img src="ocp-browser.gif" alt="ocp-browser animated screenshot"></img>
131+
132+
A nice terminal interface leveraging the power of ocp-index is included. It
133+
provides a quick way to browser external and in-project interfaces. Thanks to
134+
the contribution from [Gabriel Radanne](https://gihub.com/Drup).
135+
136+
To compile it, make sure that you have lambda-term installed, e.g. `opam install
137+
lambda-term ocp-index`.

0 commit comments

Comments
 (0)