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
d25ee907
Commit
d25ee907
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
syntax/magit.vim: add some color in Info section
parent
b971b18f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/magit_common.vim
+6
-0
6 additions, 0 deletions
common/magit_common.vim
plugin/magit.vim
+3
-3
3 additions, 3 deletions
plugin/magit.vim
syntax/magit.vim
+16
-0
16 additions, 0 deletions
syntax/magit.vim
with
25 additions
and
3 deletions
common/magit_common.vim
+
6
−
0
View file @
d25ee907
...
...
@@ -10,6 +10,12 @@ let g:magit_sections = {
\
'stash'
:
'Stash list'
\
}
let
g:magit_section_info
=
{
\
'cur_repo'
:
'Current repository'
,
\
'cur_branch'
:
'Current branch'
,
\
'cur_commit'
:
'Last commit'
,
\
}
let
g:magit_git_status_code
=
{
\
'M'
:
'modified'
,
\
'A'
:
'added'
,
...
...
This diff is collapsed.
Click to expand it.
plugin/magit.vim
+
3
−
3
View file @
d25ee907
...
...
@@ -119,9 +119,9 @@ function! s:mg_get_info()
silent
put
=
''
let
branch
=
magit#utils#
system
(
"git rev-parse --abbrev-ref HEAD"
)
let
commit
=
magit#utils#
system
(
"git show -s --oneline"
)
silent
put
=
'Current repository
: '
.
magit#git#top_dir
()
silent
put
=
'Current
branch: '
.
branch
silent
put
=
'Last
commit: '
.
commit
silent
put
=
g:magit_section_info
.
cur_repo
.
'
: '
.
magit#git#top_dir
()
silent
put
=
g:magit_section_info
.
cur_
branch
.
'
: '
.
branch
silent
put
=
g:magit_section_info
.
cur_
commit
.
'
: '
.
commit
silent
put
=
''
silent
put
=
'Press h to display help'
endfunction
...
...
This diff is collapsed.
Click to expand it.
syntax/magit.vim
+
16
−
0
View file @
d25ee907
...
...
@@ -36,4 +36,20 @@ execute 'syn region gitHunk start=/' .
\
g:magit_hunk_re
.
'/ end=/\%('
.
g:magit_end_diff_re
.
'\|'
.
g:magit_hunk_re
\
'\)\@=/ contains=@diff fold'
execute
'syn region gitInfo start=/^'
.
g:magit_sections
.
info
.
'$/ end=/'
.
\
g:magit_section_re
.
'/'
execute
'syn region gitInfoRepo start=/^'
.
g:magit_section_info
.
cur_repo
.
\
':\s*.*/hs=s+20 end=/$/ oneline'
highlight
default link gitInfoRepo Directory
execute
'syn region gitInfoBranch start=/^'
.
g:magit_section_info
.
cur_branch
.
\
':\s*.*/hs=s+20 end=/$/ oneline'
highlight
default link gitInfoBranch Identifier
execute
'syn region gitInfoCommit start=/^'
.
g:magit_section_info
.
cur_commit
.
\
':\s*\(.*\)/ end=/$/ contains=infoSha1 oneline'
syntax
match
infoSha1 containedin
=
gitInfoCommit
"\x\{7}"
highlight
default link infoSha1 Identifier
let
b:current_syntax
=
"magit"
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