mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-12 17:55:41 +08:00
Fix shell config
This commit is contained in:
parent
243fc98c6d
commit
a5f349096f
@ -44,6 +44,9 @@ function! SpaceVim#layers#core#config() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['q', 'r'], '', 'restart-vim-resume-layouts(TODO)', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['q', 't'], 'tabclose!', 'kill current tab', 1)
|
||||
call SpaceVim#mapping#gd#add('HelpDescribe', function('s:gotodef'))
|
||||
" project manager
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['p', '!'], 'Grepper', 'fuzzy search for text in current project', 1)
|
||||
|
||||
endfunction
|
||||
|
||||
function! s:gotodef() abort
|
||||
|
@ -82,7 +82,10 @@ endfunction
|
||||
function! SpaceVim#layers#unite#config() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['!'], 'call call('
|
||||
\ . string(s:_function('s:run_shell_cmd')) . ', [])',
|
||||
\ 'shell cmd', 1)
|
||||
\ 'shell cmd(current dir)', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['p', '!'], 'call call('
|
||||
\ . string(s:_function('s:run_shell_cmd_project')) . ', [])',
|
||||
\ 'shell cmd(project root)', 1)
|
||||
endfunction
|
||||
|
||||
function! s:run_shell_cmd() abort
|
||||
@ -92,6 +95,18 @@ function! s:run_shell_cmd() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:run_shell_cmd_project() abort
|
||||
let cmd = input('Please input shell command:', '', 'customlist,SpaceVim#plugins#bashcomplete#complete')
|
||||
if !empty(cmd)
|
||||
call unite#start([['output/shellcmd', cmd]], {
|
||||
\ 'log': 1,
|
||||
\ 'wrap': 1,
|
||||
\ 'start_insert':0,
|
||||
\ 'cwd' : SpaceVim#plugins#projectmanager#current_root(),
|
||||
\ })
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" function() wrapper
|
||||
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||
function! s:_function(fstr) abort
|
||||
|
@ -32,6 +32,14 @@ function! SpaceVim#plugins#projectmanager#current_()
|
||||
return get(b:, '_spacevim_project_name', '')
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#plugins#projectmanager#current_root() abort
|
||||
try
|
||||
Rooter
|
||||
catch
|
||||
endtry
|
||||
return getcwd()
|
||||
endfunction
|
||||
|
||||
let s:BUFFER = SpaceVim#api#import('vim#buffer')
|
||||
|
||||
function! SpaceVim#plugins#projectmanager#kill_project() abort
|
||||
|
Loading…
x
Reference in New Issue
Block a user