|
| 1 | +*devdocs.txt* |
| 2 | + |
| 3 | + |
| 4 | +VIM-DEVDOCS DOCUMENTATION by Romain Lafourcade |
| 5 | + |
| 6 | + |
| 7 | +*devdocs* |
| 8 | +*vim-devdocs* |
| 9 | +Help on using vim-devdocs |
| 10 | + |
| 11 | +1. Introduction ............................. |devdocs-intro| |
| 12 | +2. Installation ............................. |devdocs-installation| |
| 13 | +3. Configuration ............................ |devdocs-configuration| |
| 14 | +4. Usage .................................... |devdocs-usage| |
| 15 | +5. TODO ..................................... |devdocs-todo| |
| 16 | +6. DONE ..................................... |devdocs-done| |
| 17 | +7. Releases ................................. |devdocs-releases| |
| 18 | + |
| 19 | +============================================================================== |
| 20 | +1. Introduction *devdocs-intro* |
| 21 | + |
| 22 | +Vim-devdocs is a very small and trivial plugin with a laser-focused purpose: |
| 23 | +making it possible to look up keywords on `https://devdocs.io` from Vim. |
| 24 | + |
| 25 | +It does so by providing a single command, |:DD|, that will figure out the |
| 26 | +current filetype and point your default browser to the web app with the |
| 27 | +correct query. |
| 28 | + |
| 29 | +Even better, |:DD| can be used under the hood by the built-in |K| for maximum |
| 30 | +Vimmy-ness. See |devdocs-K| below. |
| 31 | + |
| 32 | +Vim-devdocs started its life in my config as an experimental snippet circa |
| 33 | +2016, then became a clean and reusable Gist in mid-2017, which I decided to |
| 34 | +weaponize one year later. If you think a plugin should not be needed for such |
| 35 | +a trivial feature be reassured that I totally share that view. If you feel |
| 36 | +remix-y, the original (but regularly updated) Gist is still up in all its |
| 37 | +12LOC glory: |
| 38 | + |
| 39 | +`https://gist..com/romainl/8d3b73428b4366f75a19be2dad2f0987` |
| 40 | + |
| 41 | +NOTE: vim-devdocs is not affiliated in any way with `devdocs.io` so any |
| 42 | +request pertaining to that site should be directed to its operators. |
| 43 | + |
| 44 | +============================================================================== |
| 45 | +2. Installation *devdocs-installation* |
| 46 | + |
| 47 | +Use your favorite plugin manager or dump the files below in their standard |
| 48 | +location: |
| 49 | + |
| 50 | +on Unix-like systems... > |
| 51 | +
|
| 52 | +~/.vim/autoload/devdocs.vim |
| 53 | +~/.vim/doc/devdocs.txt |
| 54 | +~/.vim/plugin/devdocs.vim |
| 55 | +< |
| 56 | +on Windows... > |
| 57 | +
|
| 58 | +%userprofile%\vimfiles\autoload\devdocs.vim |
| 59 | +%userprofile%\vimfiles\doc\devdocs.txt |
| 60 | +%userprofile%\vimfiles\plugin\devdocs.vim |
| 61 | +< |
| 62 | +If you go with the manual method, don't forget to execute the following |
| 63 | +command to make the documentation globally available: |
| 64 | + |
| 65 | +on Unix-like systems... > |
| 66 | +
|
| 67 | +:helptags ~/.vim/doc |
| 68 | +< |
| 69 | +on Windows... > |
| 70 | +
|
| 71 | +:helptags %userprofile%\vimfiles\doc |
| 72 | +< |
| 73 | +============================================================================== |
| 74 | +3. Configuration *devdocs-configuration* |
| 75 | + |
| 76 | +Option(s): |
| 77 | + |
| 78 | +g:devdocs_enable_scoping .................... |'g:devdocs_enable_scoping'| |
| 79 | + |
| 80 | +------------------------------------------------------------------------------ |
| 81 | +*'g:devdocs_enable_scoping'* |
| 82 | +Value: numeric ~ |
| 83 | +Default: 1 ~ |
| 84 | + |
| 85 | +Enable or disable automatic scoping. |
| 86 | + |
| 87 | +Add the line below to your vimrc to disable this feature: > |
| 88 | +
|
| 89 | +let g:devdocs_enable_scoping = 0 |
| 90 | +< |
| 91 | +============================================================================== |
| 92 | +4. Usage *devdocs-usage* |
| 93 | + |
| 94 | +*:DD* |
| 95 | +*devdocs-DD* |
| 96 | +:DD[!] [filetype] [keyword] |
| 97 | + |
| 98 | +Without [!], [filetype], or [keyword], look up the keyword under the |
| 99 | +cursor, scoped with the current filetype. |
| 100 | +For example, with the cursor on `FuncLit` in a Go buffer: > |
| 101 | +
|
| 102 | +:DD |
| 103 | +< |
| 104 | +would resolve to `https://devdocs.io/go/go/ast/index#FuncLit` in your |
| 105 | +default browser. With [!], don't do any automatic scoping. |
| 106 | + |
| 107 | +Without [!] or [filetype], look up [keyword], scoped with the current |
| 108 | +filetype. |
| 109 | +For example, if the active buffer is a JavaScript buffer: > |
| 110 | +
|
| 111 | +:DD Map |
| 112 | +< |
| 113 | +would resolve to `https://devdocs.io/javascript/global_objects/map` in |
| 114 | +your default browser. With [!], don't do any automatic scoping. |
| 115 | + |
| 116 | +With or without [!], look up [keyword], scoped with [filetype]. |
| 117 | +For example, no matter what's the filetype of the current buffer: > |
| 118 | +
|
| 119 | +:DD scss @mixin |
| 120 | +< |
| 121 | +would resolve to `https://devdocs.io/sass/index#mixin` in your default |
| 122 | +browser. |
| 123 | + |
| 124 | +------------------------------------------------------------------------------ |
| 125 | +*devdocs-K* |
| 126 | +*devdocs-keywordprg* |
| 127 | + |
| 128 | +Vim comes with the built-in and often overlooked |K|, a normal mode command |
| 129 | +that looks up the keyword under the cursor with the external command or Ex |
| 130 | +command set via the |'keywordprg'| option. |:DD| being a pretty basic Ex |
| 131 | +command it is easy to use it for |K|. |
| 132 | + |
| 133 | +If you want |K| to ALWAYS use |:DD|, put this line in your vimrc: > |
| 134 | +
|
| 135 | +set keywordprg=:DD |
| 136 | +< |
| 137 | +If you want |K| to use |:DD| ONLY for certain filetypes, put this line in the |
| 138 | +appropriate `after/ftplugin/<filetype>.vim`: > |
| 139 | +
|
| 140 | +setlocal keywordprg=:DD |
| 141 | +< |
| 142 | +============================================================================== |
| 143 | +5. Todo *devdocs-todo* |
| 144 | + |
| 145 | +- Sit back and relax. |
| 146 | + |
| 147 | +============================================================================== |
| 148 | +6. Done *devdocs-done* |
| 149 | + |
| 150 | +- All done. |
| 151 | + |
| 152 | +============================================================================== |
| 153 | +7. Releases *devdocs-releases* |
| 154 | + |
| 155 | +1.0.0: Andy Montañez ..................................... 09 Jun 2018 |
| 156 | + |
| 157 | +First version. |
| 158 | + |
| 159 | +vim:tw=78:ts=8:ft=help:norl: |
0 commit comments