1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 20:10:05 +08:00

Add tools#dash layer (#1366)

Add tools#dash layer to integrate with Dash.
This commit is contained in:
Seong Yong-ju 2018-02-03 22:34:47 +09:00 committed by Wang Shidong
parent 35f0ebe2ab
commit 861a0b84b7
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,35 @@
"=============================================================================
" 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: MIT license
"=============================================================================
""
" @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'] }
\ }],
\ ]
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', '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

33
docs/layers/tools/dash.md Normal file
View File

@ -0,0 +1,33 @@
---
title: "SpaceVim dash layer"
description: "This layer provides Dash integration for SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) tools#dash
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provides Dash integration for SpaceVim.
## Layer Installation
To use this configuration layer, add it to your `~/.SpaceVim.d/init.vim`.
```vim
call SpaceVim#layers#load('tools#dash')
```
## Key bindings
| Key Binding | Description |
| ----------- | ------------------------------------ |
| `SPC D d` | search word under cursor |
| `SPC D D` | search word under cursor in all docs |