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

feat(git): add git_diff_position option

close https://github.com/SpaceVim/SpaceVim/issues/3360
This commit is contained in:
wsdjeg 2022-03-22 12:24:19 +08:00
parent 27c0f5585c
commit 592e0ec9ef
3 changed files with 16 additions and 1 deletions

View File

@ -22,6 +22,13 @@
" name = 'git'
" git_plugin = 'git'
" <
" `git_diff_position`: set the default command to split diff windows, by
" default it is `10split`. Example:
" >
" [[layers]]
" name = 'git'
" git_diff_position = 'vsplit'
" <
" @subsection Key bindings
"
" The following key bindings will be definded when the `git` layer is loaded.
@ -152,6 +159,7 @@ function! SpaceVim#layers#git#set_variable(var) abort
\ get(a:var,
\ 'git-plugin',
\ s:git_plugin))
let g:git_diff_position = get(a:var, 'git_diff_position', '10split')
endfunction

View File

@ -40,7 +40,7 @@ endfunction
function! s:openDiffBuffer() abort
10split git://diff
exe printf('%s git://diff', get(g:, 'git_diff_position', '10split'))
normal! "_dd
setl nobuflisted
setl nomodifiable

View File

@ -1938,6 +1938,13 @@ is `git`, the following plugins are supported: `gina`, `fugitive` and `gita`.
name = 'git'
git_plugin = 'git'
<
`git_diff_position`: set the default command to split diff windows, by default
it is `10split`. Example:
>
[[layers]]
name = 'git'
git_diff_position = 'vsplit'
<
KEY BINDINGS
The following key bindings will be definded when the `git` layer is loaded.