From 7638455d9bc6175c79748105944fb62dda5442d8 Mon Sep 17 00:00:00 2001 From: Chen Lijun Date: Mon, 21 Jan 2019 15:18:53 +0100 Subject: [PATCH] Add: zeal layer (#2469) --- autoload/SpaceVim/layers/tools/zeal.vim | 32 ++++++++++++++++++++++ docs/layers/tools/zeal.md | 36 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 autoload/SpaceVim/layers/tools/zeal.vim create mode 100644 docs/layers/tools/zeal.md diff --git a/autoload/SpaceVim/layers/tools/zeal.vim b/autoload/SpaceVim/layers/tools/zeal.vim new file mode 100644 index 000000000..1b6f5cacb --- /dev/null +++ b/autoload/SpaceVim/layers/tools/zeal.vim @@ -0,0 +1,32 @@ +"============================================================================= +" zeal.vim --- tools#zeal layer file for SpaceVim +" Copyright (c) 2018 Shidong Wang & Contributors +" Author: Chen Lijun < chenlijun1999 at gmail.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + +"" +" @section tools#zeal, layer-tools-zeal +" @parentsection layers +" This layer provides Zeal integration for SpaceVim +function! SpaceVim#layers#tools#zeal#plugins() abort + return [ + \ ['KabbAmine/zeavim.vim', { + \ 'on_map': { 'nv': ['Zeavim', 'ZVVisSelection', 'ZVKeyDocset'] } + \ }], + \ ] +endfunction + +function! SpaceVim#layers#tools#zeal#config() abort + " Disable default mapping + let g:zv_disable_mapping = 1 + + let g:_spacevim_mappings_space.D = { 'name' : '+Zeal' } + call SpaceVim#mapping#space#def('nmap', ['D', 'd'], + \ 'Zeavim', 'search word under cursor', 0) + call SpaceVim#mapping#space#def('vmap', ['D', 'D'], + \ 'ZVVisSelection', 'search selected text', 0) + call SpaceVim#mapping#space#def('nmap', ['D', 's'], + \ 'ZVKeyDocset', 'specify docset and query', 0) +endfunction diff --git a/docs/layers/tools/zeal.md b/docs/layers/tools/zeal.md new file mode 100644 index 000000000..276ac2700 --- /dev/null +++ b/docs/layers/tools/zeal.md @@ -0,0 +1,36 @@ +--- +title: "SpaceVim zeal layer" +description: "This layer provides Zeal integration for SpaceVim" +--- + +# [SpaceVim Layers:](https://spacevim.org/layers) tools#zeal + + + +- [Description](#description) +- [Layer Installation](#layer-installation) +- [Key bindings](#key-bindings) + + + +## Description + +This layer provides Zeal integration for SpaceVim. + +## Layer Installation + +To use this configuration layer, add it to your `~/.SpaceVim.d/init.toml`. + + +```toml +[[layers]] + name = "tools#zeal" +``` + +## Key bindings + +| Key Binding | Description | +| ----------- | ---------------------------------------------------- | +| `SPC D d` | search word under cursor | +| `SPC D D` | search selected text | +| `SPC D s` | select docset (TIP: use tab completion) and search |