Skip to content

Commit

Permalink
[vim] delimitMate update
Browse files Browse the repository at this point in the history
  • Loading branch information
guns committed Sep 13, 2013
1 parent af04f23 commit 233aca0
Show file tree
Hide file tree
Showing 15 changed files with 493 additions and 764 deletions.
124 changes: 72 additions & 52 deletions etc/vim/bundle/delimitMate/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,62 +1,82 @@
PLUGIN=$(shell basename "$$PWD") PLUGIN = $(wildcard plugin/*.vim)
SCRIPT=$(wildcard plugin/*.vim) SOURCES = $(PLUGIN)
#AUTOL=$(wildcard autoload/*.vim) LIB = $(wildcard autoload/*.vim)
AUTOL=autoload/$(PLUGIN).vim SOURCES += $(LIB)
DOC=$(wildcard doc/*.txt) DOC = $(wildcard doc/*.txt)
TESTS=$(wildcard autoload/*Tests.vim) SOURCES += $(DOC)
VERSION=$(shell perl -ne 'if (/\*\sCurrent\srelease:/) {s/^\s+(\d+\.\S+)\s.*$$/\1/;print}' $(DOC)) #NAME = $(shell basename "$$PWD")
VIMFOLDER=~/.vim/ NAME = delimitMate
VIM=/usr/bin/vim VERSION = $(shell $(SED) -n -e '/Current \+release/{s/^ \+\([0-9.]\+\).*/\1/;p;}' $(firstword $(DOC)))
FILENAME = $(NAME)-$(VERSION)
DESTDIR = $(HOME)/.vim
VIM = vim
SED = gsed
PERL = perl
comma := ,
empty :=
space := $(empty) $(empty)


.PHONY: $(PLUGIN).vba README .PHONY: version clean distclean undo release test install uninstall


all: vimball README zip gzip all: zip gzip

dist: version all
vimball: $(PLUGIN).vba vimball: $(FILENAME).vmb
zip: $(FILENAME).zip $(FILENAME).vmb.zip
gzip: $(FILENAME).tar.gz $(FILENAME).vmb.gz


clean: clean:
@echo clean rm -f */*.orig *.~* .VimballRecord *.zip *.gz *.vmb
rm -f *.vba */*.orig *.~* .VimballRecord *.zip *.gz


dist-clean: clean distclean: clean
-zsh -c 'setopt extendedglob; rm -f ^(README.md|Makefile)'
-zsh -c 'setopt extendedglob; rm -f .^(git|README.md|Makefile)*'


undo: undo:
for i in */*.orig; do mv -f "$$i" "$${i%.*}"; done for i in */*.orig; do mv -f "$$i" "$${i%.*}"; done


README:
@echo README
cp -f $(DOC) README

$(PLUGIN).vba:
@echo $(PLUGIN).vba
rm -f $(PLUGIN)-$(VERSION).vba
$(VIM) -N -c 'ru! vimballPlugin.vim' -c ':call append("0", [ "$(SCRIPT)", "$(AUTOL)", "$(DOC)"])' -c '$$d' -c ":%MkVimball $(PLUGIN)-$(VERSION) ." -c':q!'
ln -f $(PLUGIN)-$(VERSION).vba $(PLUGIN).vba

zip:
@echo zip
rm -f *.zip
zip -r $(PLUGIN).zip doc plugin autoload
zip $(PLUGIN).zip -d \*.sw\? || echo 1
zip $(PLUGIN).zip -d \*.un\? || echo 1
zip $(PLUGIN).zip -d \*.orig || echo 1
zip $(PLUGIN).zip -d \*tags || echo 1
zip $(PLUGIN).zip -d $(TESTS)
ln -f $(PLUGIN).zip $(PLUGIN)-$(VERSION).zip

gzip: vimball
@echo vimball
gzip -f $(PLUGIN).vba

release: version all

version: version:
@echo version: $(VERSION) $(PERL) -i.orig -pne 'if (/^"\sVersion:/) {s/(\d+\.\S+)/$(VERSION)/}' $(PLUGIN) $(LIB)
perl -i.orig -pne 'if (/^"\sVersion:/) {s/(\d+\.\S+)/$(VERSION)/}' $(SCRIPT) $(AUTOL) $(PERL) -i.orig -pne \
perl -i.orig -pne 'if (/let\sdelimitMate_version/) {s/"(\d+\.\S+)"/"$(VERSION)"/}' $(SCRIPT) 'if (/let\sdelimitMate_version/) {s/"(\d+\.\S+)"/"$(VERSION)"/}' $(PLUGIN)
perl -i.orig -pne 'if (/beasts/) {s/(v\d+\.\S+)/v$(VERSION)/}' $(DOC) $(PERL) -i.orig -pne 'if (/beasts/) {s/(v\d+\.\S+)/v$(VERSION)/}' $(DOC)
perl -i.orig -MPOSIX -pne 'if (/^"\sModified:/) {$$now_string = strftime "%F", localtime; s/(\d+-\d+-\d+)/$$now_string/e}' $(SCRIPT) $(AUTOL) $(PERL) -i.orig -MPOSIX -pne \
perl -i.orig -MPOSIX -pne 'if (/^\s+$(VERSION)\s+\d+-\d+-\d+\s+\*/) {$$now_string = strftime "%F", localtime; s/(\d+-\d+-\d+)/$$now_string/}' $(DOC) 'if (/^"\sModified:/) {$$now_string = strftime "%F", localtime; s/(\d+-\d+-\d+)/$$now_string/e}' \
@echo Version: $(VERSION) $(PLUGIN) $(LIB)

$(PERL) -i.orig -MPOSIX -pne \
echo: 'if (/^\s+$(VERSION)\s+\d+-\d+-\d+\s+\*/) {$$now_string = strftime "%F", localtime; s/(\d+-\d+-\d+)/$$now_string/}' \
$(DOC)

test:
runVimTests -0 test

install: $(SOURCES)
for dir in $(^D);\
do install -d -m 0755 $(DESTDIR)$(PREFIX)/$$dir;\
done;\
for file in $^;\
do install -m 0644 $$file $(DESTDIR)$(PREFIX)/$$file;\
done;

uninstall:
for file in $(SOURCES);\
do rm -f $(DESTDIR)$(PREFIX)/$$file;\
done;

%.vmb: $(SOURCES)
$(VIM) -N -es -u NORC \
-c 'call setline(1,["$(subst $(space),"$(comma)",$^)"])'\
-c "%MkVimball! $(basename $@) ." -c 'q!'

%.vmb.zip: vimball
zip $@ $(basename $@)

%.zip: $(SOURCES)
zip $@ $^

%.vmb.gz: vimball
gzip -f $(basename $@)

%.tar.gz: $(SOURCES)
tar -cvzf $@ $^

# vim:ts=2:sw=2
3 changes: 0 additions & 3 deletions etc/vim/bundle/delimitMate/README

This file was deleted.

6 changes: 6 additions & 0 deletions etc/vim/bundle/delimitMate/README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@
This plug-in provides automatic closing of quotes, parenthesis, brackets, etc., besides some other related features that
should make your time in insert mode a little bit easier, like syntax awareness (will not insert the closing delimiter
in comments and other configurable regions), <CR> and <Space> expansions (off by default), and some more.

Most of the features can be modified or disabled permanently, using global variables, or on a FileType basis, using
:autocmd.
Loading

0 comments on commit 233aca0

Please sign in to comment.