Skip to content

Commit fb2858c

Browse files
author
Romain Lafourcade
committed
Updated README and doc
1 parent a1f0f07 commit fb2858c

File tree

3 files changed

+75
-47
lines changed

3 files changed

+75
-47
lines changed

‎README.md

+35-16
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,73 @@ Look up keywords on [https://devdocs.io](https://devdocs.io) from Vim.
44

55
## Introduction
66

7-
Vim-devdocs is a very small and trivial plugin with a laser-focused purpose: making it possible to look up keywords on [https://devdocs.io](https://devdocs.io) from Vim.
7+
Vim-devdocs is a very small and trivial plugin with a laser-focused purpose: looking up keywords on [https://devdocs.io](https://devdocs.io) from Vim.
88

99
It does so by providing a single command, `:DD`, that will figure out the current filetype and point your default browser to the web app with the correct query.
1010

1111
Even better, `:DD` can be used under the hood by the built-in `K` for maximum street credibility.
1212

1313
To work its magic, vim-devdocs depends on:
1414

15-
* `xdg-open` on Linux and BSD, part of the `xdg-utils` package,
16-
* `open` on MacOS, it's installed by default,
17-
* `cmd.exe` on Windows, it's also installed by default,
15+
* `xdg-open` on various Unix-like systems, part of the `xdg-utils` package,
16+
* `open` on MacOS, it is installed by default,
17+
* `cmd.exe` on WSL, it is also installed by default,
18+
* `explorer` on Windows, it is also installed by default,
1819

1920
but you can tell it to use any external command with `'g:devdocs_open_command'`.
2021

21-
Vim-devdocs started its life in my config as an experimental snippet circa 2016, then became a clean and reusable Gist in mid-2017, which I decided to weaponize one year later. If you think a plugin should not be needed for such a trivial feature be reassured that I totally share that view. If you feel remix-y, [the original (but regularly updated) Gist](https://gist..com/romainl/8d3b73428b4366f75a19be2dad2f0987) is still up in all its 13LOC glory.
22+
## Background
23+
24+
Vim-devdocs started its life in my config as an experimental snippet circa 2016, then became a clean and reusable Gist in mid-2017, which I decided to weaponize one year later. If you think a plugin should not be needed for such a trivial feature be reassured that I totally share that view. If you feel remix-y, [the original Gist](https://gist..com/romainl/8d3b73428b4366f75a19be2dad2f0987) is still up in all its 13LOC glory.
2225

2326
NOTE: vim-devdocs is not affiliated in any way with [https://devdocs.io](https://devdocs.io) so any request pertaining to that site should be directed to its operators.
2427

2528
## Installation
2629

27-
Use your favorite plugin manager or dump the files below in their standard location:
30+
Method 1
31+
32+
Use your favorite runtimepath/plugin manager.
33+
34+
### Method 2
35+
36+
If you are using Vim 8.0 or above, move this directory to:
37+
38+
# Unix-like systems
39+
~/.vim/pack/{whatever name you want}/start/vim-devdocs
40+
41+
# Windows
42+
%userprofile%\vimfiles\pack\{whatever name you want}\start\vim-devdocs
43+
44+
See `:help package`.
2845

29-
on Unix-like systems…
46+
### Method 3
3047

48+
If you are using Vim 7.4, move the files in this directory to their standard location:
49+
50+
# Unix-like systems
3151
~/.vim/doc/devdocs.txt
3252
~/.vim/plugin/devdocs.vim
3353

34-
on Windows…
35-
54+
# Windows
3655
%userprofile%\vimfiles\doc\devdocs.txt
3756
%userprofile%\vimfiles\plugin\devdocs.vim
3857

39-
If you go with the manual method, don't forget to execute the following command to make the documentation globally available:
40-
41-
on Unix-like systems…
58+
## Documentation
4259

43-
:helptags ~/.vim/doc
60+
You can use this command to get help on vim-devdocs:
4461

45-
on Windows…
46-
47-
:helptags %userprofile%\vimfiles\doc
62+
:help vim-devdocs
4863

4964
## Configuration
5065

5166
Add the line below to your vimrc if you want to disable automatic filetype scoping:
5267

5368
let g:devdocs_enable_scoping = 0
5469

70+
Add the line below to your `vimrc` if you want to use a different "opener" tahn the default one:
71+
72+
let g:devdocs_open_command = "my-command"
73+
5574
## Usage
5675

5776
Use `:DD` without argument to look up the word under the cursor, scoped with the current filetype:

‎doc/devdocs.txt

+24-31
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ street credibility. See |devdocs-K| below.
3131

3232
To work its magic, vim-devdocs depends on:
3333

34-
* `xdg-open` on Linux and BSD, part of the `xdg-utils` package,
35-
* `open` on MacOS, it's installed by default,
36-
* `explorer` on Windows, it's also installed by default,
34+
* `xdg-open` on various Unix-like systems, part of the `xdg-utils` package,
35+
* `open` on MacOS, it is installed by default,
36+
* `cmd.exe` on WSL, it is also installed by default,
37+
* `explorer` on Windows, it is also installed by default,
3738

3839
but you can tell it to use any external command with |g:devdocs_open_command|.
3940

4041
Vim-devdocs started its life in my config as an experimental snippet circa
4142
2016, then became a clean and reusable Gist in mid-2017, which I decided to
4243
weaponize one year later. If you think a plugin should not be needed for such
4344
a trivial feature be reassured that I totally share that view. If you feel
44-
remix-y, the original (but regularly updated) Gist is still up in all its
45-
13LOC glory:
45+
remix-y, the original Gist is still up in all its 13LOC glory:
4646

4747
`https://gist..com/romainl/8d3b73428b4366f75a19be2dad2f0987`
4848

@@ -52,40 +52,38 @@ request pertaining to that site should be directed to its operators.
5252
==============================================================================
5353
2. Installation *devdocs-installation*
5454

55-
Use your favorite plugin manager or dump the files below in their standard
56-
location:
55+
Method 1, use your favorite runtimepath/plugin manager.
5756

58-
on Unix-like systems... >
57+
Method 2, if you are using Vim 8.0 or above, move this directory to:
58+
>
59+
# Unix-like systems
60+
~/.vim/pack/{whatever name you want}/start/vim-devdocs
5961
62+
# Windows
63+
%userprofile%\vimfiles\pack\{whatever name you want}\start\vim-devdocs
64+
<
65+
See |package|.
66+
67+
Method 3, if you are using Vim 7.4, move the files in this directory to their standard location:
68+
>
69+
# Unix-like systems
6070
~/.vim/doc/devdocs.txt
6171
~/.vim/plugin/devdocs.vim
62-
<
63-
on Windows... >
6472
73+
# Windows
6574
%userprofile%\vimfiles\doc\devdocs.txt
6675
%userprofile%\vimfiles\plugin\devdocs.vim
6776
<
68-
If you go with the manual method, don't forget to execute the following
69-
command to make the documentation globally available:
70-
71-
on Unix-like systems... >
72-
73-
:helptags ~/.vim/doc
74-
<
75-
on Windows... >
76-
77-
:helptags %userprofile%\vimfiles\doc
78-
<
7977
==============================================================================
8078
3. Configuration *devdocs-configuration*
8179

8280
Options:
8381

8482
g:devdocs_enable_scoping .................... |'g:devdocs_enable_scoping'|
85-
g:devdocs_open_command ...................... |'g:devdocs_open_command|
83+
g:devdocs_open_command ...................... |'g:devdocs_open_command'|
8684

8785
------------------------------------------------------------------------------
88-
*'g:devdocs_enable_scoping'*
86+
*g:devdocs_enable_scoping*
8987
Value: numeric ~
9088
Default: 1 ~
9189

@@ -95,21 +93,16 @@ Add the line below to your vimrc to disable this feature: >
9593
9694
let g:devdocs_enable_scoping = 0
9795
<
98-
9996
------------------------------------------------------------------------------
100-
*'g:devdocs_open_command'*
97+
*g:devdocs_open_command*
10198
Value: string ~
10299
Default: none ~
103100

104101
Tell vim-devdocs what command to use to open the documentation.
105102

106-
By default, vim-devdocs will try to use `xdg-open` (common on Linux and BSD,
107-
part of the `xdg-utils` package) first, then `open` (MacOS), then `explorer`
108-
(Windows), and finally fail silently if none of that command is found.
109-
110103
Add the line below to your vimrc to tell vim-devdocs to use `my-command`: >
111104
112-
let g:devdocs_open_command = my-command
105+
let g:devdocs_open_command = "my-command"
113106
<
114107
==============================================================================
115108
4. Usage *devdocs-usage*
@@ -127,7 +120,7 @@ Add the line below to your vimrc to tell vim-devdocs to use `my-command`: >
127120
<
128121
would resolve to `https://devdocs.io/go/ast/index#FuncLit` in your
129122
default browser.
130-
123+
131124
With [!], don't do any automatic scoping.
132125

133126
2. Without [!] or [filetype], look up [keyword], scoped with the current

‎doc/tags

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:DD devdocs.txt /*:DD*
2+
devdocs devdocs.txt /*devdocs*
3+
devdocs-DD devdocs.txt /*devdocs-DD*
4+
devdocs-K devdocs.txt /*devdocs-K*
5+
devdocs-configuration devdocs.txt /*devdocs-configuration*
6+
devdocs-done devdocs.txt /*devdocs-done*
7+
devdocs-installation devdocs.txt /*devdocs-installation*
8+
devdocs-intro devdocs.txt /*devdocs-intro*
9+
devdocs-keywordprg devdocs.txt /*devdocs-keywordprg*
10+
devdocs-releases devdocs.txt /*devdocs-releases*
11+
devdocs-todo devdocs.txt /*devdocs-todo*
12+
devdocs-usage devdocs.txt /*devdocs-usage*
13+
devdocs.txt devdocs.txt /*devdocs.txt*
14+
g:devdocs_enable_scoping devdocs.txt /*g:devdocs_enable_scoping*
15+
g:devdocs_open_command devdocs.txt /*g:devdocs_open_command*
16+
vim-devdocs devdocs.txt /*vim-devdocs*

0 commit comments

Comments
 (0)