mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:50:05 +08:00
Add tools#dash layer (#1366)
Add tools#dash layer to integrate with Dash.
This commit is contained in:
parent
35f0ebe2ab
commit
861a0b84b7
35
autoload/SpaceVim/layers/tools/dash.vim
Normal file
35
autoload/SpaceVim/layers/tools/dash.vim
Normal 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
33
docs/layers/tools/dash.md
Normal 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 |
|
Loading…
Reference in New Issue
Block a user