mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 06:20:05 +08:00
feat(layer): use notify api in lang#vim
layer
Problem: no info about doc generation. Solution: 1. run notify api on job exit. 2. add `:h SpaceVim-layers-lang-vim`
This commit is contained in:
parent
e33aeb1b00
commit
553749f5f0
@ -6,6 +6,34 @@
|
|||||||
" License: GPLv3
|
" License: GPLv3
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
""
|
||||||
|
" @section lang#vim, layers-lang-vim
|
||||||
|
" @parentsection layers
|
||||||
|
" This layer is for vim script development, disabled by default, to enable this
|
||||||
|
" layer, add following snippet to your SpaceVim configuration file.
|
||||||
|
" >
|
||||||
|
" [[layers]]
|
||||||
|
" name = 'lang#vim'
|
||||||
|
" <
|
||||||
|
"
|
||||||
|
" The `checkers` layer provides syntax linter for vim. you need to install the
|
||||||
|
" `vint` command:
|
||||||
|
" >
|
||||||
|
" pip install vim-vint
|
||||||
|
" <
|
||||||
|
"
|
||||||
|
" @subsection key bindings
|
||||||
|
"
|
||||||
|
" The following key bindings will be added when this layer is loaded:
|
||||||
|
" >
|
||||||
|
" key binding Description
|
||||||
|
" SPC l e eval cursor expr
|
||||||
|
" SPC l v run HelpfulVersion cword
|
||||||
|
" SPC l f open exception trace
|
||||||
|
" g d jump to definition
|
||||||
|
" <
|
||||||
|
|
||||||
if exists('s:auto_generate_doc')
|
if exists('s:auto_generate_doc')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@ -19,6 +47,7 @@ let s:SID = SpaceVim#api#import('vim#sid')
|
|||||||
let s:JOB = SpaceVim#api#import('job')
|
let s:JOB = SpaceVim#api#import('job')
|
||||||
let s:SYS = SpaceVim#api#import('system')
|
let s:SYS = SpaceVim#api#import('system')
|
||||||
let s:FILE = SpaceVim#api#import('file')
|
let s:FILE = SpaceVim#api#import('file')
|
||||||
|
let s:NOTI = SpaceVim#api#import('notify')
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#vim#plugins() abort
|
function! SpaceVim#layers#lang#vim#plugins() abort
|
||||||
let plugins = [
|
let plugins = [
|
||||||
@ -58,6 +87,15 @@ function! SpaceVim#layers#lang#vim#config() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:on_exit(...) abort
|
||||||
|
let data = get(a:000, 2)
|
||||||
|
if data != 0
|
||||||
|
call s:NOTI.notify('failed to generate doc!', 'WarningMsg')
|
||||||
|
else
|
||||||
|
call s:NOTI.notify('vim doc generated!', 'Normal')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:generate_doc() abort
|
function! s:generate_doc() abort
|
||||||
" neovim in windows executable function is broken
|
" neovim in windows executable function is broken
|
||||||
" https://github.com/neovim/neovim/issues/9391
|
" https://github.com/neovim/neovim/issues/9391
|
||||||
@ -66,9 +104,17 @@ function! s:generate_doc() abort
|
|||||||
if !empty(addon_info)
|
if !empty(addon_info)
|
||||||
let dir = s:FILE.unify_path(addon_info, ':h')
|
let dir = s:FILE.unify_path(addon_info, ':h')
|
||||||
if executable('vimdoc') && !s:SYS.isWindows
|
if executable('vimdoc') && !s:SYS.isWindows
|
||||||
call s:JOB.start(['vimdoc', dir])
|
call s:JOB.start(['vimdoc', dir],
|
||||||
|
\ {
|
||||||
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
|
\ }
|
||||||
|
\ )
|
||||||
elseif executable('python')
|
elseif executable('python')
|
||||||
call s:JOB.start(['python', '-m', 'vimdoc', dir])
|
call s:JOB.start(['python', '-m', 'vimdoc', dir],
|
||||||
|
\ {
|
||||||
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
|
\ }
|
||||||
|
\ )
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
" name = 'lang#vue'
|
" name = 'lang#vue'
|
||||||
" <
|
" <
|
||||||
"
|
"
|
||||||
" The |checkers| layer provides syntax linter for vue. you need to install the
|
" The `checkers` layer provides syntax linter for vue. you need to install the
|
||||||
" `eslint` and `eslint-plugin-vue`:
|
" `eslint` and `eslint-plugin-vue`:
|
||||||
" >
|
" >
|
||||||
" npm install -g eslint eslint-plugin-vue
|
" npm install -g eslint eslint-plugin-vue
|
||||||
|
@ -181,21 +181,22 @@ CONTENTS *SpaceVim-contents*
|
|||||||
95. lang#typescript....................|SpaceVim-layers-lang-typescript|
|
95. lang#typescript....................|SpaceVim-layers-lang-typescript|
|
||||||
96. lang#v......................................|SpaceVim-layers-lang-v|
|
96. lang#v......................................|SpaceVim-layers-lang-v|
|
||||||
97. lang#vbnet..............................|SpaceVim-layers-lang-vbnet|
|
97. lang#vbnet..............................|SpaceVim-layers-lang-vbnet|
|
||||||
98. lang#vue..................................|SpaceVim-layers-lang-vue|
|
98. lang#vim..................................|SpaceVim-layers-lang-vim|
|
||||||
99. lang#wolfram..........................|SpaceVim-layers-lang-wolfram|
|
99. lang#vue..................................|SpaceVim-layers-lang-vue|
|
||||||
100. lang#xml.................................|SpaceVim-layers-lang-xml|
|
100. lang#wolfram.........................|SpaceVim-layers-lang-wolfram|
|
||||||
101. lang#xquery...........................|SpaceVim-layers-lang-xquery|
|
101. lang#xml.................................|SpaceVim-layers-lang-xml|
|
||||||
102. lang#zig.................................|SpaceVim-layers-lang-zig|
|
102. lang#xquery...........................|SpaceVim-layers-lang-xquery|
|
||||||
103. language server protocol......................|SpaceVim-layers-lsp|
|
103. lang#zig.................................|SpaceVim-layers-lang-zig|
|
||||||
104. leaderf...................................|SpaceVim-layers-leaderf|
|
104. language server protocol......................|SpaceVim-layers-lsp|
|
||||||
105. operator.................................|SpaceVim-layers-operator|
|
105. leaderf...................................|SpaceVim-layers-leaderf|
|
||||||
106. shell.......................................|SpaceVim-layers-shell|
|
106. operator.................................|SpaceVim-layers-operator|
|
||||||
107. test.........................................|SpaceVim-layers-test|
|
107. shell.......................................|SpaceVim-layers-shell|
|
||||||
108. tmux.........................................|SpaceVim-layers-tmux|
|
108. test.........................................|SpaceVim-layers-test|
|
||||||
109. tools#dash.............................|SpaceVim-layers-tools-dash|
|
109. tmux.........................................|SpaceVim-layers-tmux|
|
||||||
110. tools#zeal.............................|SpaceVim-layers-tools-zeal|
|
110. tools#dash.............................|SpaceVim-layers-tools-dash|
|
||||||
111. ui.............................................|SpaceVim-layers-ui|
|
111. tools#zeal.............................|SpaceVim-layers-tools-zeal|
|
||||||
112. unite.......................................|SpaceVim-layers-unite|
|
112. ui.............................................|SpaceVim-layers-ui|
|
||||||
|
113. unite.......................................|SpaceVim-layers-unite|
|
||||||
7. Usage....................................................|SpaceVim-usage|
|
7. Usage....................................................|SpaceVim-usage|
|
||||||
1. buffers-and-files..................|SpaceVim-usage-buffers-and-files|
|
1. buffers-and-files..................|SpaceVim-usage-buffers-and-files|
|
||||||
2. custom_plugins........................|SpaceVim-usage-custom_plugins|
|
2. custom_plugins........................|SpaceVim-usage-custom_plugins|
|
||||||
@ -4193,6 +4194,33 @@ KEY BINDINGS
|
|||||||
<
|
<
|
||||||
|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
LANG#VIM *SpaceVim-layers-lang-vim*
|
||||||
|
|
||||||
|
This layer is for vim script development, disabled by default, to enable this
|
||||||
|
layer, add following snippet to your SpaceVim configuration file.
|
||||||
|
>
|
||||||
|
[[layers]]
|
||||||
|
name = 'lang#vim'
|
||||||
|
<
|
||||||
|
|
||||||
|
The `checkers` layer provides syntax linter for vim. you need to install the
|
||||||
|
`vint` command:
|
||||||
|
>
|
||||||
|
pip install vim-vint
|
||||||
|
<
|
||||||
|
|
||||||
|
KEY BINDINGS
|
||||||
|
|
||||||
|
The following key bindings will be added when this layer is loaded:
|
||||||
|
>
|
||||||
|
key binding Description
|
||||||
|
SPC l e eval cursor expr
|
||||||
|
SPC l v run HelpfulVersion cword
|
||||||
|
SPC l f open exception trace
|
||||||
|
g d jump to definition
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
LANG#VUE *SpaceVim-layers-lang-vue*
|
LANG#VUE *SpaceVim-layers-lang-vue*
|
||||||
|
|
||||||
@ -4203,7 +4231,7 @@ add following snippet to your SpaceVim configuration file.
|
|||||||
name = 'lang#vue'
|
name = 'lang#vue'
|
||||||
<
|
<
|
||||||
|
|
||||||
The |checkers| layer provides syntax linter for vue. you need to install the
|
The `checkers` layer provides syntax linter for vue. you need to install the
|
||||||
`eslint` and `eslint-plugin-vue`:
|
`eslint` and `eslint-plugin-vue`:
|
||||||
>
|
>
|
||||||
npm install -g eslint eslint-plugin-vue
|
npm install -g eslint eslint-plugin-vue
|
||||||
|
Loading…
Reference in New Issue
Block a user