Skip to content

Commit 414898f

Browse files
committed
reintegrate: add vim syntax highlighting
This will still involve some hoop-jumping to install, since Homebrew isn't really supposed to be used to add local Vim extensions. AFAICT, Vim doesn't have any patches under Homebrew that tell it to look for system-wide configurations under /usr/local/etc, so we can't just install things there (unlike bash_completion or zsh_completion). Instead, the idea at this point is to basically take the same approach as https://github.com/junegunn/fzf, where the brew formula has a caveat telling you how to add a custom path to Vim's runtimepath variable. All that means for this repo is that we have to make sure to bundle the vim syntax files in the release tarball. So besides the vim source itself, just have to amend the (ghetto) build script a little bit. Fixes #2.
1 parent 057e4d8 commit 414898f

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

build

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/usr/bin/env bash
22

3+
FILES=(
4+
LICENSE
5+
README.md
6+
RATIONALE.md
7+
completions
8+
libexec
9+
man
10+
vim
11+
)
12+
313
VERSION="$(git tag --sort=version:refname | tail -1 | sed 's/^v//')"
414
test -n "$VERSION" || VERSION="0.0.1"
515

@@ -30,9 +40,7 @@ echo >&2 "Generating $build..."
3040
if ! test -d builds; then
3141
mkdir builds
3242
fi
33-
tar -cvzf "$build" LICENSE README.md RATIONALE.md completions libexec man 2> >(
34-
sed 's/^/ /'
35-
)
43+
tar -cvzf "$build" "${FILES[@]}" 2> >(sed 's/^/ /')
3644

3745
echo >&2
3846
echo >&2 "Generated $build"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
autocmd BufNewFile,BufRead *.git/git-topics-reintegrate/todo.new
2+
\ setfiletype git-topics-reintegrate
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
" Vim syntax file
2+
" Language: git topics reintegrate
3+
" Maintainer: Alex Vondrak (https://github.com/ajvondrak)
4+
" Repository: https://github.com/ajvondrak/git-topics
5+
"
6+
" Based on the git rebase --interactive highlighting by Tim Pope:
7+
" https://github.com/vim/vim/blob/89bcfda/runtime/syntax/gitrebase.vim
8+
9+
if exists("b:current_syntax")
10+
finish
11+
endif
12+
13+
syn case match
14+
15+
syn match reintegratePick "\v^p%(ick)=>" nextgroup=reintegrateTopic skipwhite
16+
syn match reintegrateDrop "\v^d%(rop)=>" nextgroup=reintegrateTopic skipwhite
17+
syn match reintegrateTopic ".*" contained
18+
syn match reintegrateComment "^#.*"
19+
20+
hi def link reintegratePick Statement
21+
hi def link reintegrateDrop Comment
22+
hi def link reintegrateTopic Identifier
23+
hi def link reintegrateComment Comment
24+
25+
let b:current_syntax = "git-topics-reintegrate"

0 commit comments

Comments
 (0)