Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Moritz Sokoll
vim-git-control
Commits
f1aac525
Commit
f1aac525
authored
May 25, 2021
by
Moritz Sokoll
🦀
Browse files
added branch command and log command
parent
df00fad5
Changes
1
Show whitespace changes
Inline
Side-by-side
git-control.vim
View file @
f1aac525
...
@@ -37,17 +37,36 @@ function! Git_Checkout()
...
@@ -37,17 +37,36 @@ function! Git_Checkout()
elseif
matchstr
(
branch_name
,
' '
)
==
' '
elseif
matchstr
(
branch_name
,
' '
)
==
' '
echo
'branch names cannot have spaces in them'
echo
'branch names cannot have spaces in them'
else
else
let
stat
=
system
(
'git checkout
-b
'
.
branch_name
)
let
stat
=
system
(
'git checkout '
.
branch_name
)
echo stat
echo stat
endif
endif
endfunction
endfunction
function
!
Git_Branch
()
echo
system
(
'git branch --list'
)
let
branch_name
=
input
(
'new branch name: '
)
echo
''
if
len
(
branch_name
)
<
1
echo
'name too short'
elseif
matchstr
(
branch_name
,
' '
)
==
' '
echo
'branch name does not allow spaces'
else
echo
system
(
'git branch '
.
branch_name
)
endif
endfunction
function
!
Git_Status
()
function
!
Git_Status
()
echo
system
(
'git status'
)
echo
system
(
'git status'
)
endfunction
endfunction
function
!
Git_Log
()
echo
system
(
'git --no-pager log --pretty=oneline --graph'
)
endfunction
command
!
GitCommit
call
Git_Commit
()
command
!
GitCommit
call
Git_Commit
()
command
!
GitPush
call
Git_Push
()
command
!
GitPush
call
Git_Push
()
command
!
GitCheckout
call
Git_Checkout
()
command
!
GitCheckout
call
Git_Checkout
()
command
!
GitStatus
call
Git_Status
()
command
!
GitStatus
call
Git_Status
()
command
!
GitBranch
call
Git_Branch
()
command
!
GitLog
call
Git_Log
()
let
g:git_control_loaded
=
1
let
g:git_control_loaded
=
1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment