Skip to content

Commit

Permalink
reintegrate: add vim syntax highlighting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ajvondrak committed Nov 29, 2018
1 parent 057e4d8 commit 414898f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env bash

FILES=(
LICENSE
README.md
RATIONALE.md
completions
libexec
man
vim
)

VERSION="$(git tag --sort=version:refname | tail -1 | sed 's/^v//')"
test -n "$VERSION" || VERSION="0.0.1"

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

echo >&2
echo >&2 "Generated $build"
Expand Down
2 changes: 2 additions & 0 deletions vim/ftdetect/git-topics-reintegrate.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
autocmd BufNewFile,BufRead *.git/git-topics-reintegrate/todo.new
\ setfiletype git-topics-reintegrate
25 changes: 25 additions & 0 deletions vim/syntax/git-topics-reintegrate.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
" Vim syntax file
" Language: git topics reintegrate
" Maintainer: Alex Vondrak (https://github.com/ajvondrak)
" Repository: https://github.com/ajvondrak/git-topics
"
" Based on the git rebase --interactive highlighting by Tim Pope:
" https://github.com/vim/vim/blob/89bcfda/runtime/syntax/gitrebase.vim

if exists("b:current_syntax")
finish
endif

syn case match

syn match reintegratePick "\v^p%(ick)=>" nextgroup=reintegrateTopic skipwhite
syn match reintegrateDrop "\v^d%(rop)=>" nextgroup=reintegrateTopic skipwhite
syn match reintegrateTopic ".*" contained
syn match reintegrateComment "^#.*"

hi def link reintegratePick Statement
hi def link reintegrateDrop Comment
hi def link reintegrateTopic Identifier
hi def link reintegrateComment Comment

let b:current_syntax = "git-topics-reintegrate"

0 comments on commit 414898f

Please sign in to comment.