mirror of
https://github.com/rizzatti/dash.vim.git
synced 2026-03-03 18:24:03 +01:00
235 lines
8.5 KiB
Plaintext
235 lines
8.5 KiB
Plaintext
*dash.txt* Launch queries for Dash.app from inside Vim
|
|
|
|
|
|
/$$ /$$ ~
|
|
| $$ | $$ ~
|
|
/$$$$$$$ /$$$$$$ /$$$$$$$| $$$$$$$ ~
|
|
/$$__ $$ |____ $$ /$$_____/| $$__ $$~
|
|
| $$ | $$ /$$$$$$$| $$$$$$ | $$ \ $$~
|
|
| $$ | $$ /$$__ $$ \____ $$| $$ | $$~
|
|
| $$$$$$$| $$$$$$$ /$$$$$$$/| $$ | $$~
|
|
\_______/ \_______/|_______/ |__/ |__/~
|
|
|
|
Search APIs with Dash.app
|
|
|
|
==============================================================================
|
|
CONTENTS *DashContents*
|
|
|
|
1. Intro ...................... |DashIntro|
|
|
2.1 Commands .................. |DashCommands|
|
|
2.1 :Dash[!] .............. |:Dash|
|
|
2.2 :DashKeywords[!] ...... |:DashKeywords|
|
|
3. Mappings ................... |DashMappings|
|
|
3.1 Key bindings .......... |DashKeyBindings|
|
|
4. Configuration .............. |DashConfig|
|
|
4.1 dash_activate ......... |DashConfig_activate|
|
|
4.2 dash_map .............. |DashConfig_map|
|
|
5. License .................... |DashLicense|
|
|
6. Bugs ....................... |DashBugs|
|
|
7. Contributing ............... |DashContributing|
|
|
8. Changelog .................. |DashChangelog|
|
|
9. Credits .................... |DashCredits|
|
|
|
|
==============================================================================
|
|
1. Intro *DashIntro*
|
|
|
|
Going back and forth from your editor to your browser, searching for some term
|
|
in that tab for the API docs for the language/framework you are working with
|
|
can be a real pain in the behind.
|
|
|
|
Dash.app made things simpler by aggregating a bunch of documentation from
|
|
diverse sources into a single database that was easily queryable, but you
|
|
still had to alternate to it, and paste/write the thing you were looking for.
|
|
|
|
Having the docs for the word under the cursor, from inside Vim, is just
|
|
priceless. This is what this plugin is about.
|
|
|
|
==============================================================================
|
|
2. Commands *DashCommands*
|
|
|
|
------------------------------------------------------------------------------
|
|
2.1 :Dash[!] *:Dash*
|
|
|
|
Searches for the given term in specific docsets or in all of them. A keyword
|
|
is a specific setting configured in Dash.app's Preferences that associates
|
|
either to a docset or a profile to a group of docsets.
|
|
|
|
Usage:
|
|
>
|
|
:Dash[!] [TERM] [KEYWORD]
|
|
<
|
|
Examples:
|
|
>
|
|
:Dash
|
|
<
|
|
Will search for the word under the cursor in the docset corresponding to
|
|
the current filetype.
|
|
>
|
|
:Dash printf
|
|
<
|
|
Will search for the word 'printf' in the docset corresponding to the
|
|
current filetype.
|
|
>
|
|
:Dash setTimeout javascript
|
|
<
|
|
Will search for the word 'setTimeout' in the 'javascript' docset.
|
|
|
|
Tip: You can use <Tab> to complete the keyword names.
|
|
>
|
|
:Dash!
|
|
<
|
|
Will search for the word under the cursor in all docsets (globally).
|
|
>
|
|
:Dash! func
|
|
<
|
|
Will search for 'func' in all docsets.
|
|
|
|
------------------------------------------------------------------------------
|
|
2.2 :DashKeywords[!] *:DashKeywords*
|
|
|
|
This command can be used to show the current buffer keywords or set keywords.
|
|
|
|
Examples:
|
|
>
|
|
:DashKeywords
|
|
<
|
|
Shows the current buffer list of used keywords.
|
|
>
|
|
:DashKeywords! backbone underscore javascript
|
|
<
|
|
Sets the preferred docsets for lookup for the current buffer, in the given
|
|
order. Any following usages of |:Dash| where the 2nd argument is not
|
|
provided will use, as the default, to searching 'backbone's docset (the
|
|
first docset in the list above).
|
|
|
|
Tip: If you have bound <Plug>DashSearch, as in the example below, hitting
|
|
'2<Leader>d' will search the 2nd docset ('underscore') and '3<Leader>d'
|
|
will search the 3rd docset ('javascript'), for this example.
|
|
>
|
|
:DashKeywords rails
|
|
<
|
|
Adds the rails docset to the list of keywords to search for.
|
|
|
|
==============================================================================
|
|
3. Mappings *DashMappings*
|
|
|
|
------------------------------------------------------------------------------
|
|
3.1 Key bindings *DashKeyBindings*
|
|
|
|
This plugin provides helpful mappings for common use cases.
|
|
|
|
<Plug>DashSearch Searches for the |word| under the cursor,
|
|
considering the current keyword setup for
|
|
docset lookup.
|
|
|
|
<Plug>DashGlobalSearch Searches for the |word| under the cursor in all
|
|
docsets.
|
|
|
|
For example, add this to your |.vimrc|:
|
|
>
|
|
:nmap <silent> <leader>d <Plug>DashSearch
|
|
<
|
|
Note: Using |:noremap| will not work with <Plug> mappings.
|
|
|
|
==============================================================================
|
|
4. Configuration *DashConfig*
|
|
|
|
------------------------------------------------------------------------------
|
|
4.1 g:dash_activate *DashConfig_activate*
|
|
|
|
This flag configures if the Dash.app (OS X) will be activated to the
|
|
foreground whenever dash.vim sends it a search.
|
|
|
|
Tip: If you use Dash.app in Standard mode, setting this flag to 0 can save
|
|
you a lot of Command+Tabs back to Vim.
|
|
Tip 2: If you like to use Dash.app in HUD mode, setting this flag to 0 will
|
|
not show the window of the search result.
|
|
|
|
Default: 1
|
|
|
|
|
|
4.2 g:dash_map *DashConfig_map*
|
|
|
|
Allows configuration of mappings between Vim filetypes and Dash's docsets.
|
|
|
|
The variable must be a dictionary where the key is the Vim filetype you want
|
|
to associate and the value can be one of two kinds:
|
|
|
|
List If the value associated with the key is a list,
|
|
than the default list of docsets used by the given
|
|
filetype is replaced by the one user defined.
|
|
|
|
String If the value associated with the key is a simple
|
|
string, than the given docset is prepended on the
|
|
list of available docsets to the given filetype.
|
|
|
|
Example:
|
|
|
|
The default java docsets defined in dash.vim is this:
|
|
>
|
|
['java', 'javafx', 'grails', 'groovy', 'playjava', 'spring', 'cvj',
|
|
'processing', 'javadoc']
|
|
<
|
|
If you have this in your .vimrc:
|
|
>
|
|
let g:dash_map = {
|
|
\ 'java' : 'android'
|
|
\ }
|
|
<
|
|
The java docset will be:
|
|
>
|
|
['android', 'java', 'javafx', 'grails', 'groovy', 'playjava',
|
|
'spring', 'cvj', 'processing', 'javadoc']
|
|
<
|
|
Now if you don't want the extra docsets to be used when you're editing a java
|
|
file, you could have:
|
|
>
|
|
let g:dash_map = {
|
|
\ 'java' : ['android', 'java']
|
|
\ }
|
|
<
|
|
This would make java files have only "Android" and "Java" docsets to search
|
|
on.
|
|
|
|
==============================================================================
|
|
5. License *DashLicense*
|
|
|
|
Released under the MIT License.
|
|
|
|
==============================================================================
|
|
6. Bugs *DashBugs*
|
|
|
|
Before submitting a bug report, try upgrading to the latest version of the
|
|
plugin. The bug could have been fixed already.
|
|
|
|
If the problem persists, go to:
|
|
|
|
https://github.com/rizzatti/dash.vim/issues
|
|
|
|
Check the list of open issues and see if the problem you are facing has not
|
|
been reported already. You can add more information to the issue in case it
|
|
has. Otherwise, submit a new issue.
|
|
|
|
==============================================================================
|
|
7. Contributing *DashContributing*
|
|
|
|
Contributions are welcomed and appreciated. Just follow the normal Github
|
|
procedure. Go to:
|
|
|
|
https://github.com/rizzatti/dash.vim
|
|
|
|
Fork the project. Work on what you think would make it better. Send a pull
|
|
request.
|
|
|
|
==============================================================================
|
|
7. Changelog *DashChangelog*
|
|
|
|
Refer to CHANGELOG.txt
|
|
|
|
==============================================================================
|
|
9. Credits *DashCredits*
|
|
|
|
TODO
|
|
|
|
" vim: ft=help
|