You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-16
Original file line number
Diff line number
Diff line change
@@ -4,54 +4,73 @@ Look up keywords on [https://devdocs.io](https://devdocs.io) from Vim.
4
4
5
5
## Introduction
6
6
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.
8
8
9
9
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.
10
10
11
11
Even better, `:DD` can be used under the hood by the built-in `K` for maximum street credibility.
12
12
13
13
To work its magic, vim-devdocs depends on:
14
14
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,
18
19
19
20
but you can tell it to use any external command with `'g:devdocs_open_command'`.
20
21
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.
22
25
23
26
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.
24
27
25
28
## Installation
26
29
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`.
28
45
29
-
on Unix-like systems…
46
+
### Method 3
30
47
48
+
If you are using Vim 7.4, move the files in this directory to their standard location:
49
+
50
+
# Unix-like systems
31
51
~/.vim/doc/devdocs.txt
32
52
~/.vim/plugin/devdocs.vim
33
53
34
-
on Windows…
35
-
54
+
# Windows
36
55
%userprofile%\vimfiles\doc\devdocs.txt
37
56
%userprofile%\vimfiles\plugin\devdocs.vim
38
57
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
42
59
43
-
:helptags ~/.vim/doc
60
+
You can use this command to get help on vim-devdocs:
44
61
45
-
on Windows…
46
-
47
-
:helptags %userprofile%\vimfiles\doc
62
+
:help vim-devdocs
48
63
49
64
## Configuration
50
65
51
66
Add the line below to your vimrc if you want to disable automatic filetype scoping:
52
67
53
68
let g:devdocs_enable_scoping = 0
54
69
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
+
55
74
## Usage
56
75
57
76
Use `:DD` without argument to look up the word under the cursor, scoped with the current filetype:
0 commit comments