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
df00fad5
Commit
df00fad5
authored
May 24, 2021
by
Moritz Sokoll
🦀
Browse files
added status command
parent
4148a6c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
df00fad5
...
...
@@ -5,7 +5,8 @@
preferred use is with
[
plugin-manager
](
https://gitlab.sokoll.com/moritz/vim-plugin-manager
)
. Just download the
`git-control.vim`
and move it into
`~/.vim/plugins`
. Then add the plugin to your plugins list.
## Usage
`vim-git-control`
comes with
three
commands:
`vim-git-control`
comes with
a few
commands:
-
`:GitCommit`
: prompts the user for a commit message and commits
-
`:GitPush`
: p
ushe
s the
current branch
-
`:GitPush`
: p
rompt
s the
user for a remote (defaults to origin) and pushes to that remote
-
`:GitCheckout`
: prompts the use for a branch to checkout to and creates it if it's not existing
-
`:GitStatus`
: shows the git repository status
git-control.vim
View file @
df00fad5
...
...
@@ -18,8 +18,15 @@ function! Git_Commit()
endfunction
function
!
Git_Push
()
let
stat
=
system
(
'git push'
)
echo stat
let
remote
=
input
(
'remote (default is origin): '
)
echo
''
if
len
(
remote
)
==
0
let
remote
=
'origin'
elseif
matchstr
(
remote
,
' '
)
==
' '
echo
'remote name cannot have a space in it'
return
endif
echo
system
(
'git push '
.
remote
)
endfunction
function
!
Git_Checkout
()
...
...
@@ -35,7 +42,12 @@ function! Git_Checkout()
endif
endfunction
function
!
Git_Status
()
echo
system
(
'git status'
)
endfunction
command
!
GitCommit
call
Git_Commit
()
command
!
GitPush
call
Git_Push
()
command
!
GitCheckout
call
Git_Checkout
()
command
!
GitStatus
call
Git_Status
()
let
g:git_control_loaded
=
1
Write
Preview
Markdown
is supported
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