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

Fix sv/sg in vimfiler (#1544)

This commit is contained in:
Wang Shidong 2018-03-24 07:50:18 -05:00 committed by GitHub
parent 07015b5fec
commit 3870759a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,8 +81,8 @@ function! s:vimfilerinit()
nnoremap <silent><buffer> gr :<C-u>Denite grep:<C-R>=<SID>selected()<CR> -buffer-name=grep<CR>
nnoremap <silent><buffer> gf :<C-u>Denite file_rec:<C-R>=<SID>selected()<CR><CR>
nnoremap <silent><buffer> gd :<C-u>call <SID>change_vim_current_dir()<CR>
nnoremap <silent><buffer><expr> sg vimfiler#do_action('vsplit')
nnoremap <silent><buffer><expr> sv vimfiler#do_action('split')
nnoremap <silent><buffer> sg :<C-u>call <SID>vimfiler_vsplit()<CR>
nnoremap <silent><buffer> sv :<C-u>call <SID>vimfiler_split()<CR>
nnoremap <silent><buffer><expr> st vimfiler#do_action('tabswitch')
nnoremap <silent><buffer> yY :<C-u>call <SID>copy_to_system_clipboard()<CR>
nnoremap <silent><buffer> P :<C-u>call <SID>paste_to_file_manager()<CR>
@ -98,6 +98,29 @@ function! s:vimfilerinit()
nmap <buffer> <Right> <Plug>(vimfiler_smart_l)
endf
function! s:vimfiler_vsplit() abort
let path = vimfiler#get_filename()
if !isdirectory(path)
wincmd w
exe 'vsplit' path
else
echohl ModeMsg
echo path . ' is a directory!'
echohl NONE
endif
endfunction
function! s:vimfiler_split() abort
let path = vimfiler#get_filename()
if !isdirectory(path)
wincmd w
exe 'split' path
else
echohl ModeMsg
echo path . ' is a directory!'
echohl NONE
endif
endfunction
function! s:paste_to_file_manager() abort
let path = vimfiler#get_filename()
if !isdirectory(path)