1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 10:50:05 +08:00

Merge pull request #798 from SpaceVim/file_founder

Add help desc
This commit is contained in:
Wang Shidong 2017-08-26 15:30:24 +08:00 committed by GitHub
commit 526e3fd8b8
3 changed files with 147 additions and 106 deletions

View File

@ -2,12 +2,15 @@
" @section Default, default
" @parentsection layers
let s:filename = expand('<sfile>:~')
function! SpaceVim#layers#default#plugins() abort
let plugins = []
return plugins
endfunction
let s:lnum = expand('<slnum>') + 3
function! SpaceVim#layers#default#config() abort
" Unimpaired bindings
" Quickly add empty lines
@ -47,7 +50,27 @@ function! SpaceVim#layers#default#config() abort
" Select last paste
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
if has('python3')
let cmd = 'DeniteBufferDir file_rec'
elseif has('python')
let cmd = "exe 'LeaderfFile ' . fnamemodify(bufname('%'), ':h')"
else
let cmd = "exe 'CtrlP ' . fnamemodify(bufname('%'), ':h')"
endif
call SpaceVim#mapping#space#def('nnoremap', ['f', 'f'],
\ cmd,
\ ['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'], 'wall', 'save all buffer', 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
if s:has_map_to_spc()
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', '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)
nnoremap <silent> [SPC]bn :bnext<CR>
let g:_spacevim_mappings_space.b.n = ['bnext', 'next buffer',
let s:lnum = expand('<slnum>') + 3
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',
\ 'It is bound to SPC b n, ] b,',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ]
call SpaceVim#mapping#menu('Open next buffer', '[SPC]bn', 'bp')
nnoremap <silent> [SPC]bp :bp<CR>
let g:_spacevim_mappings_space.b.p = ['bp', 'previous buffer']
call SpaceVim#mapping#menu('Open previous buffer', '[SPC]bp', 'bp')
\ , 1)
let s:lnum = expand('<slnum>') + 3
call SpaceVim#mapping#space#def('nnoremap', ['b', 'p'], 'bp', ['previous buffer',
\ [
\ '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
"

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