mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +08:00
Clear langSPC on BufLeave
This commit is contained in:
parent
84eb522f3d
commit
28f6bedcf2
@ -10,6 +10,7 @@
|
|||||||
function! SpaceVim#autocmds#init() abort
|
function! SpaceVim#autocmds#init() abort
|
||||||
augroup SpaceVim_core
|
augroup SpaceVim_core
|
||||||
au!
|
au!
|
||||||
|
autocmd BufLeave * let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'}
|
||||||
autocmd BufWinEnter quickfix nnoremap <silent> <buffer>
|
autocmd BufWinEnter quickfix nnoremap <silent> <buffer>
|
||||||
\ q :cclose<cr>:lclose<cr>
|
\ q :cclose<cr>:lclose<cr>
|
||||||
autocmd BufEnter * if (winnr('$') == 1 && &buftype ==# 'quickfix' ) |
|
autocmd BufEnter * if (winnr('$') == 1 && &buftype ==# 'quickfix' ) |
|
||||||
|
@ -79,6 +79,7 @@ function! SpaceVim#layers#lang#java#config() abort
|
|||||||
nmap <silent><buffer> <leader>jM <Plug>(JavaComplete-Generate-AbstractMethods)
|
nmap <silent><buffer> <leader>jM <Plug>(JavaComplete-Generate-AbstractMethods)
|
||||||
|
|
||||||
imap <silent><buffer> <C-j>jM <Plug>(JavaComplete-Generate-AbstractMethods)
|
imap <silent><buffer> <C-j>jM <Plug>(JavaComplete-Generate-AbstractMethods)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','M'], '<Plug>(JavaComplete-Generate-AbstractMethods)', 'Generate abstract methods', 0)
|
||||||
|
|
||||||
nmap <silent><buffer> <leader>jA <Plug>(JavaComplete-Generate-Accessors)
|
nmap <silent><buffer> <leader>jA <Plug>(JavaComplete-Generate-Accessors)
|
||||||
nmap <silent><buffer> <leader>js <Plug>(JavaComplete-Generate-AccessorSetter)
|
nmap <silent><buffer> <leader>js <Plug>(JavaComplete-Generate-AccessorSetter)
|
||||||
|
@ -16,6 +16,7 @@ function! SpaceVim#mapping#space#init() abort
|
|||||||
let g:_spacevim_mappings_space.w = {'name' : '+Windows'}
|
let g:_spacevim_mappings_space.w = {'name' : '+Windows'}
|
||||||
let g:_spacevim_mappings_space.p = {'name' : '+Projects'}
|
let g:_spacevim_mappings_space.p = {'name' : '+Projects'}
|
||||||
let g:_spacevim_mappings_space.h = {'name' : '+Help'}
|
let g:_spacevim_mappings_space.h = {'name' : '+Help'}
|
||||||
|
let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'}
|
||||||
" Windows
|
" Windows
|
||||||
let g:_spacevim_mappings_space.w['<Tab>'] = ['wincmd w', 'alternate-window']
|
let g:_spacevim_mappings_space.w['<Tab>'] = ['wincmd w', 'alternate-window']
|
||||||
call SpaceVim#mapping#menu('alternate-window', '[SPC]w<Tab>', 'wincmd w')
|
call SpaceVim#mapping#menu('alternate-window', '[SPC]w<Tab>', 'wincmd w')
|
||||||
@ -110,3 +111,30 @@ function! s:windows_layout_toggle() abort
|
|||||||
wincmd w
|
wincmd w
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
function! SpaceVim#mapping#space#langSPC(m, keys, cmd, desc, is_cmd) abort
|
||||||
|
if s:has_map_to_spc()
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if a:is_cmd
|
||||||
|
let cmd = ':<C-u>' . a:cmd . '<CR>'
|
||||||
|
let lcmd = a:cmd
|
||||||
|
else
|
||||||
|
let cmd = a:cmd
|
||||||
|
let feedkey_m = a:m =~# 'nore' ? 'n' : 'm'
|
||||||
|
if a:cmd =~? '^<plug>'
|
||||||
|
let lcmd = 'call feedkeys("\' . a:cmd . '", "' . feedkey_m . '")'
|
||||||
|
else
|
||||||
|
let lcmd = 'call feedkeys("' . a:cmd . '", "' . feedkey_m . '")'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
exe a:m . ' <silent> <buffer> [SPC]' . join(a:keys, '') . ' ' . substitute(cmd, '|', '\\|', 'g')
|
||||||
|
if len(a:keys) == 2
|
||||||
|
let g:_spacevim_mappings_space[a:keys[0]][a:keys[1]] = [lcmd, a:desc]
|
||||||
|
elseif len(a:keys) == 3
|
||||||
|
let g:_spacevim_mappings_space[a:keys[0]][a:keys[1]][a:keys[2]] = [lcmd, a:desc]
|
||||||
|
elseif len(a:keys) == 1
|
||||||
|
let g:_spacevim_mappings_space[a:keys[0]] = [lcmd, a:desc]
|
||||||
|
endif
|
||||||
|
call SpaceVim#mapping#menu(a:desc, '[SPC]' . join(a:keys, ''), lcmd)
|
||||||
|
call extend(g:_spacevim_mappings_prefixs['[SPC]'], get(g:, '_spacevim_mappings_space', {}))
|
||||||
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user