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
ad95ede2
Commit
ad95ede2
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
plugin/magit.vim: dirty WIP for new display (horizontal lines)
parent
2bbe9d98
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
plugin/magit.vim
+29
-8
29 additions, 8 deletions
plugin/magit.vim
syntax/magit.vim
+11
-1
11 additions, 1 deletion
syntax/magit.vim
with
40 additions
and
9 deletions
plugin/magit.vim
+
29
−
8
View file @
ad95ede2
...
@@ -115,10 +115,15 @@ endfunction
...
@@ -115,10 +115,15 @@ endfunction
function
!
s:mg_get_info
()
function
!
s:mg_get_info
()
silent
put
=
''
silent
put
=
''
silent
put
=
g:magit_sections
.
info
silent
put
=
g:magit_sections
.
info
silent
put
=
magit#utils#
underline
(
g:magit_sections
.
info
)
silent
put
=
''
silent
put
=
''
let
branch
=
magit#utils#
system
(
"git rev-parse --abbrev-ref HEAD"
)
let
linenum
=
line
(
'.'
)
let
commit
=
magit#utils#
system
(
"git show -s --oneline"
)
let
bufnr
=
magit#utils#
bufnr
()
execute
printf
(
\
'sign place %d line=%d name=GitaPseudoSeparatorSign buffer=%d'
,
\
linenum
,
linenum
,
bufnr
,
\
)
let
branch
=
magit#git#current_branch
()
let
commit
=
magit#git#last_commit
()
silent
put
=
g:magit_section_info
.
cur_repo
.
': '
.
magit#git#top_dir
()
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_branch
.
': '
.
branch
silent
put
=
g:magit_section_info
.
cur_commit
.
': '
.
commit
silent
put
=
g:magit_section_info
.
cur_commit
.
': '
.
commit
...
@@ -139,6 +144,7 @@ endfunction
...
@@ -139,6 +144,7 @@ endfunction
" directory)
" directory)
function
!
s:mg_display_files
(
mode
,
curdir
,
depth
)
function
!
s:mg_display_files
(
mode
,
curdir
,
depth
)
let
bufnr
=
magit#utils#
bufnr
()
" FIXME: ouch, must store subdirs in more efficient way
" FIXME: ouch, must store subdirs in more efficient way
for
filename
in
b:state
.
get_filenames
(
a:mode
)
for
filename
in
b:state
.
get_filenames
(
a:mode
)
let
file
=
b:state
.
get_file
(
a:mode
,
filename
,
0
)
let
file
=
b:state
.
get_file
(
a:mode
,
filename
,
0
)
...
@@ -182,9 +188,14 @@ endfunction
...
@@ -182,9 +188,14 @@ endfunction
function
!
s:mg_get_staged_section
(
mode
)
function
!
s:mg_get_staged_section
(
mode
)
put
=
''
put
=
''
put
=
g:magit_sections
[
a:mode
]
put
=
g:magit_sections
[
a:mode
]
call
<
SID
>
mg_section_help
(
a:mode
)
put
=
magit#utils#
underline
(
g:magit_sections
[
a:mode
])
put
=
''
put
=
''
let
linenum
=
line
(
'.'
)
let
bufnr
=
magit#utils#
bufnr
()
execute
printf
(
\
'sign place %d line=%d name=GitaPseudoSeparatorSign buffer=%d'
,
\
linenum
,
linenum
,
bufnr
,
\
)
call
<
SID
>
mg_section_help
(
a:mode
)
call
s:mg_display_files
(
a:mode
,
''
,
0
)
call
s:mg_display_files
(
a:mode
,
''
,
0
)
endfunction
endfunction
...
@@ -200,8 +211,13 @@ function! s:mg_get_stashes()
...
@@ -200,8 +211,13 @@ function! s:mg_get_stashes()
if
(!
empty
(
stash_list
))
if
(!
empty
(
stash_list
))
silent
put
=
''
silent
put
=
''
silent
put
=
g:magit_sections
.
stash
silent
put
=
g:magit_sections
.
stash
silent
put
=
magit#utils#
underline
(
g:magit_sections
.
stash
)
silent
put
=
''
silent
put
=
''
let
linenum
=
line
(
'.'
)
let
bufnr
=
magit#utils#
bufnr
()
execute
printf
(
\
'sign place %d line=%d name=GitaPseudoSeparatorSign buffer=%d'
,
\
linenum
,
linenum
,
bufnr
,
\
)
for
stash
in
stash_list
for
stash
in
stash_list
let
stash_id
=
substitute
(
stash
,
'^\(stash@{\d\+}\):.*$'
,
'\1'
,
''
)
let
stash_id
=
substitute
(
stash
,
'^\(stash@{\d\+}\):.*$'
,
'\1'
,
''
)
...
@@ -223,9 +239,14 @@ function! s:mg_get_commit_section()
...
@@ -223,9 +239,14 @@ function! s:mg_get_commit_section()
if
(
b:magit_current_commit_mode
!=
''
)
if
(
b:magit_current_commit_mode
!=
''
)
silent
put
=
''
silent
put
=
''
silent
put
=
g:magit_sections
.
commit_start
silent
put
=
g:magit_sections
.
commit_start
call
<
SID
>
mg_section_help
(
'commit'
)
silent
put
=
magit#utils#
underline
(
g:magit_sections
.
commit_start
)
silent
put
=
''
silent
put
=
''
let
linenum
=
line
(
'.'
)
let
bufnr
=
magit#utils#
bufnr
()
execute
printf
(
\
'sign place %d line=%d name=GitaPseudoSeparatorSign buffer=%d'
,
\
linenum
,
linenum
,
bufnr
,
\
)
call
<
SID
>
mg_section_help
(
'commit'
)
let
git_dir
=
magit#git#git_dir
()
let
git_dir
=
magit#git#git_dir
()
" refresh the COMMIT_EDITMSG file
" refresh the COMMIT_EDITMSG file
...
...
This diff is collapsed.
Click to expand it.
syntax/magit.vim
+
11
−
1
View file @
ad95ede2
...
@@ -4,12 +4,22 @@ endif
...
@@ -4,12 +4,22 @@ endif
execute
'source '
.
resolve
(
expand
(
'<sfile>:p:h'
))
.
'/../common/magit_common.vim'
execute
'source '
.
resolve
(
expand
(
'<sfile>:p:h'
))
.
'/../common/magit_common.vim'
highlight
GitaPseudoSeparatorDefault
\
term
=
undercurl
\
cterm
=
underline
ctermfg
=
8
\
gui
=
underline
guifg
=
#363636
sign
define
GitaPseudoSeparatorSign
\
texthl
=
SignColumn
\
linehl
=
GitaPseudoSeparator
highlight
default link GitaPseudoSeparator GitaPseudoSeparatorDefault
syn
case
match
syn
case
match
syn
sync
minlines
=
50
syn
sync
minlines
=
50
syn
include
@
diff
syntax
/
diff
.
vim
syn
include
@
diff
syntax
/
diff
.
vim
execute
'syn match titleEntry "'
.
g:magit_section_re
.
'\n
=\+
"'
execute
'syn match titleEntry "'
.
g:magit_section_re
.
'\n
$
"'
hi
def
link titleEntry Comment
hi
def
link titleEntry Comment
execute
'syn match stashEntry "'
.
g:magit_stash_re
.
'"'
execute
'syn match stashEntry "'
.
g:magit_stash_re
.
'"'
...
...
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