mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 12:30:05 +08:00
Update lang#vim layer
This commit is contained in:
parent
a80cfdb7a3
commit
de43970de3
@ -13,4 +13,25 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#layers#lang#vim#config() abort
|
function! SpaceVim#layers#lang#vim#config() abort
|
||||||
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
|
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
|
||||||
|
call SpaceVim#mapping#space#regesit_lang_mappings('vim', funcref('s:language_specified_mappings'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:language_specified_mappings() abort
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','e'], 'call call('
|
||||||
|
\ . string(function('s:eval_cursor')) . ', [])',
|
||||||
|
\ 'echo eval under cursor', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','v'], 'call call('
|
||||||
|
\ . string(function('s:helpversion_cursor')) . ', [])',
|
||||||
|
\ 'echo helpversion under cursor', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:eval_cursor() abort
|
||||||
|
let is_keyword = &iskeyword
|
||||||
|
set iskeyword+=:
|
||||||
|
echo expand('<cword>') 'is' eval(expand('<cword>'))
|
||||||
|
let &iskeyword = is_keyword
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:helpversion_cursor() abort
|
||||||
|
exe 'HelpfulVersion' expand('<cword>')
|
||||||
endfunction
|
endfunction
|
||||||
|
28
docs/layers/lang/vim.md
Normal file
28
docs/layers/lang/vim.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
title: "SpaceVim lang#vim layer"
|
||||||
|
---
|
||||||
|
|
||||||
|
# [SpaceVim Layers:](https://spacevim.org/layers) lang#vim
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
|
- [Description](#description)
|
||||||
|
- [Layer Installation](#layer-installation)
|
||||||
|
- [Key bindings](#key-bindings)
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This layer is for vim plugin development.
|
||||||
|
|
||||||
|
## Layer Installation
|
||||||
|
|
||||||
|
To use this configuration layer, add `call SpaceVim#layers#load('lang#vim')` to your custom configuration file.
|
||||||
|
|
||||||
|
## Key bindings
|
||||||
|
|
||||||
|
| Key Binding | Description |
|
||||||
|
| ----------- | ----------------------------------------- |
|
||||||
|
| `SPC l e` | print the eval under the cursor |
|
||||||
|
| `SPC l v` | print the helpfulversion under the cursor |
|
Loading…
Reference in New Issue
Block a user