1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:40:05 +08:00

Add help desc

This commit is contained in:
wsdjeg 2017-08-26 21:45:38 +08:00
parent f33fbfd391
commit 4005a767dc
3 changed files with 140 additions and 106 deletions

View File

@ -2,12 +2,15 @@
" @section Default, default " @section Default, default
" @parentsection layers " @parentsection layers
let s:filename = expand('<sfile>:~')
function! SpaceVim#layers#default#plugins() abort function! SpaceVim#layers#default#plugins() abort
let plugins = [] let plugins = []
return plugins return plugins
endfunction endfunction
let s:lnum = expand('<slnum>') + 3
function! SpaceVim#layers#default#config() abort function! SpaceVim#layers#default#config() abort
" Unimpaired bindings " Unimpaired bindings
" Quickly add empty lines " Quickly add empty lines
@ -47,7 +50,20 @@ function! SpaceVim#layers#default#config() abort
" Select last paste " Select last paste
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]' nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
call SpaceVim#mapping#space#def('nnoremap', ['f', 'f'], "exe 'CtrlP ' . fnamemodify(bufname('%'), ':h')", 'Find files in the directory of the current buffer', 1) let lnum = expand('<slnum>') + s:lnum - 1
call SpaceVim#mapping#space#def('nnoremap', ['f', 'f'],
\ "exe 'CtrlP ' . fnamemodify(bufname('%'), ':h')",
\ ['Find files in the directory of the current buffer',
\ [
\ '[SPC f f] is to find files in the directory of the current buffer',
\ 'vim with +python3 support will use denite',
\ 'vim with +python support will use leaderf',
\ 'otherwise will use ctrlp',
\ '',
\ 'Definition: ' . s:filename . ':' . lnum,
\ ]
\ ]
\ , 1)
call SpaceVim#mapping#space#def('nnoremap', ['f', 's'], 'write', 'save buffer', 1) call SpaceVim#mapping#space#def('nnoremap', ['f', 's'], 'write', 'save buffer', 1)
call SpaceVim#mapping#space#def('nnoremap', ['f', 'S'], 'wall', 'save all buffer', 1) call SpaceVim#mapping#space#def('nnoremap', ['f', 'S'], 'wall', 'save all buffer', 1)
call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1) call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1)

View File

@ -1,3 +1,4 @@
let s:file = expand('<sfile>:~')
function! SpaceVim#mapping#space#init() abort function! SpaceVim#mapping#space#init() abort
if s:has_map_to_spc() if s:has_map_to_spc()
return return
@ -63,19 +64,28 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['w', 'W'], 'ChooseWin', 'select window', 1) call SpaceVim#mapping#space#def('nnoremap', ['w', 'W'], 'ChooseWin', 'select window', 1)
call SpaceVim#mapping#space#def('nnoremap', ['w', 'u'], 'call SpaceVim#plugins#windowsmanager#UndoQuitWin()', 'undo quieted window', 1) call SpaceVim#mapping#space#def('nnoremap', ['w', 'u'], 'call SpaceVim#plugins#windowsmanager#UndoQuitWin()', 'undo quieted window', 1)
call SpaceVim#mapping#space#def('nnoremap', ['w', 'U'], 'call SpaceVim#plugins#windowsmanager#RedoQuitWin()', 'redo quieted window', 1) call SpaceVim#mapping#space#def('nnoremap', ['w', 'U'], 'call SpaceVim#plugins#windowsmanager#RedoQuitWin()', 'redo quieted window', 1)
nnoremap <silent> [SPC]bn :bnext<CR> let s:lnum = expand('<slnum>') + 3
let g:_spacevim_mappings_space.b.n = ['bnext', 'next buffer', call SpaceVim#mapping#space#def('nnoremap', ['b', 'n'], 'bnext', ['next buffer',
\ [ \ [
\ 'SPC b n is running :bnext, jump to next buffer', \ '[SPC b n] is running :bnext, jump to next buffer',
\ 'which is a vim build in command', \ 'which is a vim build in command',
\ 'It is bound to SPC b n, ] b,', \ 'It is bound to SPC b n, ] b,',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ] \ ]
\ ] \ ]
call SpaceVim#mapping#menu('Open next buffer', '[SPC]bn', 'bp') \ , 1)
nnoremap <silent> [SPC]bp :bp<CR> let s:lnum = expand('<slnum>') + 3
let g:_spacevim_mappings_space.b.p = ['bp', 'previous buffer'] call SpaceVim#mapping#space#def('nnoremap', ['b', 'p'], 'bp', ['previous buffer',
call SpaceVim#mapping#menu('Open previous buffer', '[SPC]bp', 'bp') \ [
\ 'SPC b p is running :bp, jump to previous buffer',
\ 'which is a vim build in command',
\ 'It is bound to SPC b p, [ b,',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ]
\ , 1)
" "
" Comments sections " Comments sections
" "

8
syntax/HelpDescribe.vim Normal file
View File

@ -0,0 +1,8 @@
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "HelpDescribe"
syntax case ignore
syn match FileName /[^:]*:\d\+:/
hi def link FileName Comment