1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:30:04 +08:00

Add: zeal layer (#2469)

This commit is contained in:
Chen Lijun 2019-01-21 15:18:53 +01:00 committed by Wang Shidong
parent 6d514432a1
commit 7638455d9b
2 changed files with 68 additions and 0 deletions

View File

@ -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': ['<Plug>Zeavim', '<Plug>ZVVisSelection', '<Plug>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'],
\ '<Plug>Zeavim', 'search word under cursor', 0)
call SpaceVim#mapping#space#def('vmap', ['D', 'D'],
\ '<Plug>ZVVisSelection', 'search selected text', 0)
call SpaceVim#mapping#space#def('nmap', ['D', 's'],
\ '<Plug>ZVKeyDocset', 'specify docset and query', 0)
endfunction

36
docs/layers/tools/zeal.md Normal file
View File

@ -0,0 +1,36 @@
---
title: "SpaceVim zeal layer"
description: "This layer provides Zeal integration for SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) tools#zeal
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## 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 |