1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-26 04:00:29 +08:00
Steve Lemuel 82aaec57a8 feat(dash.vim): add devdocs support with (devdocs.vim) (#2875)
keybinding: (SPC D b) search word on devdocs.io
[rhysd/devdocs.vim](https://github.com/rhysd/devdocs.vim)
2019-06-08 10:16:04 +08:00

41 lines
1.5 KiB
VimL

"=============================================================================
" dash.vim --- tools#dash layer file for SpaceVim
" Copyright (c) 2018 Shidong Wang & Contributors
" Author: Seong Yong-ju < sei40kr at gmail.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
""
" @section tools#dash, layer-tools-dash
" @parentsection layers
" This layer provides Dash integration for SpaceVim
function! SpaceVim#layers#tools#dash#plugins() abort
return [
\ ['rizzatti/dash.vim', {
\ 'on_map': { 'n': ['<Plug>DashSearch', '<Plug>DashGlobalSearch'] }
\ }],
\ ['rhysd/devdocs.vim', {
\ 'on_map': { 'n': ['<Plug>(devdocs-under-cursor)'] }
\ }],
\ ]
endfunction
function! SpaceVim#layers#tools#dash#config() abort
"" rizzatti/dash.vim {{{
" Allows configuration of mappings between Vim filetypes and Dash's docsets.
let g:dash_map = extend({
\ 'java': ['java', 'android', 'javafx', 'spring', 'javadoc'],
\ }, get(g:, 'dash_map', {}))
"" }}}
let g:_spacevim_mappings_space.D = { 'name' : '+Dash' }
call SpaceVim#mapping#space#def('nmap', ['D', 'b'],
\ '<Plug>(devdocs-under-cursor)', 'search word on devdocs.io', 0)
call SpaceVim#mapping#space#def('nmap', ['D', 'd'],
\ '<Plug>DashSearch', 'search word under cursor', 0)
call SpaceVim#mapping#space#def('nmap', ['D', 'D'],
\ '<Plug>DashGlobalSearch', 'search word under cursor in all docs', 0)
endfunction