Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vimagit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
c79bc44a
Commit
c79bc44a
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
plugin/magit.vim: add info section (fix #6)
parent
e283a7b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/magit_common.vim
+1
-0
1 addition, 0 deletions
common/magit_common.vim
plugin/magit.vim
+16
-0
16 additions, 0 deletions
plugin/magit.vim
with
17 additions
and
0 deletions
common/magit_common.vim
+
1
−
0
View file @
c79bc44a
...
...
@@ -2,6 +2,7 @@
" These are used to beautify the magit buffer and to help for some block
" selection
let
g:magit_sections
=
{
\
'info'
:
'Info'
,
\
'staged'
:
'Staged changes'
,
\
'unstaged'
:
'Unstaged changes'
,
\
'commit_start'
:
'Commit message'
,
...
...
This diff is collapsed.
Click to expand it.
plugin/magit.vim
+
16
−
0
View file @
c79bc44a
...
...
@@ -275,6 +275,21 @@ function! s:mg_section_help(section)
endif
endfunction
" s:mg_get_info: this function writes in current buffer current git state
" WARNING: this function writes in file, it should only be called through
" protected functions like magit#update_buffer
function
!
s:mg_get_info
()
silent
put
=
''
silent
put
=
g:magit_sections
[
'info'
]
silent
put
=<
SID
>
mg_underline
(
g:magit_sections
[
'info'
])
silent
put
=
''
let
branch
=<
SID
>
mg_system
(
"git rev-parse --abbrev-ref HEAD"
)
let
commit
=<
SID
>
mg_system
(
"git show -s --oneline"
)
silent
put
=
'Current branch: '
.
branch
silent
put
=
'Last commit: '
.
commit
silent
put
=
''
endfunction
" s:mg_get_staged: this function writes in current buffer all staged files
" WARNING: this function writes in file, it should only be called through
" protected functions like magit#update_buffer
...
...
@@ -589,6 +604,7 @@ function! magit#update_buffer()
let
l
:
winview
=
winsaveview
()
silent
!
%
d
call
<
SID
>
mg_get_info
()
call
<
SID
>
mg_section_help
(
'global'
)
if
(
s:magit_commit_mode
!=
''
)
call
<
SID
>
mg_get_commit_section
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment