131 changed files with 9524 additions and 2 deletions
@ -1 +0,0 @@ |
|||||||
Subproject commit 0298871aff580d5c419d3b6ca25a5d3ec418f9a8 |
|
@ -0,0 +1,364 @@ |
|||||||
|
# vim:filetype=make:foldmethod=marker:fdl=0:
|
||||||
|
#
|
||||||
|
# Makefile: install/uninstall/link vim plugin files.
|
||||||
|
# Author: Cornelius <cornelius.howl@gmail.com>
|
||||||
|
# Date: 一 3/15 22:49:26 2010
|
||||||
|
# Version: 1.0
|
||||||
|
#
|
||||||
|
# PLEASE DO NOT EDIT THIS FILE. THIS FILE IS AUTO-GENERATED FROM Makefile.tpl
|
||||||
|
# LICENSE {{{
|
||||||
|
# Copyright (c) 2010 <Cornelius (c9s)>
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person
|
||||||
|
# obtaining a copy of this software and associated documentation
|
||||||
|
# files (the "Software"), to deal in the Software without
|
||||||
|
# restriction, including without limitation the rights to use,
|
||||||
|
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following
|
||||||
|
# conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be
|
||||||
|
# included in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
# OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
# }}}
|
||||||
|
# VIM RECORD FORMAT: {{{
|
||||||
|
# {
|
||||||
|
# version => 0.2, # record spec version
|
||||||
|
# generated_by => 'Vimana-' . $Vimana::VERSION,
|
||||||
|
# install_type => 'auto', # auto , make , rake ... etc
|
||||||
|
# package => $self->package_name,
|
||||||
|
# files => \@e,
|
||||||
|
# }
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# INTERNAL VARIABLES {{{
|
||||||
|
|
||||||
|
RECORD_FILE=.record
|
||||||
|
PWD=`pwd`
|
||||||
|
README_FILES=`ls -1 | grep -i readme`
|
||||||
|
WGET_OPT=-c -nv
|
||||||
|
CURL_OPT=
|
||||||
|
RECORD_SCRIPT=.mkrecord
|
||||||
|
TAR=tar czvf
|
||||||
|
|
||||||
|
GIT_SOURCES=
|
||||||
|
|
||||||
|
# INTERNAL FUNCTIONS {{{
|
||||||
|
record_file = \
|
||||||
|
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||||
|
echo $(VIMRUNTIME)/$$PTYPE/$(1) >> $(2)
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# PUBLIC FUNCTIONS {{{
|
||||||
|
|
||||||
|
GIT_SOURCES=
|
||||||
|
DEPEND_DIR=/tmp/vim-deps
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# $(call install_git_sources)
|
||||||
|
#
|
||||||
|
|
||||||
|
install_git_source = \
|
||||||
|
PWD=$(PWD) ; \
|
||||||
|
mkdir -p $(DEPEND_DIR) ; \
|
||||||
|
cd $(DEPEND_DIR) ; \
|
||||||
|
for git_uri in $(GIT_SOURCES) ; do \
|
||||||
|
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
|
||||||
|
echo $$OUTDIR ; \
|
||||||
|
if [[ -e $$OUTDIR ]] ; then \
|
||||||
|
cd $$OUTDIR ; \
|
||||||
|
git pull origin master && \
|
||||||
|
make install && cd .. ; \
|
||||||
|
else \
|
||||||
|
git clone $$git_uri $$OUTDIR && \
|
||||||
|
cd $$OUTDIR && \
|
||||||
|
make install && cd .. ; \
|
||||||
|
fi; \
|
||||||
|
done ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# install file by inspecting content
|
||||||
|
install_file = \
|
||||||
|
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||||
|
cp -v $(1) $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||||
|
|
||||||
|
link_file = \
|
||||||
|
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||||
|
cp -v $(1) $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||||
|
|
||||||
|
unlink_file = \
|
||||||
|
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||||
|
rm -fv $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||||
|
|
||||||
|
# fetch script from an url
|
||||||
|
fetch_url = \
|
||||||
|
@if [[ -e $(2) ]] ; then \
|
||||||
|
exit \
|
||||||
|
; fi \
|
||||||
|
; echo " => $(2)" \
|
||||||
|
; if [[ ! -z `which curl` ]] ; then \
|
||||||
|
curl $(CURL_OPT) $(1) -o $(2) ; \
|
||||||
|
; elif [[ ! -z `which wget` ]] ; then \
|
||||||
|
wget $(WGET_OPT) $(1) -O $(2) \
|
||||||
|
; fi \
|
||||||
|
; echo $(2) >> .bundlefiles
|
||||||
|
|
||||||
|
|
||||||
|
install_source = \
|
||||||
|
for git_uri in $(GIT_SOURCES) ; do \
|
||||||
|
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
|
||||||
|
echo $$OUTDIR ; \
|
||||||
|
done
|
||||||
|
|
||||||
|
# fetch script from github
|
||||||
|
fetch_github = \
|
||||||
|
@if [[ -e $(5) ]] ; then \
|
||||||
|
exit \
|
||||||
|
; fi \
|
||||||
|
; echo " => $(5)" \
|
||||||
|
; if [[ ! -z `which curl` ]] ; then \
|
||||||
|
curl $(CURL_OPT) http://github.com/$(1)/$(2)/raw/$(3)/$(4) -o $(5) \
|
||||||
|
; elif [[ ! -z `which wget` ]] ; then \
|
||||||
|
wget $(WGET_OPT) http://github.com/$(1)/$(2)/raw/$(3)/$(4) -O $(5) \
|
||||||
|
; fi \
|
||||||
|
; echo $(5) >> .bundlefiles
|
||||||
|
|
||||||
|
# fetch script from local file
|
||||||
|
fetch_local = @cp -v $(1) $(2) \
|
||||||
|
; @echo $(2) >> .bundlefiles
|
||||||
|
|
||||||
|
# 1: NAME , 2: URI
|
||||||
|
dep_from_git = \
|
||||||
|
D=/tmp/$(1)-$$RANDOM ; git clone $(2) $$D ; cd $$D ; make install ;
|
||||||
|
|
||||||
|
dep_from_svn = \
|
||||||
|
D=/tmp/$(1)-$$RANDOM ; svn checkout $(2) $$D ; cd $$D ; make install ;
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
# }}}
|
||||||
|
# ======= DEFAULT CONFIG ======= {{{
|
||||||
|
|
||||||
|
# Default plugin name
|
||||||
|
NAME=`basename \`pwd\``
|
||||||
|
VERSION=0.1
|
||||||
|
|
||||||
|
# Files to add to tarball:
|
||||||
|
DIRS=`ls -1F | grep / | sed -e 's/\///'`
|
||||||
|
|
||||||
|
# Runtime path to install:
|
||||||
|
VIMRUNTIME=~/.vim
|
||||||
|
|
||||||
|
# Other Files to be added:
|
||||||
|
FILES=`ls -1 | grep '.vim$$'`
|
||||||
|
MKFILES=Makefile `ls -1 | grep '.mk$$'`
|
||||||
|
|
||||||
|
# ======== USER CONFIG ======= {{{
|
||||||
|
# please write config in config.mk
|
||||||
|
# this will override default config
|
||||||
|
#
|
||||||
|
# Custom Name:
|
||||||
|
#
|
||||||
|
# NAME=[plugin name]
|
||||||
|
#
|
||||||
|
# Custom dir list:
|
||||||
|
#
|
||||||
|
# DIRS=autoload after doc syntax plugin
|
||||||
|
#
|
||||||
|
# Files to add to tarball:
|
||||||
|
#
|
||||||
|
# FILES=
|
||||||
|
#
|
||||||
|
# Bundle dependent scripts:
|
||||||
|
#
|
||||||
|
# bundle-deps:
|
||||||
|
# $(call fetch_github,[account id],[project],[branch],[source path],[target path])
|
||||||
|
# $(call fetch_url,[file url],[target path])
|
||||||
|
# $(call fetch_local,[from],[to])
|
||||||
|
|
||||||
|
SHELL=bash
|
||||||
|
|
||||||
|
CONFIG_FILE=config.mk
|
||||||
|
-include ~/.vimauthor.mk |
||||||
|
-include $(CONFIG_FILE) |
||||||
|
|
||||||
|
# }}}
|
||||||
|
# }}}
|
||||||
|
# ======= SECTIONS ======= {{{
|
||||||
|
-include ext.mk |
||||||
|
|
||||||
|
all: install-deps install |
||||||
|
|
||||||
|
install-deps: |
||||||
|
# check required binaries
|
||||||
|
[[ -n $$(which git) ]]
|
||||||
|
[[ -n $$(which bash) ]]
|
||||||
|
[[ -n $$(which vim) ]]
|
||||||
|
[[ -n $$(which wget) || -n $$(which curl) ]]
|
||||||
|
$(call install_git_sources)
|
||||||
|
|
||||||
|
check-require: |
||||||
|
@if [[ -n `which wget` || -n `which curl` || -n `which fetch` ]]; then echo "wget|curl|fetch: OK" ; else echo "wget|curl|fetch: NOT OK" ; fi
|
||||||
|
@if [[ -n `which vim` ]] ; then echo "vim: OK" ; else echo "vim: NOT OK" ; fi
|
||||||
|
|
||||||
|
config: |
||||||
|
@rm -f $(CONFIG_FILE)
|
||||||
|
@echo "NAME=" >> $(CONFIG_FILE)
|
||||||
|
@echo "VERSION=" >> $(CONFIG_FILE)
|
||||||
|
@echo "#DIRS="
|
||||||
|
@echo "#FILES="
|
||||||
|
@echo "" >> $(CONFIG_FILE)
|
||||||
|
@echo "bundle-deps:" >> $(CONFIG_FILE)
|
||||||
|
@echo "\t\t\$$(call fetch_github,ID,REPOSITORY,BRANCH,PATH,TARGET_PATH)" >> $(CONFIG_FILE)
|
||||||
|
@echo "\t\t\$$(call fetch_url,FILE_URL,TARGET_PATH)" >> $(CONFIG_FILE)
|
||||||
|
|
||||||
|
|
||||||
|
init-author: |
||||||
|
@echo "AUTHOR=" > ~/.vimauthor.mk
|
||||||
|
|
||||||
|
bundle-deps: |
||||||
|
|
||||||
|
bundle: bundle-deps |
||||||
|
|
||||||
|
dist: bundle mkfilelist |
||||||
|
@$(TAR) $(NAME)-$(VERSION).tar.gz --exclude '*.svn' --exclude '.git' $(DIRS) $(README_FILES) $(FILES) $(MKFILES)
|
||||||
|
@echo "$(NAME)-$(VERSION).tar.gz is ready."
|
||||||
|
|
||||||
|
init-runtime: |
||||||
|
@mkdir -vp $(VIMRUNTIME)
|
||||||
|
@mkdir -vp $(VIMRUNTIME)/record
|
||||||
|
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type d | while read dir ; do \
|
||||||
|
mkdir -vp $(VIMRUNTIME)/$$dir ; done ; fi
|
||||||
|
|
||||||
|
release: |
||||||
|
if [[ -n `which vimup` ]] ; then \
|
||||||
|
fi
|
||||||
|
|
||||||
|
pure-install: |
||||||
|
@echo "Using Shell:" $(SHELL)
|
||||||
|
@echo "Installing"
|
||||||
|
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||||
|
cp -v $$file $(VIMRUNTIME)/$$file ; done ; fi
|
||||||
|
@echo "$(FILES)" | while read vimfile ; do \
|
||||||
|
if [[ -n $$vimfile ]] ; then \
|
||||||
|
$(call install_file,$$vimfile) ; fi ; done
|
||||||
|
|
||||||
|
install: init-runtime bundle pure-install record |
||||||
|
|
||||||
|
|
||||||
|
uninstall-files: |
||||||
|
@echo "Uninstalling"
|
||||||
|
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||||
|
rm -fv $(VIMRUNTIME)/$$file ; done ; fi
|
||||||
|
@echo "$(FILES)" | while read vimfile ; do \
|
||||||
|
if [[ -n $$vimfile ]] ; then \
|
||||||
|
$(call unlink_file,$$vimfile) ; fi ; done
|
||||||
|
|
||||||
|
uninstall: uninstall-files rmrecord |
||||||
|
|
||||||
|
link: init-runtime |
||||||
|
@echo "Linking"
|
||||||
|
@if [[ -n "$(DIRS)" ]]; then find $(DIRS) -type f | while read file ; do \
|
||||||
|
ln -sfv $(PWD)/$$file $(VIMRUNTIME)/$$file ; done ; fi
|
||||||
|
@echo "$(FILES)" | while read vimfile ; do \
|
||||||
|
if [[ -n $$vimfile ]] ; then \
|
||||||
|
$(call link_file,$$vimfile) ; fi ; done
|
||||||
|
|
||||||
|
mkfilelist: |
||||||
|
@echo $(NAME) > $(RECORD_FILE)
|
||||||
|
@echo $(VERSION) >> $(RECORD_FILE)
|
||||||
|
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||||
|
echo $(VIMRUNTIME)/$$file >> $(RECORD_FILE) ; done ; fi
|
||||||
|
@echo "$(FILES)" | while read vimfile ; do \
|
||||||
|
if [[ -n $$vimfile ]] ; then \
|
||||||
|
$(call record_file,$$vimfile,$(RECORD_FILE)) ; fi ; done
|
||||||
|
|
||||||
|
vimball-edit: |
||||||
|
find $(DIRS) -type f > .tmp_list
|
||||||
|
vim .tmp_list
|
||||||
|
vim .tmp_list -c ":%MkVimball $(NAME)-$(VERSION) ." -c "q"
|
||||||
|
@rm -vf .tmp_list
|
||||||
|
@echo "$(NAME)-$(VERSION).vba is ready."
|
||||||
|
|
||||||
|
vimball: |
||||||
|
find $(DIRS) -type f > .tmp_list
|
||||||
|
vim .tmp_list -c ":%MkVimball $(NAME)-$(VERSION) ." -c "q"
|
||||||
|
@rm -vf .tmp_list
|
||||||
|
@echo "$(NAME)-$(VERSION).vba is ready."
|
||||||
|
|
||||||
|
mkrecordscript: |
||||||
|
@echo "" > $(RECORD_SCRIPT)
|
||||||
|
@echo "fun! s:mkmd5(file)" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " if executable('md5')" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " return system('cat ' . a:file . ' | md5')" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " else" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " return \"\"" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " endif" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "endf" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let files = readfile('.record')" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let package_name = remove(files,0)" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let script_version = remove(files,0)" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let record = { 'version' : 0.3 , 'generated_by': 'Vim-Makefile' , 'script_version': script_version , 'install_type' : 'makefile' , 'package' : package_name , 'files': [ ] }" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "for file in files " >> $(RECORD_SCRIPT)
|
||||||
|
@echo " let md5 = s:mkmd5(file)" >> $(RECORD_SCRIPT)
|
||||||
|
@echo " cal add( record.files , { 'checksum': md5 , 'file': file } )" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "endfor" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "redir => output" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "silent echon record" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "redir END" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let content = join(split(output,\"\\\\n\"),'')" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "let record_file = expand('~/.vim/record/' . package_name )" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "cal writefile( [content] , record_file )" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "cal delete('.record')" >> $(RECORD_SCRIPT)
|
||||||
|
@echo "echo \"Done\"" >> $(RECORD_SCRIPT)
|
||||||
|
|
||||||
|
|
||||||
|
record: mkfilelist mkrecordscript |
||||||
|
vim --noplugin -V10install.log -c "so $(RECORD_SCRIPT)" -c "q"
|
||||||
|
@echo "Vim script record making log: install.log"
|
||||||
|
# @rm -vf $(RECORD_FILE)
|
||||||
|
|
||||||
|
rmrecord: |
||||||
|
@echo "Removing Record"
|
||||||
|
@rm -vf $(VIMRUNTIME)/record/$(NAME)
|
||||||
|
|
||||||
|
clean: clean-bundle-deps |
||||||
|
@rm -vf $(RECORD_FILE)
|
||||||
|
@rm -vf $(RECORD_SCRIPT)
|
||||||
|
@rm -vf install.log
|
||||||
|
@rm -vf *.tar.gz
|
||||||
|
|
||||||
|
clean-bundle-deps: |
||||||
|
@echo "Removing Bundled scripts..."
|
||||||
|
@if [[ -e .bundlefiles ]] ; then \
|
||||||
|
rm -fv `echo \`cat .bundlefiles\``; \
|
||||||
|
fi
|
||||||
|
@rm -fv .bundlefiles
|
||||||
|
|
||||||
|
update: |
||||||
|
@echo "Updating Makefile..."
|
||||||
|
@URL=http://github.com/c9s/vim-makefile/raw/master/Makefile ; \
|
||||||
|
if [[ -n `which curl` ]]; then \
|
||||||
|
curl $$URL -o Makefile ; \
|
||||||
|
if [[ -n `which wget` ]]; then \
|
||||||
|
wget -c $$URL ; \
|
||||||
|
elif [[ -n `which fetch` ]]; then \
|
||||||
|
fetch $$URL ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
version: |
||||||
|
@echo version - $(MAKEFILE_VERSION)
|
||||||
|
|
||||||
|
# }}}
|
@ -0,0 +1,182 @@ |
|||||||
|
javascript-libraries-syntax.vim |
||||||
|
=============================== |
||||||
|
|
||||||
|
Syntax file for JavaScript libraries. Supports JavaScript libraries I am using (patches welcome). |
||||||
|
Should work well with other JavaScript syntax files. [SyntaxComplete][] also works well on all |
||||||
|
supported languages. |
||||||
|
|
||||||
|
[SyntaxComplete]:http://www.vim.org/scripts/script.php?script_id=3172 |
||||||
|
|
||||||
|
Libraries |
||||||
|
--------- |
||||||
|
|
||||||
|
* [jQuery](http://jquery.com/) |
||||||
|
* [underscore.js](http://underscorejs.org/) |
||||||
|
* [lo-dash](http://lodash.com/) |
||||||
|
* [Backbone.js](http://backbonejs.org/) |
||||||
|
* [prelude.ls](http://gkz.github.com/prelude-ls/) |
||||||
|
* [AngularJS](http://angularjs.org/) |
||||||
|
* [AngularUI](http://angular-ui.github.io) |
||||||
|
* [AngularUI Router](http://angular-ui.github.io/ui-router/) |
||||||
|
* [React](https://facebook.github.io/react/) |
||||||
|
* [Flux](https://facebook.github.io/flux/) |
||||||
|
* [RequireJS](http://requirejs.org/) |
||||||
|
* [Sugar.js](http://sugarjs.com/) |
||||||
|
* [Jasmine](http://pivotal.github.io/jasmine/) |
||||||
|
* [Chai](http://chaijs.com/) |
||||||
|
* [Handlebars](http://handlebarsjs.com/) |
||||||
|
|
||||||
|
File Types |
||||||
|
---------- |
||||||
|
|
||||||
|
* JavaScript |
||||||
|
* [CoffeeScript](http://coffeescript.org/) |
||||||
|
* [LiveScript](http://livescript.net/) |
||||||
|
* [TypeScript](http://www.typescriptlang.org/) |
||||||
|
|
||||||
|
Will be more when SyntaxComplete has new version. |
||||||
|
|
||||||
|
Install |
||||||
|
------- |
||||||
|
|
||||||
|
Use [pathogen][] or [vundle][] is recommended. |
||||||
|
|
||||||
|
[pathogen]:http://www.vim.org/scripts/script.php?script_id=2332 |
||||||
|
[vundle]:https://github.com/gmarik/vundle |
||||||
|
|
||||||
|
Config |
||||||
|
------ |
||||||
|
|
||||||
|
You can use g:used_javascript_libs to setup used libraries, ex: |
||||||
|
|
||||||
|
```viml |
||||||
|
let g:used_javascript_libs = 'underscore,backbone' |
||||||
|
``` |
||||||
|
|
||||||
|
Support libs id: |
||||||
|
|
||||||
|
* jQuery: jquery |
||||||
|
* underscore.js: underscore |
||||||
|
* Lo-Dash: underscore |
||||||
|
* Backbone.js: backbone |
||||||
|
* prelude.ls: prelude |
||||||
|
* AngularJS: angularjs |
||||||
|
* AngularUI: angularui |
||||||
|
* AngularUI Router: angularuirouter |
||||||
|
* React: react |
||||||
|
* Flux: flux |
||||||
|
* RequireJS: requirejs |
||||||
|
* Sugar.js: sugar |
||||||
|
* Jasmine: jasmine |
||||||
|
* Chai: chai |
||||||
|
* Handlebars: handlebars |
||||||
|
|
||||||
|
Default lib set is: `jquery,underscore,backbone` |
||||||
|
|
||||||
|
You can use [local vimrc][] to setup libraries used in project. Sample code for local vimrc: |
||||||
|
|
||||||
|
```viml |
||||||
|
autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1 |
||||||
|
autocmd BufReadPre *.js let b:javascript_lib_use_underscore = 1 |
||||||
|
autocmd BufReadPre *.js let b:javascript_lib_use_backbone = 1 |
||||||
|
autocmd BufReadPre *.js let b:javascript_lib_use_prelude = 0 |
||||||
|
autocmd BufReadPre *.js let b:javascript_lib_use_angularjs = 0 |
||||||
|
``` |
||||||
|
|
||||||
|
[local vimrc]:https://github.com/MarcWeber/vim-addon-local-vimrc |
||||||
|
|
||||||
|
Todo |
||||||
|
---- |
||||||
|
|
||||||
|
* Support future version of SyntaxComplete |
||||||
|
|
||||||
|
Known Issue |
||||||
|
----------- |
||||||
|
|
||||||
|
SyntaxComplete only accept groups with filetype prefixed. For example, 'javascript' files. |
||||||
|
Only keywords in groups which's name matches /javascript.*/ will be available. So to make it |
||||||
|
possible to use SyntaxComplete on CoffeeScript, LiveScript and other compile to JavaScript |
||||||
|
languages. We must redefine all syntax many times, with different name prefix. SyntaxComplete |
||||||
|
might have new feature to support a user define pattern for group name to include. |
||||||
|
All repeat defination will be removed when SyntaxComplete supports this feature. |
||||||
|
|
||||||
|
Changes |
||||||
|
------- |
||||||
|
|
||||||
|
### Version 0.4 |
||||||
|
* Add React, Flux, Chai, Handlbars |
||||||
|
* Default lib set |
||||||
|
* Bug fix |
||||||
|
|
||||||
|
### Version 0.3.6 |
||||||
|
* Add Jasmine, AngularUI |
||||||
|
* Update underscore, jQuery |
||||||
|
|
||||||
|
### Version 0.3.5 |
||||||
|
* Add sugar.js support |
||||||
|
* b:current_syntax to detect current syntax |
||||||
|
|
||||||
|
### Version 0.3.4 |
||||||
|
* Add $ to iskeyword for jQuery and angular (Issue #4) |
||||||
|
* Support linecomment (Issue #6) |
||||||
|
* Add augularjs HTML custom attribute support |
||||||
|
|
||||||
|
### Version 0.3.3 |
||||||
|
* No strict mode, better compatibility. |
||||||
|
|
||||||
|
### Version 0.3.2 |
||||||
|
* Fix coffee script compatible |
||||||
|
* Update jQuery syntax to latest version |
||||||
|
* Support lo-dash |
||||||
|
* jQuery selector update |
||||||
|
* Minor bug fix |
||||||
|
|
||||||
|
### Version 0.3.1 |
||||||
|
* Fix performance issue |
||||||
|
|
||||||
|
### Version 0.3 |
||||||
|
* Supports AngularJS, RequireJS |
||||||
|
* Support TypeScript |
||||||
|
* Setup used libraries |
||||||
|
* Better init way |
||||||
|
|
||||||
|
### Version 0.2 |
||||||
|
* Supports library selection |
||||||
|
|
||||||
|
### Version 0.1 |
||||||
|
* First release. |
||||||
|
|
||||||
|
Credits |
||||||
|
------- |
||||||
|
|
||||||
|
* Bruno Michel, [jQuery : Syntax file for jQuery][jquery.vim] |
||||||
|
* [Peter Renström][], for [summarize and explain AngularJS stuff][issue1]. |
||||||
|
|
||||||
|
[jquery.vim]:http://www.vim.org/scripts/script.php?script_id=2416 |
||||||
|
[Peter Renström]:https://github.com/renstrom |
||||||
|
[issue1]:https://github.com/othree/javascript-libraries-syntax.vim/issues/1 |
||||||
|
|
||||||
|
License |
||||||
|
------- |
||||||
|
|
||||||
|
Copyright (c) 2013 Wei-Ko Kao |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||||
|
of this software and associated documentation files (the "Software"), to deal |
||||||
|
in the Software without restriction, including without limitation the rights |
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||||
|
copies of the Software, and to permit persons to whom the Software is |
||||||
|
furnished to do so, subject to the following conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in |
||||||
|
all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||||
|
THE SOFTWARE. |
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/08/26 |
||||||
|
" Version: 0.4.1 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
if b:current_syntax == 'coffee' |
||||||
|
call jslibsyntax#load() |
||||||
|
endif |
@ -0,0 +1,10 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/08/26 |
||||||
|
" Version: 0.5.1 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
if b:current_syntax == 'html' |
||||||
|
call jslibsyntax#load() |
||||||
|
endif |
@ -0,0 +1,10 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/08/26 |
||||||
|
" Version: 0.4.1 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
if b:current_syntax == 'javascript' |
||||||
|
call jslibsyntax#load() |
||||||
|
endif |
@ -0,0 +1,10 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/08/26 |
||||||
|
" Version: 0.4.1 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
if b:current_syntax == 'ls' |
||||||
|
call jslibsyntax#load() |
||||||
|
endif |
@ -0,0 +1,10 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/08/26 |
||||||
|
" Version: 0.4.1 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
if b:current_syntax == 'typescript' |
||||||
|
call jslibsyntax#load() |
||||||
|
endif |
@ -0,0 +1,61 @@ |
|||||||
|
" Vim plugin file |
||||||
|
" Language: JS Lib syntax loader |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/30 |
||||||
|
" Version: 0.4 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
|
||||||
|
let s:libs = [ |
||||||
|
\ 'jquery', |
||||||
|
\ 'underscore', |
||||||
|
\ 'backbone', |
||||||
|
\ 'prelude', |
||||||
|
\ 'angularjs', |
||||||
|
\ 'angularui', |
||||||
|
\ 'angularuirouter', |
||||||
|
\ 'requirejs', |
||||||
|
\ 'sugar', |
||||||
|
\ 'jasmine', |
||||||
|
\ 'chai', |
||||||
|
\ 'react', |
||||||
|
\ 'flux', |
||||||
|
\ 'handlebars' |
||||||
|
\ ] |
||||||
|
|
||||||
|
let s:default_libs = [ |
||||||
|
\ 'jquery', |
||||||
|
\ 'underscore', |
||||||
|
\ 'backbone', |
||||||
|
\ 'react' |
||||||
|
\ ] |
||||||
|
|
||||||
|
let s:path = expand('<sfile>:p:h') |
||||||
|
|
||||||
|
function! jslibsyntax#load() |
||||||
|
if !exists('g:used_javascript_libs') |
||||||
|
let g:used_javascript_libs = join(s:default_libs, ',') |
||||||
|
endif |
||||||
|
|
||||||
|
let index = 0 |
||||||
|
let loaded = 0 |
||||||
|
while index < len(s:libs) |
||||||
|
let lib = s:libs[index] |
||||||
|
let use = g:used_javascript_libs =~ lib |
||||||
|
if exists('b:javascript_lib_use_'.lib) |
||||||
|
exec('let use = b:javascript_lib_use_'.lib) |
||||||
|
endif |
||||||
|
if use |
||||||
|
let fn = s:path.'/syntax/'.lib.'.'.b:current_syntax.'.vim' |
||||||
|
if filereadable(fn) |
||||||
|
exe('source '.fnameescape(fn)) |
||||||
|
let loaded = loaded + 1 |
||||||
|
endif |
||||||
|
endif |
||||||
|
let index = index + 1 |
||||||
|
endwhile |
||||||
|
let fn = s:path.'/syntax/postprocess.'.b:current_syntax.'.vim' |
||||||
|
if loaded > 0 && filereadable(fn) |
||||||
|
exe('source '.fnameescape(fn)) |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
@ -0,0 +1,95 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularJS for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.1.13.1 |
||||||
|
" URL: http://angularjs.org/ |
||||||
|
|
||||||
|
syntax keyword coffeeAngular angular containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeAngulardot |
||||||
|
syntax match coffeeAngulardot contained /\./ nextgroup=coffeeAngularMethods |
||||||
|
syntax keyword coffeeAngularMethods contained bind bootstrap copy element equals |
||||||
|
syntax keyword coffeeAngularMethods contained extend forEach fromJson identity injector |
||||||
|
syntax keyword coffeeAngularMethods contained isArray isDate isDefined isElement isFunction |
||||||
|
syntax keyword coffeeAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||||
|
syntax keyword coffeeAngularMethods contained mock module noop toJson uppercase version |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $anchorScroll $cacheFactory $compile $controller $document |
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $exceptionHandler $filter $httpBackend |
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $locale $parse $rootElement |
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $routeParams $templateCache $window |
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $cookies $resource $sanitize |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $http nextgroup=coffeeAShttpdot |
||||||
|
syntax match coffeeAShttpdot contained /\./ nextgroup=coffeeAShttpMethods |
||||||
|
syntax keyword coffeeAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $interpolate nextgroup=coffeeASinterpolatedot |
||||||
|
syntax match coffeeASinterpolatedot contained /\./ nextgroup=coffeeASinterpolateMethods |
||||||
|
syntax keyword coffeeASinterpolateMethods contained endSymbol startSymbol |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $location nextgroup=coffeeASlocationdot |
||||||
|
syntax match coffeeASlocationdot contained /\./ nextgroup=coffeeASlocationMethods |
||||||
|
syntax keyword coffeeASlocationMethods contained absUrl hash host path port protocol replace search url |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $log nextgroup=coffeeASlogdot |
||||||
|
syntax match coffeeASlogdot contained /\./ nextgroup=coffeeASlogMethods |
||||||
|
syntax keyword coffeeASlogMethods contained error info log warn |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $q nextgroup=coffeeASqdot |
||||||
|
syntax match coffeeASqdot contained /\./ nextgroup=coffeeASqMethods |
||||||
|
syntax keyword coffeeASqMethods contained all defer reject when |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $route nextgroup=coffeeASroutedot |
||||||
|
syntax match coffeeASroutedot contained /\./ nextgroup=coffeeASrouteMethods |
||||||
|
syntax keyword coffeeASrouteMethods contained reload current route |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $timeout nextgroup=coffeeAStimeoutdot |
||||||
|
syntax match coffeeAStimeoutdot contained /\./ nextgroup=coffeeAStimeoutMethods |
||||||
|
syntax keyword coffeeAStimeoutMethods contained cancel |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $scope $rootScope nextgroup=coffeeASscopedot |
||||||
|
syntax match coffeeASscopedot contained /\./ nextgroup=coffeeASscopeMethods |
||||||
|
syntax keyword coffeeASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||||
|
|
||||||
|
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $cookieStore nextgroup=coffeeAScookieStoredot |
||||||
|
syntax match coffeeAScookieStoredot contained /\./ nextgroup=coffeeAScookieStoreMethods |
||||||
|
syntax keyword coffeeAScookieStoreMethods contained get put remove |
||||||
|
|
||||||
|
syntax cluster coffeeAFunctions contains=coffeeAMFunctions |
||||||
|
syntax cluster coffeeAAttrs contains=coffeeAMAttrs |
||||||
|
|
||||||
|
syntax keyword coffeeAMFunctions contained config constant controller directive factory |
||||||
|
syntax keyword coffeeAMFunctions contained filter provider run service value |
||||||
|
syntax keyword coffeeAMAttrs contained name requires |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularjs_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularjs_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeAngular Constant |
||||||
|
HiLink coffeeAServices Constant |
||||||
|
|
||||||
|
HiLink coffeeAngularMethods PreProc |
||||||
|
HiLink coffeeAMFunctions PreProc |
||||||
|
HiLink coffeeAMAttrs PreProc |
||||||
|
|
||||||
|
HiLink coffeeAShttpMethods PreProc |
||||||
|
HiLink coffeeASinterpolateMethods PreProc |
||||||
|
HiLink coffeeASlocationMethods PreProc |
||||||
|
HiLink coffeeASlogMethods PreProc |
||||||
|
HiLink coffeeASqMethods PreProc |
||||||
|
HiLink coffeeASrouteMethods PreProc |
||||||
|
HiLink coffeeAStimeoutMethods PreProc |
||||||
|
HiLink coffeeASscopeMethods PreProc |
||||||
|
HiLink coffeeAScookieStoreMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,32 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularJS for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com>, Rafael Benevides <rafabene@gmail.com> |
||||||
|
" Last Change: 2015/10/04 |
||||||
|
" Version: 1.4.5 - Taken from: https://code.angularjs.org/1.4.5/docs/api/ng/directive |
||||||
|
" URL: http://angularjs.org/ |
||||||
|
|
||||||
|
setlocal iskeyword+=- |
||||||
|
|
||||||
|
syntax keyword htmlArg contained ng-app ng-bind ng-bind-html ng-bind-template ng-blur ng-change ng-checked ng-class |
||||||
|
syntax keyword htmlArg contained ng-class-even ng-class-odd ng-click ng-cloak ng-controller ng-copy ng-csp ng-dblclick |
||||||
|
syntax keyword htmlArg contained ng-disabled ng-form ng-hide ng-href ng-if ng-include ng-init ng-jq ng-keydown ng-keypress |
||||||
|
syntax keyword htmlArg contained ng-keyup ng-list ng-model ng-model-options ng-mousedown ng-mouseenter ng-mouseleave ng-mousemove |
||||||
|
syntax keyword htmlArg contained ng-mouseover ng-mouseup ng-non-bindable ng-open ng-options ng-paste ng-pluralize ng-readonly |
||||||
|
syntax keyword htmlArg contained ng-repeat ng-selected ng-show ng-src ng-srcset ng-style ng-submit ng-switch ng-switch-when |
||||||
|
syntax keyword htmlArg contained ng-switch-default ng-transclude ng-view |
||||||
|
"Input directives |
||||||
|
syntax keyword htmlArg contained ng-required ng-minlength ng-maxlength ng-pattern ng-trim ng-true-values ng-false-values ng-min ng-max |
||||||
|
|
||||||
|
" http://docs.angularjs.org/guide/directive |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(app\|bind\|bind-html\|blur\|bind-template\|change\|checked\|class\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(class-even\|class-odd\|click\|cloak\|controller\|copy\|csp\|dblclick\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(disabled\|form\|hide\|href\|if\|include\|init\|jq\|keydown\|keypress\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(keyup\|list\|model\|model-options\|mousedown\|mouseenter\|mouseleave\|mousemove\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(mouseover\|mouseup\|non-bindable\|open\|options\|paste\|pluralize\|readonly\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(repeat\|selected\|show\|src\|srset\|style\|submit\|switch\|switch-when\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(switch-default\|transclude\|view\)/ |
||||||
|
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(required\|minlength\|maxlength\|pattern\|trim\|true-values\|false-values\|min\|max\)/ |
||||||
|
|
||||||
|
syntax keyword htmlArg contained expression autoscroll count when offset on |
||||||
|
|
||||||
|
syntax keyword htmlTagName contained ng-form ng-include ng-pluralize ng-transclude ng-view |
@ -0,0 +1,95 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularJS for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.1.13.1 |
||||||
|
" URL: http://angularjs.org/ |
||||||
|
|
||||||
|
syntax keyword javascriptAngular angular containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptAngulardot |
||||||
|
syntax match javascriptAngulardot contained /\./ nextgroup=javascriptAngularMethods |
||||||
|
syntax keyword javascriptAngularMethods contained bind bootstrap copy element equals |
||||||
|
syntax keyword javascriptAngularMethods contained extend forEach fromJson identity injector |
||||||
|
syntax keyword javascriptAngularMethods contained isArray isDate isDefined isElement isFunction |
||||||
|
syntax keyword javascriptAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||||
|
syntax keyword javascriptAngularMethods contained mock module noop toJson uppercase version |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $anchorScroll $cacheFactory $compile $controller $document |
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $exceptionHandler $filter $httpBackend |
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $locale $parse $rootElement |
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $routeParams $templateCache $window |
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $cookies $resource $sanitize |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $http nextgroup=javascriptAShttpdot |
||||||
|
syntax match javascriptAShttpdot contained /\./ nextgroup=javascriptAShttpMethods |
||||||
|
syntax keyword javascriptAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $interpolate nextgroup=javascriptASinterpolatedot |
||||||
|
syntax match javascriptASinterpolatedot contained /\./ nextgroup=javascriptASinterpolateMethods |
||||||
|
syntax keyword javascriptASinterpolateMethods contained endSymbol startSymbol |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $location nextgroup=javascriptASlocationdot |
||||||
|
syntax match javascriptASlocationdot contained /\./ nextgroup=javascriptASlocationMethods |
||||||
|
syntax keyword javascriptASlocationMethods contained absUrl hash host path port protocol replace search url |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $log nextgroup=javascriptASlogdot |
||||||
|
syntax match javascriptASlogdot contained /\./ nextgroup=javascriptASlogMethods |
||||||
|
syntax keyword javascriptASlogMethods contained error info log warn |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $q nextgroup=javascriptASqdot |
||||||
|
syntax match javascriptASqdot contained /\./ nextgroup=javascriptASqMethods |
||||||
|
syntax keyword javascriptASqMethods contained all defer reject when |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $route nextgroup=javascriptASroutedot |
||||||
|
syntax match javascriptASroutedot contained /\./ nextgroup=javascriptASrouteMethods |
||||||
|
syntax keyword javascriptASrouteMethods contained reload current route |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $timeout nextgroup=javascriptAStimeoutdot |
||||||
|
syntax match javascriptAStimeoutdot contained /\./ nextgroup=javascriptAStimeoutMethods |
||||||
|
syntax keyword javascriptAStimeoutMethods contained cancel |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $scope $rootScope nextgroup=javascriptASscopedot |
||||||
|
syntax match javascriptASscopedot contained /\./ nextgroup=javascriptASscopeMethods |
||||||
|
syntax keyword javascriptASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||||
|
|
||||||
|
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $cookieStore nextgroup=javascriptAScookieStoredot |
||||||
|
syntax match javascriptAScookieStoredot contained /\./ nextgroup=javascriptAScookieStoreMethods |
||||||
|
syntax keyword javascriptAScookieStoreMethods contained get put remove |
||||||
|
|
||||||
|
syntax cluster javascriptAFunctions contains=javascriptAMFunctions |
||||||
|
syntax cluster javascriptAAttrs contains=javascriptAMAttrs |
||||||
|
|
||||||
|
syntax keyword javascriptAMFunctions contained config constant controller directive factory |
||||||
|
syntax keyword javascriptAMFunctions contained filter provider run service value |
||||||
|
syntax keyword javascriptAMAttrs contained name requires |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularjs_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularjs_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptAngular Constant |
||||||
|
HiLink javascriptAServices Constant |
||||||
|
|
||||||
|
HiLink javascriptAngularMethods PreProc |
||||||
|
HiLink javascriptAMFunctions PreProc |
||||||
|
HiLink javascriptAMAttrs PreProc |
||||||
|
|
||||||
|
HiLink javascriptAShttpMethods PreProc |
||||||
|
HiLink javascriptASinterpolateMethods PreProc |
||||||
|
HiLink javascriptASlocationMethods PreProc |
||||||
|
HiLink javascriptASlogMethods PreProc |
||||||
|
HiLink javascriptASqMethods PreProc |
||||||
|
HiLink javascriptASrouteMethods PreProc |
||||||
|
HiLink javascriptAStimeoutMethods PreProc |
||||||
|
HiLink javascriptASscopeMethods PreProc |
||||||
|
HiLink javascriptAScookieStoreMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,95 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularJS for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.1.13.1 |
||||||
|
" URL: http://angularjs.org/ |
||||||
|
|
||||||
|
syntax keyword lsAngular angular containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsAngulardot |
||||||
|
syntax match lsAngulardot contained /\./ nextgroup=lsAngularMethods |
||||||
|
syntax keyword lsAngularMethods contained bind bootstrap copy element equals |
||||||
|
syntax keyword lsAngularMethods contained extend forEach fromJson identity injector |
||||||
|
syntax keyword lsAngularMethods contained isArray isDate isDefined isElement isFunction |
||||||
|
syntax keyword lsAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||||
|
syntax keyword lsAngularMethods contained mock module noop toJson uppercase version |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $anchorScroll $cacheFactory $compile $controller $document |
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $exceptionHandler $filter $httpBackend |
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $locale $parse $rootElement |
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $routeParams $templateCache $window |
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $cookies $resource $sanitize |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $http nextgroup=lsAShttpdot |
||||||
|
syntax match lsAShttpdot contained /\./ nextgroup=lsAShttpMethods |
||||||
|
syntax keyword lsAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $interpolate nextgroup=lsASinterpolatedot |
||||||
|
syntax match lsASinterpolatedot contained /\./ nextgroup=lsASinterpolateMethods |
||||||
|
syntax keyword lsASinterpolateMethods contained endSymbol startSymbol |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $location nextgroup=lsASlocationdot |
||||||
|
syntax match lsASlocationdot contained /\./ nextgroup=lsASlocationMethods |
||||||
|
syntax keyword lsASlocationMethods contained absUrl hash host path port protocol replace search url |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $log nextgroup=lsASlogdot |
||||||
|
syntax match lsASlogdot contained /\./ nextgroup=lsASlogMethods |
||||||
|
syntax keyword lsASlogMethods contained error info log warn |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $q nextgroup=lsASqdot |
||||||
|
syntax match lsASqdot contained /\./ nextgroup=lsASqMethods |
||||||
|
syntax keyword lsASqMethods contained all defer reject when |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $route nextgroup=lsASroutedot |
||||||
|
syntax match lsASroutedot contained /\./ nextgroup=lsASrouteMethods |
||||||
|
syntax keyword lsASrouteMethods contained reload current route |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $timeout nextgroup=lsAStimeoutdot |
||||||
|
syntax match lsAStimeoutdot contained /\./ nextgroup=lsAStimeoutMethods |
||||||
|
syntax keyword lsAStimeoutMethods contained cancel |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $scope $rootScope nextgroup=lsASscopedot |
||||||
|
syntax match lsASscopedot contained /\./ nextgroup=lsASscopeMethods |
||||||
|
syntax keyword lsASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||||
|
|
||||||
|
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $cookieStore nextgroup=lsAScookieStoredot |
||||||
|
syntax match lsAScookieStoredot contained /\./ nextgroup=lsAScookieStoreMethods |
||||||
|
syntax keyword lsAScookieStoreMethods contained get put remove |
||||||
|
|
||||||
|
syntax cluster lsAFunctions contains=lsAMFunctions |
||||||
|
syntax cluster lsAAttrs contains=lsAMAttrs |
||||||
|
|
||||||
|
syntax keyword lsAMFunctions contained config constant controller directive factory |
||||||
|
syntax keyword lsAMFunctions contained filter provider run service value |
||||||
|
syntax keyword lsAMAttrs contained name requires |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularjs_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularjs_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsAngular Constant |
||||||
|
HiLink lsAServices Constant |
||||||
|
|
||||||
|
HiLink lsAngularMethods PreProc |
||||||
|
HiLink lsAMFunctions PreProc |
||||||
|
HiLink lsAMAttrs PreProc |
||||||
|
|
||||||
|
HiLink lsAShttpMethods PreProc |
||||||
|
HiLink lsASinterpolateMethods PreProc |
||||||
|
HiLink lsASlocationMethods PreProc |
||||||
|
HiLink lsASlogMethods PreProc |
||||||
|
HiLink lsASqMethods PreProc |
||||||
|
HiLink lsASrouteMethods PreProc |
||||||
|
HiLink lsAStimeoutMethods PreProc |
||||||
|
HiLink lsASscopeMethods PreProc |
||||||
|
HiLink lsAScookieStoreMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,95 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularJS for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.1.13.1 |
||||||
|
" URL: http://angularjs.org/ |
||||||
|
|
||||||
|
syntax keyword typescriptAngular angular containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptAngulardot |
||||||
|
syntax match typescriptAngulardot contained /\./ nextgroup=typescriptAngularMethods |
||||||
|
syntax keyword typescriptAngularMethods contained bind bootstrap copy element equals |
||||||
|
syntax keyword typescriptAngularMethods contained extend forEach fromJson identity injector |
||||||
|
syntax keyword typescriptAngularMethods contained isArray isDate isDefined isElement isFunction |
||||||
|
syntax keyword typescriptAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||||
|
syntax keyword typescriptAngularMethods contained mock module noop toJson uppercase version |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $anchorScroll $cacheFactory $compile $controller $document |
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $exceptionHandler $filter $httpBackend |
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $locale $parse $rootElement |
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $routeParams $templateCache $window |
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $cookies $resource $sanitize |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $http nextgroup=typescriptAShttpdot |
||||||
|
syntax match typescriptAShttpdot contained /\./ nextgroup=typescriptAShttpMethods |
||||||
|
syntax keyword typescriptAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $interpolate nextgroup=typescriptASinterpolatedot |
||||||
|
syntax match typescriptASinterpolatedot contained /\./ nextgroup=typescriptASinterpolateMethods |
||||||
|
syntax keyword typescriptASinterpolateMethods contained endSymbol startSymbol |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $location nextgroup=typescriptASlocationdot |
||||||
|
syntax match typescriptASlocationdot contained /\./ nextgroup=typescriptASlocationMethods |
||||||
|
syntax keyword typescriptASlocationMethods contained absUrl hash host path port protocol replace search url |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $log nextgroup=typescriptASlogdot |
||||||
|
syntax match typescriptASlogdot contained /\./ nextgroup=typescriptASlogMethods |
||||||
|
syntax keyword typescriptASlogMethods contained error info log warn |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $q nextgroup=typescriptASqdot |
||||||
|
syntax match typescriptASqdot contained /\./ nextgroup=typescriptASqMethods |
||||||
|
syntax keyword typescriptASqMethods contained all defer reject when |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $route nextgroup=typescriptASroutedot |
||||||
|
syntax match typescriptASroutedot contained /\./ nextgroup=typescriptASrouteMethods |
||||||
|
syntax keyword typescriptASrouteMethods contained reload current route |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $timeout nextgroup=typescriptAStimeoutdot |
||||||
|
syntax match typescriptAStimeoutdot contained /\./ nextgroup=typescriptAStimeoutMethods |
||||||
|
syntax keyword typescriptAStimeoutMethods contained cancel |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $scope $rootScope nextgroup=typescriptASscopedot |
||||||
|
syntax match typescriptASscopedot contained /\./ nextgroup=typescriptASscopeMethods |
||||||
|
syntax keyword typescriptASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||||
|
|
||||||
|
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $cookieStore nextgroup=typescriptAScookieStoredot |
||||||
|
syntax match typescriptAScookieStoredot contained /\./ nextgroup=typescriptAScookieStoreMethods |
||||||
|
syntax keyword typescriptAScookieStoreMethods contained get put remove |
||||||
|
|
||||||
|
syntax cluster typescriptAFunctions contains=typescriptAMFunctions |
||||||
|
syntax cluster typescriptAAttrs contains=typescriptAMAttrs |
||||||
|
|
||||||
|
syntax keyword typescriptAMFunctions contained config constant controller directive factory |
||||||
|
syntax keyword typescriptAMFunctions contained filter provider run service value |
||||||
|
syntax keyword typescriptAMAttrs contained name requires |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularjs_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularjs_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptAngular Constant |
||||||
|
HiLink typescriptAServices Constant |
||||||
|
|
||||||
|
HiLink typescriptAngularMethods PreProc |
||||||
|
HiLink typescriptAMFunctions PreProc |
||||||
|
HiLink typescriptAMAttrs PreProc |
||||||
|
|
||||||
|
HiLink typescriptAShttpMethods PreProc |
||||||
|
HiLink typescriptASinterpolateMethods PreProc |
||||||
|
HiLink typescriptASlocationMethods PreProc |
||||||
|
HiLink typescriptASlogMethods PreProc |
||||||
|
HiLink typescriptASqMethods PreProc |
||||||
|
HiLink typescriptASrouteMethods PreProc |
||||||
|
HiLink typescriptAStimeoutMethods PreProc |
||||||
|
HiLink typescriptASscopeMethods PreProc |
||||||
|
HiLink typescriptAScookieStoreMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,14 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularUI for HTML |
||||||
|
" Maintainer: Tom Vincent <http://tlvince.com/contact> |
||||||
|
" URL: http://angular-ui.github.io |
||||||
|
|
||||||
|
setlocal iskeyword+=- |
||||||
|
|
||||||
|
syntax keyword htmlArg contained ui-view ui-event ui-match ui-include ui-jq |
||||||
|
syntax keyword htmlArg contained ui-keypress ui-keydown ui-keyup ui-options |
||||||
|
syntax keyword htmlArg contained ui-reset ui-route ui-scrollfixed ui-show |
||||||
|
syntax keyword htmlArg contained ui-hide ui-toggle ui-validate ui-date |
||||||
|
syntax keyword htmlArg contained ui-codemirror ui-ace ui-calendar ui-map |
||||||
|
syntax keyword htmlArg contained ui-select2 ui-tinymce ui-sortable ui-sref |
||||||
|
syntax keyword htmlArg contained ui-sref-active |
@ -0,0 +1,44 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularUI Router for coffee |
||||||
|
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||||
|
" URL: http://angular-ui.github.io/ui-router/ |
||||||
|
|
||||||
|
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $stateProvider nextgroup=coffeeASstateProviderdot |
||||||
|
syntax match coffeeASstateProverdot contained /\./ nextgroup=coffeeASstateProviderMethods |
||||||
|
syntax keyword coffeeASstateProviderMethods contained state decorator |
||||||
|
|
||||||
|
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $urlRouterProvider nextgroup=coffeeASurlRouterProviderdot |
||||||
|
syntax match coffeeASstateProverdot contained /\./ nextgroup=coffeeASurlRouterProviderMethods |
||||||
|
syntax keyword coffeeASurlRouterProviderMethods contained when otherwise rule |
||||||
|
|
||||||
|
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $state nextgroup=coffeeASstatedot |
||||||
|
syntax match coffeeASstatedot contained /\./ nextgroup=coffeeASstateMethods |
||||||
|
syntax keyword coffeeASstateMethods contained current get go href includes is reload transitionTo |
||||||
|
|
||||||
|
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $urlRouter nextgroup=coffeeASurlRouterdot |
||||||
|
syntax match coffeeASurlRouterdot contained /\./ nextgroup=coffeeASurlRouterMethods |
||||||
|
syntax keyword coffeeASurlRouterMethods contained href sync |
||||||
|
|
||||||
|
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $stateParams $uiViewScroll |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularui_router_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularui_router_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeUIRouter Constant |
||||||
|
|
||||||
|
HiLink coffeeASstateProviderMethods PreProc |
||||||
|
HiLink coffeeASurlRouterProviderMethods PreProc |
||||||
|
HiLink coffeeASstateMethods PreProc |
||||||
|
HiLink coffeeASurlRouterMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,44 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularUI Router for javascript |
||||||
|
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||||
|
" URL: http://angular-ui.github.io/ui-router/ |
||||||
|
|
||||||
|
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $stateProvider nextgroup=javascriptASstateProviderdot |
||||||
|
syntax match javascriptASstateProverdot contained /\./ nextgroup=javascriptASstateProviderMethods |
||||||
|
syntax keyword javascriptASstateProviderMethods contained state decorator |
||||||
|
|
||||||
|
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $urlRouterProvider nextgroup=javascriptASurlRouterProviderdot |
||||||
|
syntax match javascriptASstateProverdot contained /\./ nextgroup=javascriptASurlRouterProviderMethods |
||||||
|
syntax keyword javascriptASurlRouterProviderMethods contained when otherwise rule |
||||||
|
|
||||||
|
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $state nextgroup=javascriptASstatedot |
||||||
|
syntax match javascriptASstatedot contained /\./ nextgroup=javascriptASstateMethods |
||||||
|
syntax keyword javascriptASstateMethods contained current get go href includes is reload transitionTo |
||||||
|
|
||||||
|
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $urlRouter nextgroup=javascriptASurlRouterdot |
||||||
|
syntax match javascriptASurlRouterdot contained /\./ nextgroup=javascriptASurlRouterMethods |
||||||
|
syntax keyword javascriptASurlRouterMethods contained href sync |
||||||
|
|
||||||
|
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $stateParams $uiViewScroll |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularui_router_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularui_router_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptUIRouter Constant |
||||||
|
|
||||||
|
HiLink javascriptASstateProviderMethods PreProc |
||||||
|
HiLink javascriptASurlRouterProviderMethods PreProc |
||||||
|
HiLink javascriptASstateMethods PreProc |
||||||
|
HiLink javascriptASurlRouterMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,44 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularUI Router for ls |
||||||
|
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||||
|
" URL: http://angular-ui.github.io/ui-router/ |
||||||
|
|
||||||
|
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $stateProvider nextgroup=lsASstateProviderdot |
||||||
|
syntax match lsASstateProverdot contained /\./ nextgroup=lsASstateProviderMethods |
||||||
|
syntax keyword lsASstateProviderMethods contained state decorator |
||||||
|
|
||||||
|
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $urlRouterProvider nextgroup=lsASurlRouterProviderdot |
||||||
|
syntax match lsASstateProverdot contained /\./ nextgroup=lsASurlRouterProviderMethods |
||||||
|
syntax keyword lsASurlRouterProviderMethods contained when otherwise rule |
||||||
|
|
||||||
|
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $state nextgroup=lsASstatedot |
||||||
|
syntax match lsASstatedot contained /\./ nextgroup=lsASstateMethods |
||||||
|
syntax keyword lsASstateMethods contained current get go href includes is reload transitionTo |
||||||
|
|
||||||
|
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $urlRouter nextgroup=lsASurlRouterdot |
||||||
|
syntax match lsASurlRouterdot contained /\./ nextgroup=lsASurlRouterMethods |
||||||
|
syntax keyword lsASurlRouterMethods contained href sync |
||||||
|
|
||||||
|
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $stateParams $uiViewScroll |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularui_router_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularui_router_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsUIRouter Constant |
||||||
|
|
||||||
|
HiLink lsASstateProviderMethods PreProc |
||||||
|
HiLink lsASurlRouterProviderMethods PreProc |
||||||
|
HiLink lsASstateMethods PreProc |
||||||
|
HiLink lsASurlRouterMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,44 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: AngularUI Router for typescript |
||||||
|
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||||
|
" URL: http://angular-ui.github.io/ui-router/ |
||||||
|
|
||||||
|
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $stateProvider nextgroup=typescriptASstateProviderdot |
||||||
|
syntax match typescriptASstateProverdot contained /\./ nextgroup=typescriptASstateProviderMethods |
||||||
|
syntax keyword typescriptASstateProviderMethods contained state decorator |
||||||
|
|
||||||
|
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $urlRouterProvider nextgroup=typescriptASurlRouterProviderdot |
||||||
|
syntax match typescriptASstateProverdot contained /\./ nextgroup=typescriptASurlRouterProviderMethods |
||||||
|
syntax keyword typescriptASurlRouterProviderMethods contained when otherwise rule |
||||||
|
|
||||||
|
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $state nextgroup=typescriptASstatedot |
||||||
|
syntax match typescriptASstatedot contained /\./ nextgroup=typescriptASstateMethods |
||||||
|
syntax keyword typescriptASstateMethods contained current get go href includes is reload transitionTo |
||||||
|
|
||||||
|
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $urlRouter nextgroup=typescriptASurlRouterdot |
||||||
|
syntax match typescriptASurlRouterdot contained /\./ nextgroup=typescriptASurlRouterMethods |
||||||
|
syntax keyword typescriptASurlRouterMethods contained href sync |
||||||
|
|
||||||
|
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $stateParams $uiViewScroll |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_angularui_router_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_angularui_router_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptUIRouter Constant |
||||||
|
|
||||||
|
HiLink typescriptASstateProviderMethods PreProc |
||||||
|
HiLink typescriptASurlRouterProviderMethods PreProc |
||||||
|
HiLink typescriptASstateMethods PreProc |
||||||
|
HiLink typescriptASurlRouterMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,67 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Backbone.js for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/07 |
||||||
|
" Version: 1.2.3 |
||||||
|
" URL: http://backbonejs.org/ |
||||||
|
|
||||||
|
syntax keyword coffeeBackbone Backbone containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution,coffeeBDot |
||||||
|
syntax match coffeeBDot contained /\./ nextgroup=coffeeBObjects |
||||||
|
syntax keyword coffeeBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||||
|
|
||||||
|
syntax cluster coffeeBFunctions contains=coffeeBEvents,coffeeBModel,coffeeBCollection,coffeeBRouter,coffeeBHistory,coffeeBSync,coffeeBView,coffeeBUtility |
||||||
|
syntax cluster coffeeBAttrs contains=coffeeBModelAttrs,coffeeBCollectionAttrs,coffeeBRouterAttrs,coffeeBSyncAttrs,coffeeBViewAttrs |
||||||
|
|
||||||
|
syntax keyword coffeeBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||||
|
syntax keyword coffeeBModel contained extend constructor initialize get set escape has unset clear |
||||||
|
syntax keyword coffeeBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||||
|
syntax keyword coffeeBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||||
|
syntax keyword coffeeBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||||
|
syntax keyword coffeeBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||||
|
syntax keyword coffeeBCollection contained findWhere url parse clone fetch create |
||||||
|
syntax keyword coffeeBRouter contained extend constructor initialize route navigate execute |
||||||
|
syntax keyword coffeeBHistory contained start |
||||||
|
syntax keyword coffeeBSync contained ajax |
||||||
|
syntax keyword coffeeBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||||
|
syntax keyword coffeeBUtility contained noConflict |
||||||
|
|
||||||
|
syntax keyword coffeeBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||||
|
syntax keyword coffeeBCollectionAttrs contained model modelId models length comparator url |
||||||
|
syntax keyword coffeeBRouterAttrs contained routes |
||||||
|
syntax keyword coffeeBViewAttrs contained el attributes events |
||||||
|
syntax keyword coffeeBViewAttrs match /$el/ |
||||||
|
syntax keyword coffeeBViewAttrs match /$/ |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_backbone_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_backbone_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeBackbone Constant |
||||||
|
HiLink coffeeBObjects Constant |
||||||
|
|
||||||
|
HiLink coffeeBEvents PreProc |
||||||
|
HiLink coffeeBModel PreProc |
||||||
|
HiLink coffeeBCollection PreProc |
||||||
|
HiLink coffeeBRouter PreProc |
||||||
|
HiLink coffeeBHistory PreProc |
||||||
|
HiLink coffeeBSync PreProc |
||||||
|
HiLink coffeeBView PreProc |
||||||
|
HiLink coffeeBUtility PreProc |
||||||
|
|
||||||
|
HiLink coffeeBModelAttrs PreProc |
||||||
|
HiLink coffeeBCollectionAttrs PreProc |
||||||
|
HiLink coffeeBRouterAttrs PreProc |
||||||
|
HiLink coffeeBSyncAttrs PreProc |
||||||
|
HiLink coffeeBViewAttrs PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,67 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Backbone.js for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/07 |
||||||
|
" Version: 1.2.3 |
||||||
|
" URL: http://backbonejs.org/ |
||||||
|
|
||||||
|
syntax keyword javascriptBackbone Backbone containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution,javascriptBDot |
||||||
|
syntax match javascriptBDot contained /\./ nextgroup=javascriptBObjects |
||||||
|
syntax keyword javascriptBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||||
|
|
||||||
|
syntax cluster javascriptBFunctions contains=javascriptBEvents,javascriptBModel,javascriptBCollection,javascriptBRouter,javascriptBHistory,javascriptBSync,javascriptBView,javascriptBUtility |
||||||
|
syntax cluster javascriptBAttrs contains=javascriptBModelAttrs,javascriptBCollectionAttrs,javascriptBRouterAttrs,javascriptBSyncAttrs,javascriptBViewAttrs |
||||||
|
|
||||||
|
syntax keyword javascriptBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||||
|
syntax keyword javascriptBModel contained extend constructor initialize get set escape has unset clear |
||||||
|
syntax keyword javascriptBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||||
|
syntax keyword javascriptBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||||
|
syntax keyword javascriptBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||||
|
syntax keyword javascriptBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||||
|
syntax keyword javascriptBCollection contained findWhere url parse clone fetch create |
||||||
|
syntax keyword javascriptBRouter contained extend constructor initialize route navigate execute |
||||||
|
syntax keyword javascriptBHistory contained start |
||||||
|
syntax keyword javascriptBSync contained ajax |
||||||
|
syntax keyword javascriptBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||||
|
syntax keyword javascriptBUtility contained noConflict |
||||||
|
|
||||||
|
syntax keyword javascriptBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||||
|
syntax keyword javascriptBCollectionAttrs contained model modelId models length comparator url |
||||||
|
syntax keyword javascriptBRouterAttrs contained routes |
||||||
|
syntax keyword javascriptBViewAttrs contained el attributes events |
||||||
|
syntax keyword javascriptBViewAttrs match /$el/ |
||||||
|
syntax keyword javascriptBViewAttrs match /$/ |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_backbone_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_backbone_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptBackbone Constant |
||||||
|
HiLink javascriptBObjects Constant |
||||||
|
|
||||||
|
HiLink javascriptBEvents PreProc |
||||||
|
HiLink javascriptBModel PreProc |
||||||
|
HiLink javascriptBCollection PreProc |
||||||
|
HiLink javascriptBRouter PreProc |
||||||
|
HiLink javascriptBHistory PreProc |
||||||
|
HiLink javascriptBSync PreProc |
||||||
|
HiLink javascriptBView PreProc |
||||||
|
HiLink javascriptBUtility PreProc |
||||||
|
|
||||||
|
HiLink javascriptBModelAttrs PreProc |
||||||
|
HiLink javascriptBCollectionAttrs PreProc |
||||||
|
HiLink javascriptBRouterAttrs PreProc |
||||||
|
HiLink javascriptBSyncAttrs PreProc |
||||||
|
HiLink javascriptBViewAttrs PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,67 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Backbone.js for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/07 |
||||||
|
" Version: 1.2.3 |
||||||
|
" URL: http://backbonejs.org/ |
||||||
|
|
||||||
|
syntax keyword lsBackbone Backbone containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution,lsBDot |
||||||
|
syntax match lsBDot contained /\./ nextgroup=lsBObjects |
||||||
|
syntax keyword lsBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||||
|
|
||||||
|
syntax cluster lsBFunctions contains=lsBEvents,lsBModel,lsBCollection,lsBRouter,lsBHistory,lsBSync,lsBView,lsBUtility |
||||||
|
syntax cluster lsBAttrs contains=lsBModelAttrs,lsBCollectionAttrs,lsBRouterAttrs,lsBSyncAttrs,lsBViewAttrs |
||||||
|
|
||||||
|
syntax keyword lsBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||||
|
syntax keyword lsBModel contained extend constructor initialize get set escape has unset clear |
||||||
|
syntax keyword lsBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||||
|
syntax keyword lsBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||||
|
syntax keyword lsBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||||
|
syntax keyword lsBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||||
|
syntax keyword lsBCollection contained findWhere url parse clone fetch create |
||||||
|
syntax keyword lsBRouter contained extend constructor initialize route navigate execute |
||||||
|
syntax keyword lsBHistory contained start |
||||||
|
syntax keyword lsBSync contained ajax |
||||||
|
syntax keyword lsBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||||
|
syntax keyword lsBUtility contained noConflict |
||||||
|
|
||||||
|
syntax keyword lsBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||||
|
syntax keyword lsBCollectionAttrs contained model modelId models length comparator url |
||||||
|
syntax keyword lsBRouterAttrs contained routes |
||||||
|
syntax keyword lsBViewAttrs contained el attributes events |
||||||
|
syntax keyword lsBViewAttrs match /$el/ |
||||||
|
syntax keyword lsBViewAttrs match /$/ |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_backbone_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_backbone_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsBackbone Constant |
||||||
|
HiLink lsBObjects Constant |
||||||
|
|
||||||
|
HiLink lsBEvents PreProc |
||||||
|
HiLink lsBModel PreProc |
||||||
|
HiLink lsBCollection PreProc |
||||||
|
HiLink lsBRouter PreProc |
||||||
|
HiLink lsBHistory PreProc |
||||||
|
HiLink lsBSync PreProc |
||||||
|
HiLink lsBView PreProc |
||||||
|
HiLink lsBUtility PreProc |
||||||
|
|
||||||
|
HiLink lsBModelAttrs PreProc |
||||||
|
HiLink lsBCollectionAttrs PreProc |
||||||
|
HiLink lsBRouterAttrs PreProc |
||||||
|
HiLink lsBSyncAttrs PreProc |
||||||
|
HiLink lsBViewAttrs PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,67 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Backbone.js for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/07 |
||||||
|
" Version: 1.2.3 |
||||||
|
" URL: http://backbonejs.org/ |
||||||
|
|
||||||
|
syntax keyword typescriptBackbone Backbone containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution,typescriptBDot |
||||||
|
syntax match typescriptBDot contained /\./ nextgroup=typescriptBObjects |
||||||
|
syntax keyword typescriptBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||||
|
|
||||||
|
syntax cluster typescriptBFunctions contains=typescriptBEvents,typescriptBModel,typescriptBCollection,typescriptBRouter,typescriptBHistory,typescriptBSync,typescriptBView,typescriptBUtility |
||||||
|
syntax cluster typescriptBAttrs contains=typescriptBModelAttrs,typescriptBCollectionAttrs,typescriptBRouterAttrs,typescriptBSyncAttrs,typescriptBViewAttrs |
||||||
|
|
||||||
|
syntax keyword typescriptBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||||
|
syntax keyword typescriptBModel contained extend constructor initialize get set escape has unset clear |
||||||
|
syntax keyword typescriptBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||||
|
syntax keyword typescriptBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||||
|
syntax keyword typescriptBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||||
|
syntax keyword typescriptBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||||
|
syntax keyword typescriptBCollection contained findWhere url parse clone fetch create |
||||||
|
syntax keyword typescriptBRouter contained extend constructor initialize route navigate execute |
||||||
|
syntax keyword typescriptBHistory contained start |
||||||
|
syntax keyword typescriptBSync contained ajax |
||||||
|
syntax keyword typescriptBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||||
|
syntax keyword typescriptBUtility contained noConflict |
||||||
|
|
||||||
|
syntax keyword typescriptBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||||
|
syntax keyword typescriptBCollectionAttrs contained model modelId models length comparator url |
||||||
|
syntax keyword typescriptBRouterAttrs contained routes |
||||||
|
syntax keyword typescriptBViewAttrs contained el attributes events |
||||||
|
syntax keyword typescriptBViewAttrs match /$el/ |
||||||
|
syntax keyword typescriptBViewAttrs match /$/ |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_backbone_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_backbone_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptBackbone Constant |
||||||
|
HiLink typescriptBObjects Constant |
||||||
|
|
||||||
|
HiLink typescriptBEvents PreProc |
||||||
|
HiLink typescriptBModel PreProc |
||||||
|
HiLink typescriptBCollection PreProc |
||||||
|
HiLink typescriptBRouter PreProc |
||||||
|
HiLink typescriptBHistory PreProc |
||||||
|
HiLink typescriptBSync PreProc |
||||||
|
HiLink typescriptBView PreProc |
||||||
|
HiLink typescriptBUtility PreProc |
||||||
|
|
||||||
|
HiLink typescriptBModelAttrs PreProc |
||||||
|
HiLink typescriptBCollectionAttrs PreProc |
||||||
|
HiLink typescriptBRouterAttrs PreProc |
||||||
|
HiLink typescriptBSyncAttrs PreProc |
||||||
|
HiLink typescriptBViewAttrs PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,49 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: chai.js for coffee |
||||||
|
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||||
|
" Last Change: 2014/03/25 |
||||||
|
" Version: 1.9.2 |
||||||
|
" URL: http://chaijs.com/ |
||||||
|
|
||||||
|
" TDD (assert) |
||||||
|
syntax keyword coffeechai assert |
||||||
|
syntax keyword coffee_asserter fail ok notOk |
||||||
|
syntax keyword coffee_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||||
|
syntax keyword coffee_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||||
|
syntax keyword coffee_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||||
|
syntax keyword coffee_asserter include notInclude match notMatch |
||||||
|
syntax keyword coffee_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||||
|
syntax keyword coffee_asserter lengthOf |
||||||
|
syntax keyword coffee_asserter throws throw Throw doesNotThrow |
||||||
|
syntax keyword coffee_asserter operator closeTo |
||||||
|
syntax keyword coffee_asserter sameMembers includeMembers |
||||||
|
|
||||||
|
" BDD (expect/should) |
||||||
|
syntax keyword coffeechai expect should |
||||||
|
syntax keyword coffee_chain to be been is that and has have with at of same |
||||||
|
syntax keyword coffee_asserter not deep a an include contain |
||||||
|
syntax keyword coffee_asserter ok true false null undefined exist empty |
||||||
|
syntax keyword coffee_asserter arguments Arguments equal equals eq eql eqls |
||||||
|
syntax keyword coffee_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||||
|
syntax keyword coffee_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||||
|
syntax keyword coffee_asserter length lengthOf match string keys key |
||||||
|
syntax keyword coffee_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_chai_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_chai_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeechai Constant |
||||||
|
|
||||||
|
HiLink coffee_chain Comment |
||||||
|
HiLink coffee_asserter PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,49 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: chai.js for javascript |
||||||
|
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||||
|
" Last Change: 2014/03/25 |
||||||
|
" Version: 1.9.2 |
||||||
|
" URL: http://chaijs.com/ |
||||||
|
|
||||||
|
" TDD (assert) |
||||||
|
syntax keyword javascriptchai assert |
||||||
|
syntax keyword javascript_asserter fail ok notOk |
||||||
|
syntax keyword javascript_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||||
|
syntax keyword javascript_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||||
|
syntax keyword javascript_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||||
|
syntax keyword javascript_asserter include notInclude match notMatch |
||||||
|
syntax keyword javascript_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||||
|
syntax keyword javascript_asserter lengthOf |
||||||
|
syntax keyword javascript_asserter throws throw Throw doesNotThrow |
||||||
|
syntax keyword javascript_asserter operator closeTo |
||||||
|
syntax keyword javascript_asserter sameMembers includeMembers |
||||||
|
|
||||||
|
" BDD (expect/should) |
||||||
|
syntax keyword javascriptchai expect should |
||||||
|
syntax keyword javascript_chain to be been is that and has have with at of same |
||||||
|
syntax keyword javascript_asserter not deep a an include contain |
||||||
|
syntax keyword javascript_asserter ok true false null undefined exist empty |
||||||
|
syntax keyword javascript_asserter arguments Arguments equal equals eq eql eqls |
||||||
|
syntax keyword javascript_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||||
|
syntax keyword javascript_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||||
|
syntax keyword javascript_asserter length lengthOf match string keys key |
||||||
|
syntax keyword javascript_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_chai_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_chai_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptchai Constant |
||||||
|
|
||||||
|
HiLink javascript_chain Comment |
||||||
|
HiLink javascript_asserter PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,49 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: chai.js for ls |
||||||
|
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||||
|
" Last Change: 2014/03/25 |
||||||
|
" Version: 1.9.2 |
||||||
|
" URL: http://chaijs.com/ |
||||||
|
|
||||||
|
" TDD (assert) |
||||||
|
syntax keyword lschai assert |
||||||
|
syntax keyword ls_asserter fail ok notOk |
||||||
|
syntax keyword ls_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||||
|
syntax keyword ls_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||||
|
syntax keyword ls_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||||
|
syntax keyword ls_asserter include notInclude match notMatch |
||||||
|
syntax keyword ls_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||||
|
syntax keyword ls_asserter lengthOf |
||||||
|
syntax keyword ls_asserter throws throw Throw doesNotThrow |
||||||
|
syntax keyword ls_asserter operator closeTo |
||||||
|
syntax keyword ls_asserter sameMembers includeMembers |
||||||
|
|
||||||
|
" BDD (expect/should) |
||||||
|
syntax keyword lschai expect should |
||||||
|
syntax keyword ls_chain to be been is that and has have with at of same |
||||||
|
syntax keyword ls_asserter not deep a an include contain |
||||||
|
syntax keyword ls_asserter ok true false null undefined exist empty |
||||||
|
syntax keyword ls_asserter arguments Arguments equal equals eq eql eqls |
||||||
|
syntax keyword ls_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||||
|
syntax keyword ls_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||||
|
syntax keyword ls_asserter length lengthOf match string keys key |
||||||
|
syntax keyword ls_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_chai_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_chai_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lschai Constant |
||||||
|
|
||||||
|
HiLink ls_chain Comment |
||||||
|
HiLink ls_asserter PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,49 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: chai.js for typescript |
||||||
|
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||||
|
" Last Change: 2014/03/25 |
||||||
|
" Version: 1.9.2 |
||||||
|
" URL: http://chaijs.com/ |
||||||
|
|
||||||
|
" TDD (assert) |
||||||
|
syntax keyword typescriptchai assert |
||||||
|
syntax keyword typescript_asserter fail ok notOk |
||||||
|
syntax keyword typescript_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||||
|
syntax keyword typescript_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||||
|
syntax keyword typescript_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||||
|
syntax keyword typescript_asserter include notInclude match notMatch |
||||||
|
syntax keyword typescript_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||||
|
syntax keyword typescript_asserter lengthOf |
||||||
|
syntax keyword typescript_asserter throws throw Throw doesNotThrow |
||||||
|
syntax keyword typescript_asserter operator closeTo |
||||||
|
syntax keyword typescript_asserter sameMembers includeMembers |
||||||
|
|
||||||
|
" BDD (expect/should) |
||||||
|
syntax keyword typescriptchai expect should |
||||||
|
syntax keyword typescript_chain to be been is that and has have with at of same |
||||||
|
syntax keyword typescript_asserter not deep a an include contain |
||||||
|
syntax keyword typescript_asserter ok true false null undefined exist empty |
||||||
|
syntax keyword typescript_asserter arguments Arguments equal equals eq eql eqls |
||||||
|
syntax keyword typescript_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||||
|
syntax keyword typescript_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||||
|
syntax keyword typescript_asserter length lengthOf match string keys key |
||||||
|
syntax keyword typescript_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_chai_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_chai_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptchai Constant |
||||||
|
|
||||||
|
HiLink typescript_chain Comment |
||||||
|
HiLink typescript_asserter PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,31 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Flux for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/30 |
||||||
|
" Version: 2.0.2 |
||||||
|
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||||
|
|
||||||
|
syntax keyword coffeeFlux Dispatcher containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword coffeeFDispatcher contained register unregister waitFor dispatch isDispatching |
||||||
|
|
||||||
|
syntax cluster coffeeFFunction contains=coffeeFDispatcher |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeFlux Constant |
||||||
|
|
||||||
|
HiLink coffeeFDispatcher PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,31 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Flux for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/30 |
||||||
|
" Version: 2.0.2 |
||||||
|
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||||
|
|
||||||
|
syntax keyword javascriptFlux Dispatcher containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword javascriptFDispatcher contained register unregister waitFor dispatch isDispatching |
||||||
|
|
||||||
|
syntax cluster javascriptFFunction contains=javascriptFDispatcher |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptFlux Constant |
||||||
|
|
||||||
|
HiLink javascriptFDispatcher PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,31 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Flux for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/30 |
||||||
|
" Version: 2.0.2 |
||||||
|
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||||
|
|
||||||
|
syntax keyword lsFlux Dispatcher containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword lsFDispatcher contained register unregister waitFor dispatch isDispatching |
||||||
|
|
||||||
|
syntax cluster lsFFunction contains=lsFDispatcher |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsFlux Constant |
||||||
|
|
||||||
|
HiLink lsFDispatcher PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,31 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Flux for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/30 |
||||||
|
" Version: 2.0.2 |
||||||
|
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||||
|
|
||||||
|
syntax keyword typescriptFlux Dispatcher containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword typescriptFDispatcher contained register unregister waitFor dispatch isDispatching |
||||||
|
|
||||||
|
syntax cluster typescriptFFunction contains=typescriptFDispatcher |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptFlux Constant |
||||||
|
|
||||||
|
HiLink typescriptFDispatcher PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,41 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: handlebars for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2015/02/02 |
||||||
|
" Version: 2.0.0 |
||||||
|
" URL: http://handlebarsjs.com/ |
||||||
|
|
||||||
|
syntax keyword coffeeHandlebars Handlebars containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||||
|
" syntax match coffeeunderscoredot contained /\./ nextgroup=@coffee_Functions |
||||||
|
" syntax match coffeeunderscoredot contained /([^)]*)\./ nextgroup=@coffee_Functions |
||||||
|
|
||||||
|
syntax cluster coffeeHFunctions contains=coffeeHmethods,coffeeHutilityMethod |
||||||
|
|
||||||
|
syntax keyword coffeeHmethods contained compile precompile template unregisterPartial registerPartial |
||||||
|
syntax keyword coffeeHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||||
|
syntax keyword coffeeHmethods contained createFrame create log |
||||||
|
|
||||||
|
syntax keyword coffeeHutility contained Utils |
||||||
|
|
||||||
|
syntax keyword coffeeHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeHandlebars Constant |
||||||
|
|
||||||
|
HiLink coffeeHmethods PreProc |
||||||
|
HiLink coffeeHutility PreProc |
||||||
|
HiLink coffeeHutilityMethod PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,41 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: handlebars for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2015/02/02 |
||||||
|
" Version: 2.0.0 |
||||||
|
" URL: http://handlebarsjs.com/ |
||||||
|
|
||||||
|
syntax keyword javascriptHandlebars Handlebars containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||||
|
" syntax match javascriptunderscoredot contained /\./ nextgroup=@javascript_Functions |
||||||
|
" syntax match javascriptunderscoredot contained /([^)]*)\./ nextgroup=@javascript_Functions |
||||||
|
|
||||||
|
syntax cluster javascriptHFunctions contains=javascriptHmethods,javascriptHutilityMethod |
||||||
|
|
||||||
|
syntax keyword javascriptHmethods contained compile precompile template unregisterPartial registerPartial |
||||||
|
syntax keyword javascriptHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||||
|
syntax keyword javascriptHmethods contained createFrame create log |
||||||
|
|
||||||
|
syntax keyword javascriptHutility contained Utils |
||||||
|
|
||||||
|
syntax keyword javascriptHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptHandlebars Constant |
||||||
|
|
||||||
|
HiLink javascriptHmethods PreProc |
||||||
|
HiLink javascriptHutility PreProc |
||||||
|
HiLink javascriptHutilityMethod PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,41 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: handlebars for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2015/02/02 |
||||||
|
" Version: 2.0.0 |
||||||
|
" URL: http://handlebarsjs.com/ |
||||||
|
|
||||||
|
syntax keyword lsHandlebars Handlebars containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||||
|
" syntax match lsunderscoredot contained /\./ nextgroup=@ls_Functions |
||||||
|
" syntax match lsunderscoredot contained /([^)]*)\./ nextgroup=@ls_Functions |
||||||
|
|
||||||
|
syntax cluster lsHFunctions contains=lsHmethods,lsHutilityMethod |
||||||
|
|
||||||
|
syntax keyword lsHmethods contained compile precompile template unregisterPartial registerPartial |
||||||
|
syntax keyword lsHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||||
|
syntax keyword lsHmethods contained createFrame create log |
||||||
|
|
||||||
|
syntax keyword lsHutility contained Utils |
||||||
|
|
||||||
|
syntax keyword lsHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsHandlebars Constant |
||||||
|
|
||||||
|
HiLink lsHmethods PreProc |
||||||
|
HiLink lsHutility PreProc |
||||||
|
HiLink lsHutilityMethod PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,41 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: handlebars for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2015/02/02 |
||||||
|
" Version: 2.0.0 |
||||||
|
" URL: http://handlebarsjs.com/ |
||||||
|
|
||||||
|
syntax keyword typescriptHandlebars Handlebars containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||||
|
" syntax match typescriptunderscoredot contained /\./ nextgroup=@typescript_Functions |
||||||
|
" syntax match typescriptunderscoredot contained /([^)]*)\./ nextgroup=@typescript_Functions |
||||||
|
|
||||||
|
syntax cluster typescriptHFunctions contains=typescriptHmethods,typescriptHutilityMethod |
||||||
|
|
||||||
|
syntax keyword typescriptHmethods contained compile precompile template unregisterPartial registerPartial |
||||||
|
syntax keyword typescriptHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||||
|
syntax keyword typescriptHmethods contained createFrame create log |
||||||
|
|
||||||
|
syntax keyword typescriptHutility contained Utils |
||||||
|
|
||||||
|
syntax keyword typescriptHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptHandlebars Constant |
||||||
|
|
||||||
|
HiLink typescriptHmethods PreProc |
||||||
|
HiLink typescriptHutility PreProc |
||||||
|
HiLink typescriptHutilityMethod PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,64 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jasmine for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/01/31 |
||||||
|
" Version: 2.0 |
||||||
|
" URL: http://jasmine.github.io/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword coffeeJasmine jasmine containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeJdot |
||||||
|
syntax match coffeeJdot contained /\./ nextgroup=coffeeJMethods |
||||||
|
syntax keyword coffeeJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||||
|
|
||||||
|
syntax keyword coffeeJMethods contained tick useMock |
||||||
|
syntax keyword coffeeJMethods contained addReporter specFilter |
||||||
|
|
||||||
|
syntax cluster coffeeJFunctions contains=coffeeJMethods,coffeeJEnvMethods,coffeeJEnvMethods,coffeeJExpectMethods,coffeeJSpyMethods,coffeeJSpyAndMethods,coffeeJSpyCallsMethods |
||||||
|
syntax cluster coffeeJAttrs contains=coffeeJExpectNot,coffeeJSpyAnd,coffeeJSpyCalls |
||||||
|
|
||||||
|
syntax keyword coffeeJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||||
|
|
||||||
|
syntax keyword coffeeJGlobalMethod xdescribe xit containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||||
|
|
||||||
|
syntax keyword coffeeJGlobalMethod spyOn containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||||
|
|
||||||
|
syntax keyword coffeeJSpyAnd and contained |
||||||
|
syntax keyword coffeeJSpyAndMethods returnValue callFake throwError stub contained |
||||||
|
syntax keyword coffeeJSpyCalls calls contained |
||||||
|
syntax keyword coffeeJSpyMethods andReturn andCallThrough callThrough contained |
||||||
|
syntax keyword coffeeJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||||
|
|
||||||
|
syntax keyword coffeeJGlobalMethod expect containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||||
|
syntax keyword coffeeJExpectNot not contained nextgroup=coffeeJExpectNotdot |
||||||
|
|
||||||
|
syntax keyword coffeeJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||||
|
syntax keyword coffeeJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||||
|
syntax keyword coffeeJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeJasmine Constant |
||||||
|
HiLink coffeeJMethods PreProc |
||||||
|
HiLink coffeeJEnvMethods PreProc |
||||||
|
HiLink coffeeJClockMethods PreProc |
||||||
|
HiLink coffeeJGlobalMethod PreProc |
||||||
|
HiLink coffeeJSpyAnd PreProc |
||||||
|
HiLink coffeeJSpyAndMethods PreProc |
||||||
|
HiLink coffeeJSpyCalls PreProc |
||||||
|
HiLink coffeeJSpyMethods PreProc |
||||||
|
HiLink coffeeJCallsMethods PreProc |
||||||
|
HiLink coffeeJExpectNot PreProc |
||||||
|
HiLink coffeeJExpectMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,64 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jasmine for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/01/31 |
||||||
|
" Version: 2.0 |
||||||
|
" URL: http://jasmine.github.io/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword javascriptJasmine jasmine containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptJdot |
||||||
|
syntax match javascriptJdot contained /\./ nextgroup=javascriptJMethods |
||||||
|
syntax keyword javascriptJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||||
|
|
||||||
|
syntax keyword javascriptJMethods contained tick useMock |
||||||
|
syntax keyword javascriptJMethods contained addReporter specFilter |
||||||
|
|
||||||
|
syntax cluster javascriptJFunctions contains=javascriptJMethods,javascriptJEnvMethods,javascriptJEnvMethods,javascriptJExpectMethods,javascriptJSpyMethods,javascriptJSpyAndMethods,javascriptJSpyCallsMethods |
||||||
|
syntax cluster javascriptJAttrs contains=javascriptJExpectNot,javascriptJSpyAnd,javascriptJSpyCalls |
||||||
|
|
||||||
|
syntax keyword javascriptJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||||
|
|
||||||
|
syntax keyword javascriptJGlobalMethod xdescribe xit containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||||
|
|
||||||
|
syntax keyword javascriptJGlobalMethod spyOn containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||||
|
|
||||||
|
syntax keyword javascriptJSpyAnd and contained |
||||||
|
syntax keyword javascriptJSpyAndMethods returnValue callFake throwError stub contained |
||||||
|
syntax keyword javascriptJSpyCalls calls contained |
||||||
|
syntax keyword javascriptJSpyMethods andReturn andCallThrough callThrough contained |
||||||
|
syntax keyword javascriptJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||||
|
|
||||||
|
syntax keyword javascriptJGlobalMethod expect containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||||
|
syntax keyword javascriptJExpectNot not contained nextgroup=javascriptJExpectNotdot |
||||||
|
|
||||||
|
syntax keyword javascriptJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||||
|
syntax keyword javascriptJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||||
|
syntax keyword javascriptJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptJasmine Constant |
||||||
|
HiLink javascriptJMethods PreProc |
||||||
|
HiLink javascriptJEnvMethods PreProc |
||||||
|
HiLink javascriptJClockMethods PreProc |
||||||
|
HiLink javascriptJGlobalMethod PreProc |
||||||
|
HiLink javascriptJSpyAnd PreProc |
||||||
|
HiLink javascriptJSpyAndMethods PreProc |
||||||
|
HiLink javascriptJSpyCalls PreProc |
||||||
|
HiLink javascriptJSpyMethods PreProc |
||||||
|
HiLink javascriptJCallsMethods PreProc |
||||||
|
HiLink javascriptJExpectNot PreProc |
||||||
|
HiLink javascriptJExpectMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,64 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jasmine for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/01/31 |
||||||
|
" Version: 2.0 |
||||||
|
" URL: http://jasmine.github.io/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword lsJasmine jasmine containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsJdot |
||||||
|
syntax match lsJdot contained /\./ nextgroup=lsJMethods |
||||||
|
syntax keyword lsJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||||
|
|
||||||
|
syntax keyword lsJMethods contained tick useMock |
||||||
|
syntax keyword lsJMethods contained addReporter specFilter |
||||||
|
|
||||||
|
syntax cluster lsJFunctions contains=lsJMethods,lsJEnvMethods,lsJEnvMethods,lsJExpectMethods,lsJSpyMethods,lsJSpyAndMethods,lsJSpyCallsMethods |
||||||
|
syntax cluster lsJAttrs contains=lsJExpectNot,lsJSpyAnd,lsJSpyCalls |
||||||
|
|
||||||
|
syntax keyword lsJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||||
|
|
||||||
|
syntax keyword lsJGlobalMethod xdescribe xit containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||||
|
|
||||||
|
syntax keyword lsJGlobalMethod spyOn containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||||
|
|
||||||
|
syntax keyword lsJSpyAnd and contained |
||||||
|
syntax keyword lsJSpyAndMethods returnValue callFake throwError stub contained |
||||||
|
syntax keyword lsJSpyCalls calls contained |
||||||
|
syntax keyword lsJSpyMethods andReturn andCallThrough callThrough contained |
||||||
|
syntax keyword lsJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||||
|
|
||||||
|
syntax keyword lsJGlobalMethod expect containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||||
|
syntax keyword lsJExpectNot not contained nextgroup=lsJExpectNotdot |
||||||
|
|
||||||
|
syntax keyword lsJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||||
|
syntax keyword lsJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||||
|
syntax keyword lsJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsJasmine Constant |
||||||
|
HiLink lsJMethods PreProc |
||||||
|
HiLink lsJEnvMethods PreProc |
||||||
|
HiLink lsJClockMethods PreProc |
||||||
|
HiLink lsJGlobalMethod PreProc |
||||||
|
HiLink lsJSpyAnd PreProc |
||||||
|
HiLink lsJSpyAndMethods PreProc |
||||||
|
HiLink lsJSpyCalls PreProc |
||||||
|
HiLink lsJSpyMethods PreProc |
||||||
|
HiLink lsJCallsMethods PreProc |
||||||
|
HiLink lsJExpectNot PreProc |
||||||
|
HiLink lsJExpectMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,64 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jasmine for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/01/31 |
||||||
|
" Version: 2.0 |
||||||
|
" URL: http://jasmine.github.io/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword typescriptJasmine jasmine containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptJdot |
||||||
|
syntax match typescriptJdot contained /\./ nextgroup=typescriptJMethods |
||||||
|
syntax keyword typescriptJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||||
|
|
||||||
|
syntax keyword typescriptJMethods contained tick useMock |
||||||
|
syntax keyword typescriptJMethods contained addReporter specFilter |
||||||
|
|
||||||
|
syntax cluster typescriptJFunctions contains=typescriptJMethods,typescriptJEnvMethods,typescriptJEnvMethods,typescriptJExpectMethods,typescriptJSpyMethods,typescriptJSpyAndMethods,typescriptJSpyCallsMethods |
||||||
|
syntax cluster typescriptJAttrs contains=typescriptJExpectNot,typescriptJSpyAnd,typescriptJSpyCalls |
||||||
|
|
||||||
|
syntax keyword typescriptJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||||
|
|
||||||
|
syntax keyword typescriptJGlobalMethod xdescribe xit containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||||
|
|
||||||
|
syntax keyword typescriptJGlobalMethod spyOn containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||||
|
|
||||||
|
syntax keyword typescriptJSpyAnd and contained |
||||||
|
syntax keyword typescriptJSpyAndMethods returnValue callFake throwError stub contained |
||||||
|
syntax keyword typescriptJSpyCalls calls contained |
||||||
|
syntax keyword typescriptJSpyMethods andReturn andCallThrough callThrough contained |
||||||
|
syntax keyword typescriptJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||||
|
|
||||||
|
syntax keyword typescriptJGlobalMethod expect containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||||
|
syntax keyword typescriptJExpectNot not contained nextgroup=typescriptJExpectNotdot |
||||||
|
|
||||||
|
syntax keyword typescriptJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||||
|
syntax keyword typescriptJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||||
|
syntax keyword typescriptJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptJasmine Constant |
||||||
|
HiLink typescriptJMethods PreProc |
||||||
|
HiLink typescriptJEnvMethods PreProc |
||||||
|
HiLink typescriptJClockMethods PreProc |
||||||
|
HiLink typescriptJGlobalMethod PreProc |
||||||
|
HiLink typescriptJSpyAnd PreProc |
||||||
|
HiLink typescriptJSpyAndMethods PreProc |
||||||
|
HiLink typescriptJSpyCalls PreProc |
||||||
|
HiLink typescriptJSpyMethods PreProc |
||||||
|
HiLink typescriptJCallsMethods PreProc |
||||||
|
HiLink typescriptJExpectNot PreProc |
||||||
|
HiLink typescriptJExpectMethods PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,124 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jQuery for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 1.9.0.2 |
||||||
|
" URL: http://api.jquery.com/ |
||||||
|
|
||||||
|
setlocal iskeyword-=$ |
||||||
|
if exists("b:current_syntax") && b:current_syntax == 'coffee' |
||||||
|
setlocal iskeyword+=$ |
||||||
|
endif |
||||||
|
|
||||||
|
syntax keyword coffeejQuery jQuery $ containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||||
|
" syntax match coffeejQuerydot contained /\./ nextgroup=@coffeeQGlobals |
||||||
|
" syntax match coffeejQuerydot contained /([^)]*)\./ nextgroup=@coffeeQFunctions |
||||||
|
|
||||||
|
" jQuery.* |
||||||
|
syntax cluster coffeeQGlobals contains=coffeeQCore,coffeeQCoreObj,coffeeQCoreData,coffeeQUtilities,coffeeQProperties |
||||||
|
syntax keyword coffeeQCore contained holdReady noConflict when |
||||||
|
syntax keyword coffeeQCoreObj contained Callback Deferred |
||||||
|
syntax keyword coffeeQCoreData contained data dequeue hasData queue removeData |
||||||
|
syntax keyword coffeeQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||||
|
syntax keyword coffeeQProperties contained context fx.interval fx.off length support cssHooks |
||||||
|
syntax keyword coffeeQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||||
|
syntax match coffeeQUtilities contained /contains/ |
||||||
|
|
||||||
|
" jqobj.* |
||||||
|
syntax cluster coffeeQFunctions contains=@coffeeQGlobals,coffeeQAjax,coffeeQAttributes,coffeeQCallbacks,coffeeQCore,coffeeQCSS,coffeeQData,coffeeQDeferred,coffeeQDimensions,coffeeQEffects,coffeeQEvents,coffeeQManipulation,coffeeQMiscellaneous,coffeeQOffset,coffeeQTraversing,coffeeQUtilities |
||||||
|
syntax keyword coffeeQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||||
|
syntax keyword coffeeQAjax contained serialize serializeArray ajaxTransport load |
||||||
|
syntax keyword coffeeQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||||
|
syntax keyword coffeeQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||||
|
syntax keyword coffeeQCSS contained css |
||||||
|
syntax keyword coffeeQData contained clearQueue data dequeue queue removeData |
||||||
|
syntax keyword coffeeQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||||
|
syntax keyword coffeeQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||||
|
syntax keyword coffeeQEffects contained hide show toggle |
||||||
|
syntax keyword coffeeQEffects contained animate delay stop finish |
||||||
|
syntax keyword coffeeQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||||
|
syntax keyword coffeeQEffects contained slideDown slideToggle slideUp |
||||||
|
syntax keyword coffeeQEvents contained error resize scroll |
||||||
|
syntax keyword coffeeQEvents contained ready unload |
||||||
|
syntax keyword coffeeQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||||
|
syntax keyword coffeeQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||||
|
syntax keyword coffeeQEvents contained blur change focus select submit |
||||||
|
syntax keyword coffeeQEvents contained focusin focusout keydown keypress keyup |
||||||
|
syntax keyword coffeeQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||||
|
syntax keyword coffeeQManipulation contained clone |
||||||
|
syntax keyword coffeeQManipulation contained unwrap wrap wrapAll wrapInner |
||||||
|
syntax keyword coffeeQManipulation contained append appendTo html prepend prependTo text |
||||||
|
syntax keyword coffeeQManipulation contained after before insertAfter insertBefore |
||||||
|
syntax keyword coffeeQManipulation contained detach empty remove |
||||||
|
syntax keyword coffeeQManipulation contained replaceAll replaceWith |
||||||
|
syntax keyword coffeeQMiscellaneous contained index toArray |
||||||
|
syntax keyword coffeeQOffset contained offset offsetParent position scrollTop scrollLeft |
||||||
|
syntax keyword coffeeQTraversing contained eq filter first has is last map not slice |
||||||
|
syntax keyword coffeeQTraversing contained add andBack contents end |
||||||
|
syntax keyword coffeeQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||||
|
|
||||||
|
|
||||||
|
" selector |
||||||
|
" syntax match coffeeASCII contained /\\\d\d\d/ |
||||||
|
" syntax region coffeeString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=coffeeASCII,@jSelectors |
||||||
|
" syntax region coffeeString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=coffeeASCII,@jSelectors |
||||||
|
|
||||||
|
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||||
|
syntax cluster coffeeNoReserved add=@cssSelectors |
||||||
|
syntax match cssId contained containedin=coffeeString /#[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssClass contained containedin=coffeeString /\.[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssOperators contained containedin=coffeeString /*\|>\|+\|-\|\~/ |
||||||
|
syntax match cssBasicFilters contained containedin=coffeeString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||||
|
syntax match cssChildFilters contained containedin=coffeeString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||||
|
syntax match cssChildFilters contained containedin=coffeeString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||||
|
syntax match cssContentFilters contained containedin=coffeeString /:\(contains\|empty\|has\|parent\)/ |
||||||
|
syntax match cssForms contained containedin=coffeeString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||||
|
syntax match cssVisibility contained containedin=coffeeString /:\(hidden\|visible\)/ |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeejQuery Constant |
||||||
|
|
||||||
|
HiLink coffeeQCore PreProc |
||||||
|
HiLink coffeeQCoreObj PreProc |
||||||
|
HiLink coffeeQCoreData PreProc |
||||||
|
|
||||||
|
HiLink coffeeQAjax PreProc |
||||||
|
HiLink coffeeQAttributes PreProc |
||||||
|
HiLink coffeeQCallbacks PreProc |
||||||
|
HiLink coffeeQCSS PreProc |
||||||
|
HiLink coffeeQData PreProc |
||||||
|
HiLink coffeeQDeferred PreProc |
||||||
|
HiLink coffeeQDimensions PreProc |
||||||
|
HiLink coffeeQEffects PreProc |
||||||
|
HiLink coffeeQEvents PreProc |
||||||
|
HiLink coffeeQManipulation PreProc |
||||||
|
HiLink coffeeQMiscellaneous PreProc |
||||||
|
HiLink coffeeQOffset PreProc |
||||||
|
HiLink coffeeQProperties PreProc |
||||||
|
HiLink coffeeQTraversing PreProc |
||||||
|
HiLink coffeeQUtilities PreProc |
||||||
|
|
||||||
|
HiLink cssId Identifier |
||||||
|
HiLink cssClass Constant |
||||||
|
HiLink cssOperators Special |
||||||
|
HiLink cssBasicFilters Statement |
||||||
|
HiLink cssContentFilters Statement |
||||||
|
HiLink cssVisibility Statement |
||||||
|
HiLink cssChildFilters Statement |
||||||
|
HiLink cssForms Statement |
||||||
|
HiLink cssFormFilters Statement |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,124 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jQuery for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 1.9.0.2 |
||||||
|
" URL: http://api.jquery.com/ |
||||||
|
|
||||||
|
setlocal iskeyword-=$ |
||||||
|
if exists("b:current_syntax") && b:current_syntax == 'javascript' |
||||||
|
setlocal iskeyword+=$ |
||||||
|
endif |
||||||
|
|
||||||
|
syntax keyword javascriptjQuery jQuery $ containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||||
|
" syntax match javascriptjQuerydot contained /\./ nextgroup=@javascriptQGlobals |
||||||
|
" syntax match javascriptjQuerydot contained /([^)]*)\./ nextgroup=@javascriptQFunctions |
||||||
|
|
||||||
|
" jQuery.* |
||||||
|
syntax cluster javascriptQGlobals contains=javascriptQCore,javascriptQCoreObj,javascriptQCoreData,javascriptQUtilities,javascriptQProperties |
||||||
|
syntax keyword javascriptQCore contained holdReady noConflict when |
||||||
|
syntax keyword javascriptQCoreObj contained Callback Deferred |
||||||
|
syntax keyword javascriptQCoreData contained data dequeue hasData queue removeData |
||||||
|
syntax keyword javascriptQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||||
|
syntax keyword javascriptQProperties contained context fx.interval fx.off length support cssHooks |
||||||
|
syntax keyword javascriptQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||||
|
syntax match javascriptQUtilities contained /contains/ |
||||||
|
|
||||||
|
" jqobj.* |
||||||
|
syntax cluster javascriptQFunctions contains=@javascriptQGlobals,javascriptQAjax,javascriptQAttributes,javascriptQCallbacks,javascriptQCore,javascriptQCSS,javascriptQData,javascriptQDeferred,javascriptQDimensions,javascriptQEffects,javascriptQEvents,javascriptQManipulation,javascriptQMiscellaneous,javascriptQOffset,javascriptQTraversing,javascriptQUtilities |
||||||
|
syntax keyword javascriptQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||||
|
syntax keyword javascriptQAjax contained serialize serializeArray ajaxTransport load |
||||||
|
syntax keyword javascriptQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||||
|
syntax keyword javascriptQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||||
|
syntax keyword javascriptQCSS contained css |
||||||
|
syntax keyword javascriptQData contained clearQueue data dequeue queue removeData |
||||||
|
syntax keyword javascriptQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||||
|
syntax keyword javascriptQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||||
|
syntax keyword javascriptQEffects contained hide show toggle |
||||||
|
syntax keyword javascriptQEffects contained animate delay stop finish |
||||||
|
syntax keyword javascriptQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||||
|
syntax keyword javascriptQEffects contained slideDown slideToggle slideUp |
||||||
|
syntax keyword javascriptQEvents contained error resize scroll |
||||||
|
syntax keyword javascriptQEvents contained ready unload |
||||||
|
syntax keyword javascriptQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||||
|
syntax keyword javascriptQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||||
|
syntax keyword javascriptQEvents contained blur change focus select submit |
||||||
|
syntax keyword javascriptQEvents contained focusin focusout keydown keypress keyup |
||||||
|
syntax keyword javascriptQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||||
|
syntax keyword javascriptQManipulation contained clone |
||||||
|
syntax keyword javascriptQManipulation contained unwrap wrap wrapAll wrapInner |
||||||
|
syntax keyword javascriptQManipulation contained append appendTo html prepend prependTo text |
||||||
|
syntax keyword javascriptQManipulation contained after before insertAfter insertBefore |
||||||
|
syntax keyword javascriptQManipulation contained detach empty remove |
||||||
|
syntax keyword javascriptQManipulation contained replaceAll replaceWith |
||||||
|
syntax keyword javascriptQMiscellaneous contained index toArray |
||||||
|
syntax keyword javascriptQOffset contained offset offsetParent position scrollTop scrollLeft |
||||||
|
syntax keyword javascriptQTraversing contained eq filter first has is last map not slice |
||||||
|
syntax keyword javascriptQTraversing contained add andBack contents end |
||||||
|
syntax keyword javascriptQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||||
|
|
||||||
|
|
||||||
|
" selector |
||||||
|
" syntax match javascriptASCII contained /\\\d\d\d/ |
||||||
|
" syntax region javascriptString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=javascriptASCII,@jSelectors |
||||||
|
" syntax region javascriptString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=javascriptASCII,@jSelectors |
||||||
|
|
||||||
|
" syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||||
|
" syntax cluster javascriptNoReserved add=@cssSelectors |
||||||
|
" syntax match cssId contained containedin=javascriptString /#[0-9A-Za-z_\-]\+/ |
||||||
|
" syntax match cssClass contained containedin=javascriptString /\.[0-9A-Za-z_\-]\+/ |
||||||
|
" syntax match cssOperators contained containedin=javascriptString /*\|>\|+\|-\|\~/ |
||||||
|
" syntax match cssBasicFilters contained containedin=javascriptString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||||
|
" syntax match cssChildFilters contained containedin=javascriptString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||||
|
" syntax match cssChildFilters contained containedin=javascriptString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||||
|
" syntax match cssContentFilters contained containedin=javascriptString /:\(contains\|empty\|has\|parent\)/ |
||||||
|
" syntax match cssForms contained containedin=javascriptString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||||
|
" syntax match cssVisibility contained containedin=javascriptString /:\(hidden\|visible\)/ |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptjQuery Constant |
||||||
|
|
||||||
|
HiLink javascriptQCore PreProc |
||||||
|
HiLink javascriptQCoreObj PreProc |
||||||
|
HiLink javascriptQCoreData PreProc |
||||||
|
|
||||||
|
HiLink javascriptQAjax PreProc |
||||||
|
HiLink javascriptQAttributes PreProc |
||||||
|
HiLink javascriptQCallbacks PreProc |
||||||
|
HiLink javascriptQCSS PreProc |
||||||
|
HiLink javascriptQData PreProc |
||||||
|
HiLink javascriptQDeferred PreProc |
||||||
|
HiLink javascriptQDimensions PreProc |
||||||
|
HiLink javascriptQEffects PreProc |
||||||
|
HiLink javascriptQEvents PreProc |
||||||
|
HiLink javascriptQManipulation PreProc |
||||||
|
HiLink javascriptQMiscellaneous PreProc |
||||||
|
HiLink javascriptQOffset PreProc |
||||||
|
HiLink javascriptQProperties PreProc |
||||||
|
HiLink javascriptQTraversing PreProc |
||||||
|
HiLink javascriptQUtilities PreProc |
||||||
|
|
||||||
|
" HiLink cssId Identifier |
||||||
|
" HiLink cssClass Constant |
||||||
|
" HiLink cssOperators Special |
||||||
|
" HiLink cssBasicFilters Statement |
||||||
|
" HiLink cssContentFilters Statement |
||||||
|
" HiLink cssVisibility Statement |
||||||
|
" HiLink cssChildFilters Statement |
||||||
|
" HiLink cssForms Statement |
||||||
|
" HiLink cssFormFilters Statement |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,124 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jQuery for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 1.9.0.2 |
||||||
|
" URL: http://api.jquery.com/ |
||||||
|
|
||||||
|
setlocal iskeyword-=$ |
||||||
|
if exists("b:current_syntax") && b:current_syntax == 'ls' |
||||||
|
setlocal iskeyword+=$ |
||||||
|
endif |
||||||
|
|
||||||
|
syntax keyword lsjQuery jQuery $ containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||||
|
" syntax match lsjQuerydot contained /\./ nextgroup=@lsQGlobals |
||||||
|
" syntax match lsjQuerydot contained /([^)]*)\./ nextgroup=@lsQFunctions |
||||||
|
|
||||||
|
" jQuery.* |
||||||
|
syntax cluster lsQGlobals contains=lsQCore,lsQCoreObj,lsQCoreData,lsQUtilities,lsQProperties |
||||||
|
syntax keyword lsQCore contained holdReady noConflict when |
||||||
|
syntax keyword lsQCoreObj contained Callback Deferred |
||||||
|
syntax keyword lsQCoreData contained data dequeue hasData queue removeData |
||||||
|
syntax keyword lsQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||||
|
syntax keyword lsQProperties contained context fx.interval fx.off length support cssHooks |
||||||
|
syntax keyword lsQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||||
|
syntax match lsQUtilities contained /contains/ |
||||||
|
|
||||||
|
" jqobj.* |
||||||
|
syntax cluster lsQFunctions contains=@lsQGlobals,lsQAjax,lsQAttributes,lsQCallbacks,lsQCore,lsQCSS,lsQData,lsQDeferred,lsQDimensions,lsQEffects,lsQEvents,lsQManipulation,lsQMiscellaneous,lsQOffset,lsQTraversing,lsQUtilities |
||||||
|
syntax keyword lsQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||||
|
syntax keyword lsQAjax contained serialize serializeArray ajaxTransport load |
||||||
|
syntax keyword lsQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||||
|
syntax keyword lsQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||||
|
syntax keyword lsQCSS contained css |
||||||
|
syntax keyword lsQData contained clearQueue data dequeue queue removeData |
||||||
|
syntax keyword lsQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||||
|
syntax keyword lsQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||||
|
syntax keyword lsQEffects contained hide show toggle |
||||||
|
syntax keyword lsQEffects contained animate delay stop finish |
||||||
|
syntax keyword lsQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||||
|
syntax keyword lsQEffects contained slideDown slideToggle slideUp |
||||||
|
syntax keyword lsQEvents contained error resize scroll |
||||||
|
syntax keyword lsQEvents contained ready unload |
||||||
|
syntax keyword lsQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||||
|
syntax keyword lsQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||||
|
syntax keyword lsQEvents contained blur change focus select submit |
||||||
|
syntax keyword lsQEvents contained focusin focusout keydown keypress keyup |
||||||
|
syntax keyword lsQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||||
|
syntax keyword lsQManipulation contained clone |
||||||
|
syntax keyword lsQManipulation contained unwrap wrap wrapAll wrapInner |
||||||
|
syntax keyword lsQManipulation contained append appendTo html prepend prependTo text |
||||||
|
syntax keyword lsQManipulation contained after before insertAfter insertBefore |
||||||
|
syntax keyword lsQManipulation contained detach empty remove |
||||||
|
syntax keyword lsQManipulation contained replaceAll replaceWith |
||||||
|
syntax keyword lsQMiscellaneous contained index toArray |
||||||
|
syntax keyword lsQOffset contained offset offsetParent position scrollTop scrollLeft |
||||||
|
syntax keyword lsQTraversing contained eq filter first has is last map not slice |
||||||
|
syntax keyword lsQTraversing contained add andBack contents end |
||||||
|
syntax keyword lsQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||||
|
|
||||||
|
|
||||||
|
" selector |
||||||
|
" syntax match lsASCII contained /\\\d\d\d/ |
||||||
|
" syntax region lsString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=lsASCII,@jSelectors |
||||||
|
" syntax region lsString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=lsASCII,@jSelectors |
||||||
|
|
||||||
|
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||||
|
syntax cluster lsNoReserved add=@cssSelectors |
||||||
|
syntax match cssId contained containedin=lsString /#[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssClass contained containedin=lsString /\.[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssOperators contained containedin=lsString /*\|>\|+\|-\|\~/ |
||||||
|
syntax match cssBasicFilters contained containedin=lsString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||||
|
syntax match cssChildFilters contained containedin=lsString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||||
|
syntax match cssChildFilters contained containedin=lsString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||||
|
syntax match cssContentFilters contained containedin=lsString /:\(contains\|empty\|has\|parent\)/ |
||||||
|
syntax match cssForms contained containedin=lsString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||||
|
syntax match cssVisibility contained containedin=lsString /:\(hidden\|visible\)/ |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsjQuery Constant |
||||||
|
|
||||||
|
HiLink lsQCore PreProc |
||||||
|
HiLink lsQCoreObj PreProc |
||||||
|
HiLink lsQCoreData PreProc |
||||||
|
|
||||||
|
HiLink lsQAjax PreProc |
||||||
|
HiLink lsQAttributes PreProc |
||||||
|
HiLink lsQCallbacks PreProc |
||||||
|
HiLink lsQCSS PreProc |
||||||
|
HiLink lsQData PreProc |
||||||
|
HiLink lsQDeferred PreProc |
||||||
|
HiLink lsQDimensions PreProc |
||||||
|
HiLink lsQEffects PreProc |
||||||
|
HiLink lsQEvents PreProc |
||||||
|
HiLink lsQManipulation PreProc |
||||||
|
HiLink lsQMiscellaneous PreProc |
||||||
|
HiLink lsQOffset PreProc |
||||||
|
HiLink lsQProperties PreProc |
||||||
|
HiLink lsQTraversing PreProc |
||||||
|
HiLink lsQUtilities PreProc |
||||||
|
|
||||||
|
HiLink cssId Identifier |
||||||
|
HiLink cssClass Constant |
||||||
|
HiLink cssOperators Special |
||||||
|
HiLink cssBasicFilters Statement |
||||||
|
HiLink cssContentFilters Statement |
||||||
|
HiLink cssVisibility Statement |
||||||
|
HiLink cssChildFilters Statement |
||||||
|
HiLink cssForms Statement |
||||||
|
HiLink cssFormFilters Statement |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,124 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: jQuery for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 1.9.0.2 |
||||||
|
" URL: http://api.jquery.com/ |
||||||
|
|
||||||
|
setlocal iskeyword-=$ |
||||||
|
if exists("b:current_syntax") && b:current_syntax == 'typescript' |
||||||
|
setlocal iskeyword+=$ |
||||||
|
endif |
||||||
|
|
||||||
|
syntax keyword typescriptjQuery jQuery $ containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||||
|
" syntax match typescriptjQuerydot contained /\./ nextgroup=@typescriptQGlobals |
||||||
|
" syntax match typescriptjQuerydot contained /([^)]*)\./ nextgroup=@typescriptQFunctions |
||||||
|
|
||||||
|
" jQuery.* |
||||||
|
syntax cluster typescriptQGlobals contains=typescriptQCore,typescriptQCoreObj,typescriptQCoreData,typescriptQUtilities,typescriptQProperties |
||||||
|
syntax keyword typescriptQCore contained holdReady noConflict when |
||||||
|
syntax keyword typescriptQCoreObj contained Callback Deferred |
||||||
|
syntax keyword typescriptQCoreData contained data dequeue hasData queue removeData |
||||||
|
syntax keyword typescriptQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||||
|
syntax keyword typescriptQProperties contained context fx.interval fx.off length support cssHooks |
||||||
|
syntax keyword typescriptQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||||
|
syntax match typescriptQUtilities contained /contains/ |
||||||
|
|
||||||
|
" jqobj.* |
||||||
|
syntax cluster typescriptQFunctions contains=@typescriptQGlobals,typescriptQAjax,typescriptQAttributes,typescriptQCallbacks,typescriptQCore,typescriptQCSS,typescriptQData,typescriptQDeferred,typescriptQDimensions,typescriptQEffects,typescriptQEvents,typescriptQManipulation,typescriptQMiscellaneous,typescriptQOffset,typescriptQTraversing,typescriptQUtilities |
||||||
|
syntax keyword typescriptQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||||
|
syntax keyword typescriptQAjax contained serialize serializeArray ajaxTransport load |
||||||
|
syntax keyword typescriptQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||||
|
syntax keyword typescriptQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||||
|
syntax keyword typescriptQCSS contained css |
||||||
|
syntax keyword typescriptQData contained clearQueue data dequeue queue removeData |
||||||
|
syntax keyword typescriptQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||||
|
syntax keyword typescriptQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||||
|
syntax keyword typescriptQEffects contained hide show toggle |
||||||
|
syntax keyword typescriptQEffects contained animate delay stop finish |
||||||
|
syntax keyword typescriptQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||||
|
syntax keyword typescriptQEffects contained slideDown slideToggle slideUp |
||||||
|
syntax keyword typescriptQEvents contained error resize scroll |
||||||
|
syntax keyword typescriptQEvents contained ready unload |
||||||
|
syntax keyword typescriptQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||||
|
syntax keyword typescriptQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||||
|
syntax keyword typescriptQEvents contained blur change focus select submit |
||||||
|
syntax keyword typescriptQEvents contained focusin focusout keydown keypress keyup |
||||||
|
syntax keyword typescriptQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||||
|
syntax keyword typescriptQManipulation contained clone |
||||||
|
syntax keyword typescriptQManipulation contained unwrap wrap wrapAll wrapInner |
||||||
|
syntax keyword typescriptQManipulation contained append appendTo html prepend prependTo text |
||||||
|
syntax keyword typescriptQManipulation contained after before insertAfter insertBefore |
||||||
|
syntax keyword typescriptQManipulation contained detach empty remove |
||||||
|
syntax keyword typescriptQManipulation contained replaceAll replaceWith |
||||||
|
syntax keyword typescriptQMiscellaneous contained index toArray |
||||||
|
syntax keyword typescriptQOffset contained offset offsetParent position scrollTop scrollLeft |
||||||
|
syntax keyword typescriptQTraversing contained eq filter first has is last map not slice |
||||||
|
syntax keyword typescriptQTraversing contained add andBack contents end |
||||||
|
syntax keyword typescriptQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||||
|
|
||||||
|
|
||||||
|
" selector |
||||||
|
" syntax match typescriptASCII contained /\\\d\d\d/ |
||||||
|
" syntax region typescriptString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=typescriptASCII,@jSelectors |
||||||
|
" syntax region typescriptString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=typescriptASCII,@jSelectors |
||||||
|
|
||||||
|
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||||
|
syntax cluster typescriptNoReserved add=@cssSelectors |
||||||
|
syntax match cssId contained containedin=typescriptString /#[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssClass contained containedin=typescriptString /\.[0-9A-Za-z_\-]\+/ |
||||||
|
syntax match cssOperators contained containedin=typescriptString /*\|>\|+\|-\|\~/ |
||||||
|
syntax match cssBasicFilters contained containedin=typescriptString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||||
|
syntax match cssChildFilters contained containedin=typescriptString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||||
|
syntax match cssChildFilters contained containedin=typescriptString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||||
|
syntax match cssContentFilters contained containedin=typescriptString /:\(contains\|empty\|has\|parent\)/ |
||||||
|
syntax match cssForms contained containedin=typescriptString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||||
|
syntax match cssVisibility contained containedin=typescriptString /:\(hidden\|visible\)/ |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptjQuery Constant |
||||||
|
|
||||||
|
HiLink typescriptQCore PreProc |
||||||
|
HiLink typescriptQCoreObj PreProc |
||||||
|
HiLink typescriptQCoreData PreProc |
||||||
|
|
||||||
|
HiLink typescriptQAjax PreProc |
||||||
|
HiLink typescriptQAttributes PreProc |
||||||
|
HiLink typescriptQCallbacks PreProc |
||||||
|
HiLink typescriptQCSS PreProc |
||||||
|
HiLink typescriptQData PreProc |
||||||
|
HiLink typescriptQDeferred PreProc |
||||||
|
HiLink typescriptQDimensions PreProc |
||||||
|
HiLink typescriptQEffects PreProc |
||||||
|
HiLink typescriptQEvents PreProc |
||||||
|
HiLink typescriptQManipulation PreProc |
||||||
|
HiLink typescriptQMiscellaneous PreProc |
||||||
|
HiLink typescriptQOffset PreProc |
||||||
|
HiLink typescriptQProperties PreProc |
||||||
|
HiLink typescriptQTraversing PreProc |
||||||
|
HiLink typescriptQUtilities PreProc |
||||||
|
|
||||||
|
HiLink cssId Identifier |
||||||
|
HiLink cssClass Constant |
||||||
|
HiLink cssOperators Special |
||||||
|
HiLink cssBasicFilters Statement |
||||||
|
HiLink cssContentFilters Statement |
||||||
|
HiLink cssVisibility Statement |
||||||
|
HiLink cssChildFilters Statement |
||||||
|
HiLink cssForms Statement |
||||||
|
HiLink cssFormFilters Statement |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,18 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: JS Lib syntax post process for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/07/01 |
||||||
|
" Version: 0.5 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
" |
||||||
|
|
||||||
|
" work with https://github.com/kchmck/vim-coffee-script |
||||||
|
syntax cluster props add=@coffeeQFunctions,@coffee_Functions,@coffeeBFunctions |
||||||
|
syntax cluster props add=@coffeepFunctions,@coffeeAFunctions,@coffeeSFunctions,@coffeeJFunctions |
||||||
|
syntax cluster props add=@coffeeQAttrs,@coffee_Attrs,@coffeeBAttrs,@coffeepAttrs,@coffeeAAttrs,@coffeeJAttrs |
||||||
|
syntax cluster props add=@coffeeRProp |
||||||
|
" syntax match coffeeLDot /\./ containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString nextgroup=@coffeeLibraryFuncs,@coffeeLibraryAttrs |
||||||
|
" |
||||||
|
syntax region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@coffeeInterpString,@jSelectors |
||||||
|
syntax region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@coffeeBasicString,@jSelectors |
||||||
|
|
@ -0,0 +1,16 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: JS Lib syntax post process for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/07/01 |
||||||
|
" Version: 0.5 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
" |
||||||
|
|
||||||
|
syntax cluster props add=@javascriptQFunctions,@javascript_Functions,@javascriptBFunctions |
||||||
|
syntax cluster props add=@javascriptpFunctions,@javascriptAFunctions,@javascriptSFunctions,@javascriptJFunctions |
||||||
|
syntax cluster props add=@javascriptQAttrs,@javascript_Attrs,@javascriptBAttrs,@javascriptpAttrs,@javascriptAAttrs,@javascriptJAttrs |
||||||
|
syntax cluster props add=@javascriptRProp |
||||||
|
|
||||||
|
if !exists("javascript_props") |
||||||
|
syntax match javascriptLDot /\./ containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptLineComment,javascriptString nextgroup=@props |
||||||
|
endif |
@ -0,0 +1,28 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: JS Lib syntax post process for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/02/25 |
||||||
|
" Version: 0.4 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
" |
||||||
|
|
||||||
|
syntax cluster lsLibraryFuncs contains=@lsQFunctions,@ls_Functions,@lsBFunctions,@lspFunctions,@lsAFunctions |
||||||
|
syntax cluster lsLibraryFuncs contains=@lsSFunctions,@lsJFunctions,@lsRProp |
||||||
|
syntax cluster lsLibraryAttrs contains=@lsQAttrs,@ls_Attrs,@lsBAttrs,@lspAttrs,@lsAAttrs,@lsSAttrs,@lsJAttrs |
||||||
|
" ).fun! |
||||||
|
" ).fun() |
||||||
|
" fun0!fun! |
||||||
|
" fun0!fun() |
||||||
|
" obj.fun! |
||||||
|
" obj.fun() |
||||||
|
" ).fun arg |
||||||
|
" !fun arg |
||||||
|
" obj.fun arg |
||||||
|
syntax match lsLDot /\./ containedin=ALLBUT,lsComment,lsLineComment,lsString contains=@lsLibraryFuncs,@lsLibraryAttrs |
||||||
|
syntax match lsLExp /!/ containedin=ALLBUT,lsComment,lsLineComment,lsString contains=@lsLibraryFuncs,@lsLibraryAttrs |
||||||
|
|
||||||
|
syntax match lsLPipe /|>/ containedin=ALLBUT,lsComment,lsLineComment,lsString skipwhite nextgroup=@lspFunctions |
||||||
|
syntax match lsLCompose />>/ containedin=ALLBUT,lsComment,lsLineComment,lsString skipwhite nextgroup=@lspFunctions |
||||||
|
|
||||||
|
syntax region lsString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@lsInterpString,@jSelectors |
||||||
|
syntax region lsString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@lsSimpleString,@jSelectors |
@ -0,0 +1,11 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: JS Lib syntax post process for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/02/25 |
||||||
|
" Version: 0.4 |
||||||
|
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||||
|
" |
||||||
|
|
||||||
|
syntax cluster typescriptLibraryFuncs contains=@typescriptQFunctions,@typescript_Functions,@typescriptBFunctions,@typescriptpFunctions,@typescriptAFunctions,typescriptSFunctions,typescriptJFunctions,@typescriptRProp |
||||||
|
syntax cluster typescriptLibraryAttrs contains=@typescriptQAttrs,@typescript_Attrs,@typescriptBAttrs,@typescriptpAttrs,@typescriptAAttrs,@typescriptSAttrs,@typescriptJAttrs |
||||||
|
syntax match typescriptLDot /\./ containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString nextgroup=@typescriptLibraryFuncs,@typescriptLibraryAttrs |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 0.6.0 |
||||||
|
" URL: http://gkz.github.com/prelude-ls/ |
||||||
|
|
||||||
|
syntax cluster coffeepFunctions contains=coffeepFunction |
||||||
|
|
||||||
|
syntax keyword coffeepFunction contained map filter reject partition find each head tail last initial |
||||||
|
syntax keyword coffeepFunction contained empty values keys length cons append join reverse fold fold1 |
||||||
|
syntax keyword coffeepFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||||
|
syntax keyword coffeepFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||||
|
syntax keyword coffeepFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||||
|
syntax keyword coffeepFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||||
|
syntax keyword coffeepFunction contained fix lines unlines words unwords max min negate abs signum |
||||||
|
syntax keyword coffeepFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||||
|
syntax keyword coffeepFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||||
|
syntax keyword coffeepFunction contained ceiling floor isItNaN even odd gcd lcm |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeepFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 0.6.0 |
||||||
|
" URL: http://gkz.github.com/prelude-ls/ |
||||||
|
|
||||||
|
syntax cluster javascriptpFunctions contains=javascriptpFunction |
||||||
|
|
||||||
|
syntax keyword javascriptpFunction contained map filter reject partition find each head tail last initial |
||||||
|
syntax keyword javascriptpFunction contained empty values keys length cons append join reverse fold fold1 |
||||||
|
syntax keyword javascriptpFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||||
|
syntax keyword javascriptpFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||||
|
syntax keyword javascriptpFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||||
|
syntax keyword javascriptpFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||||
|
syntax keyword javascriptpFunction contained fix lines unlines words unwords max min negate abs signum |
||||||
|
syntax keyword javascriptpFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||||
|
syntax keyword javascriptpFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||||
|
syntax keyword javascriptpFunction contained ceiling floor isItNaN even odd gcd lcm |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptpFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 0.6.0 |
||||||
|
" URL: http://gkz.github.com/prelude-ls/ |
||||||
|
|
||||||
|
syntax cluster lspFunctions contains=lspFunction |
||||||
|
|
||||||
|
syntax keyword lspFunction contained map filter reject partition find each head tail last initial |
||||||
|
syntax keyword lspFunction contained empty values keys length cons append join reverse fold fold1 |
||||||
|
syntax keyword lspFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||||
|
syntax keyword lspFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||||
|
syntax keyword lspFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||||
|
syntax keyword lspFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||||
|
syntax keyword lspFunction contained fix lines unlines words unwords max min negate abs signum |
||||||
|
syntax keyword lspFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||||
|
syntax keyword lspFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||||
|
syntax keyword lspFunction contained ceiling floor isItNaN even odd gcd lcm |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lspFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 0.6.0 |
||||||
|
" URL: http://gkz.github.com/prelude-ls/ |
||||||
|
|
||||||
|
syntax cluster typescriptpFunctions contains=typescriptpFunction |
||||||
|
|
||||||
|
syntax keyword typescriptpFunction contained map filter reject partition find each head tail last initial |
||||||
|
syntax keyword typescriptpFunction contained empty values keys length cons append join reverse fold fold1 |
||||||
|
syntax keyword typescriptpFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||||
|
syntax keyword typescriptpFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||||
|
syntax keyword typescriptpFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||||
|
syntax keyword typescriptpFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||||
|
syntax keyword typescriptpFunction contained fix lines unlines words unwords max min negate abs signum |
||||||
|
syntax keyword typescriptpFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||||
|
syntax keyword typescriptpFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||||
|
syntax keyword typescriptpFunction contained ceiling floor isItNaN even odd gcd lcm |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptpFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: React for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 0.12.0 |
||||||
|
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||||
|
" URL: https://facebook.github.io/react/docs/component-api.html |
||||||
|
|
||||||
|
syntax keyword coffeeReact React ReactDOM containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword coffeeRTop contained createClass render unmountComponentAtNode renderToString |
||||||
|
syntax keyword coffeeRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||||
|
syntax keyword coffeeRTop contained initializeTouchEvents Children map forEach count only |
||||||
|
syntax keyword coffeeRComponent contained setState replaceState forceUpdate getDOMNode |
||||||
|
syntax keyword coffeeRComponent contained isMounted setProps replaceProps |
||||||
|
|
||||||
|
syntax cluster coffeeRProp contains=coffeeRTop,coffeeRComponent |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeReact Constant |
||||||
|
|
||||||
|
HiLink coffeeRTop PreProc |
||||||
|
HiLink coffeeRComponent PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: React for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 0.12.0 |
||||||
|
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||||
|
" URL: https://facebook.github.io/react/docs/component-api.html |
||||||
|
|
||||||
|
syntax keyword javascriptReact React ReactDOM containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword javascriptRTop contained createClass render unmountComponentAtNode renderToString |
||||||
|
syntax keyword javascriptRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||||
|
syntax keyword javascriptRTop contained initializeTouchEvents Children map forEach count only |
||||||
|
syntax keyword javascriptRComponent contained setState replaceState forceUpdate getDOMNode |
||||||
|
syntax keyword javascriptRComponent contained isMounted setProps replaceProps |
||||||
|
|
||||||
|
syntax cluster javascriptRProp contains=javascriptRTop,javascriptRComponent |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptReact Constant |
||||||
|
|
||||||
|
HiLink javascriptRTop PreProc |
||||||
|
HiLink javascriptRComponent PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: React for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 0.12.0 |
||||||
|
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||||
|
" URL: https://facebook.github.io/react/docs/component-api.html |
||||||
|
|
||||||
|
syntax keyword lsReact React ReactDOM containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword lsRTop contained createClass render unmountComponentAtNode renderToString |
||||||
|
syntax keyword lsRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||||
|
syntax keyword lsRTop contained initializeTouchEvents Children map forEach count only |
||||||
|
syntax keyword lsRComponent contained setState replaceState forceUpdate getDOMNode |
||||||
|
syntax keyword lsRComponent contained isMounted setProps replaceProps |
||||||
|
|
||||||
|
syntax cluster lsRProp contains=lsRTop,lsRComponent |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsReact Constant |
||||||
|
|
||||||
|
HiLink lsRTop PreProc |
||||||
|
HiLink lsRComponent PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,37 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: React for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2014/10/29 |
||||||
|
" Version: 0.12.0 |
||||||
|
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||||
|
" URL: https://facebook.github.io/react/docs/component-api.html |
||||||
|
|
||||||
|
syntax keyword typescriptReact React ReactDOM containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||||
|
|
||||||
|
syntax keyword typescriptRTop contained createClass render unmountComponentAtNode renderToString |
||||||
|
syntax keyword typescriptRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||||
|
syntax keyword typescriptRTop contained initializeTouchEvents Children map forEach count only |
||||||
|
syntax keyword typescriptRComponent contained setState replaceState forceUpdate getDOMNode |
||||||
|
syntax keyword typescriptRComponent contained isMounted setProps replaceProps |
||||||
|
|
||||||
|
syntax cluster typescriptRProp contains=typescriptRTop,typescriptRComponent |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_jquery_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptReact Constant |
||||||
|
|
||||||
|
HiLink typescriptRTop PreProc |
||||||
|
HiLink typescriptRComponent PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,36 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: require.js for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 2.1.4.1 |
||||||
|
" URL: http://requirejs.org/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword coffeeRequire require requirejs containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeRequiredot |
||||||
|
syntax match coffeeRequiredot contained /\./ nextgroup=coffeeRequireMethods |
||||||
|
syntax keyword coffeeRequireMethods contained config |
||||||
|
|
||||||
|
syntax keyword coffeeRdefine define containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString nextgroup=coffeeRdefinedot |
||||||
|
syntax match coffeeRdefinedot contained /\./ nextgroup=coffeeRdefineMethods |
||||||
|
syntax keyword coffeeRdefineMethods contained amd |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeRequire PreProc |
||||||
|
HiLink coffeeRequireMethods PreProc |
||||||
|
HiLink coffeeRdefine PreProc |
||||||
|
HiLink coffeeRdefineMethods PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,36 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: require.js for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 2.1.4.1 |
||||||
|
" URL: http://requirejs.org/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword javascriptRequire require requirejs containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptRequiredot |
||||||
|
syntax match javascriptRequiredot contained /\./ nextgroup=javascriptRequireMethods |
||||||
|
syntax keyword javascriptRequireMethods contained config |
||||||
|
|
||||||
|
syntax keyword javascriptRdefine define containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString nextgroup=javascriptRdefinedot |
||||||
|
syntax match javascriptRdefinedot contained /\./ nextgroup=javascriptRdefineMethods |
||||||
|
syntax keyword javascriptRdefineMethods contained amd |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptRequire PreProc |
||||||
|
HiLink javascriptRequireMethods PreProc |
||||||
|
HiLink javascriptRdefine PreProc |
||||||
|
HiLink javascriptRdefineMethods PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,36 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: require.js for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 2.1.4.1 |
||||||
|
" URL: http://requirejs.org/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword lsRequire require requirejs containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsRequiredot |
||||||
|
syntax match lsRequiredot contained /\./ nextgroup=lsRequireMethods |
||||||
|
syntax keyword lsRequireMethods contained config |
||||||
|
|
||||||
|
syntax keyword lsRdefine define containedin=ALLBUT,lsComment,lsLineComment,lsString nextgroup=lsRdefinedot |
||||||
|
syntax match lsRdefinedot contained /\./ nextgroup=lsRdefineMethods |
||||||
|
syntax keyword lsRdefineMethods contained amd |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsRequire PreProc |
||||||
|
HiLink lsRequireMethods PreProc |
||||||
|
HiLink lsRdefine PreProc |
||||||
|
HiLink lsRdefineMethods PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,36 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: require.js for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 2.1.4.1 |
||||||
|
" URL: http://requirejs.org/ |
||||||
|
|
||||||
|
|
||||||
|
syntax keyword typescriptRequire require requirejs containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptRequiredot |
||||||
|
syntax match typescriptRequiredot contained /\./ nextgroup=typescriptRequireMethods |
||||||
|
syntax keyword typescriptRequireMethods contained config |
||||||
|
|
||||||
|
syntax keyword typescriptRdefine define containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString nextgroup=typescriptRdefinedot |
||||||
|
syntax match typescriptRdefinedot contained /\./ nextgroup=typescriptRdefineMethods |
||||||
|
syntax keyword typescriptRdefineMethods contained amd |
||||||
|
|
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_requirejs_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_requirejs_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptRequire PreProc |
||||||
|
HiLink typescriptRequireMethods PreProc |
||||||
|
HiLink typescriptRdefine PreProc |
||||||
|
HiLink typescriptRdefineMethods PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,90 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.3.9 |
||||||
|
" URL: http://sugarjs.com/ |
||||||
|
" http://sugarjs.com/api |
||||||
|
|
||||||
|
syntax cluster coffeeSFunctions contains=coffeeSFunction |
||||||
|
|
||||||
|
" String |
||||||
|
syntax keyword coffeeSFunction contained add assign at camelize capitalize chars codes compact dasherize decodeBase64 |
||||||
|
syntax keyword coffeeSFunction contained each encodeBase64 endsWith escapeHTML escapeRegExp escapeURL first from hankaku has |
||||||
|
syntax keyword coffeeSFunction contained hasArabic hasCyrillic hasGreek hasHangul hasHan hasKanji hasHebrew hasHiragana hasKana hasKatakana |
||||||
|
syntax keyword coffeeSFunction contained hasLatin hasThai hasDevanagari hiragana humanize insert isBlank isArabic isCyrillic isGreek |
||||||
|
syntax keyword coffeeSFunction contained isHangul isHan isKanji isHebrew isHiragana isKana isKatakana isKatakana isThai isDevanagari |
||||||
|
syntax keyword coffeeSFunction contained katakana last lines normalize pad padLeft padRight paragraphs parameterize plualize |
||||||
|
syntax keyword coffeeSFunction contained remove removeTags repeat reverse shift singularize spacify startsWith stripTags titleize |
||||||
|
syntax keyword coffeeSFunction contained to toNumber trim trimLeft trimRight truncate underscore unescapeHTML unescapeURL words |
||||||
|
syntax keyword coffeeSFunction contained zenkaku |
||||||
|
|
||||||
|
" Number |
||||||
|
syntax keyword coffeeSFunction contained abbr bytes ceil chr downto duration floor format hex isEven |
||||||
|
syntax keyword coffeeSFunction contained isInteger isMultipleOf isOdd log abs sin asin cos acos tan |
||||||
|
syntax keyword coffeeSFunction contained atan sqrt exp pow metric ordinalize pad round times toNumber |
||||||
|
syntax keyword coffeeSFunction contained millisecond milliseconds second seconds minute minutes hour hours day days |
||||||
|
syntax keyword coffeeSFunction contained week weeks month months year years upto |
||||||
|
|
||||||
|
" Array |
||||||
|
|
||||||
|
syntax keyword coffeeSFunction contained create add all any at average clone compact count each |
||||||
|
syntax keyword coffeeSFunction contained every exclude filter find findAll findFrom findIndex findIndexFrom first flatten |
||||||
|
syntax keyword coffeeSFunction contained forEach from groupBy inGroups inGroupsOf include indexOf insert intersect isEmpty |
||||||
|
syntax keyword coffeeSFunction contained last lastIndexOf least map max min most none randomize reduce |
||||||
|
syntax keyword coffeeSFunction contained reduceRight remove removeAt sample some sortBy subtract sum to union |
||||||
|
syntax keyword coffeeSFunction contained unique zip |
||||||
|
|
||||||
|
" Object |
||||||
|
|
||||||
|
syntax keyword coffeeSFunction contained extended fromQueryString isArray isObject isBoolean isDate isFunction isNaN isNumber isString |
||||||
|
syntax keyword coffeeSFunction contained isRegExp toQueryString clone each map any all none count find |
||||||
|
syntax keyword coffeeSFunction contained findAll reduce isEmpty sum average min max least most equal |
||||||
|
syntax keyword coffeeSFunction contained has keys merge reject select size tap values watch |
||||||
|
|
||||||
|
" Function |
||||||
|
|
||||||
|
syntax keyword coffeeSFunction contained after bind cancel debounce delay everyfill lazyredrawonce throttle |
||||||
|
|
||||||
|
" RegExp |
||||||
|
|
||||||
|
syntax keyword coffeeSFunction contained escape addFlag getFlags removeFlag setFlags |
||||||
|
|
||||||
|
" Date |
||||||
|
syntax keyword coffeeSFunction contained addLocale create future getLocale now past range setLocale addMilliseconds addSeconds |
||||||
|
syntax keyword coffeeSFunction contained addMinutes addHours addDays addWeeks addMonths addYears advance beginningOfDay beginningOfWeek beginningOfMonth |
||||||
|
syntax keyword coffeeSFunction contained beginningOfYear clone daysInMonth endOfDay endOfWeek endOfMonth endOfYear format getISOWeek getUTCOffset |
||||||
|
syntax keyword coffeeSFunction contained getWeekday is isAfter isBefore isBetween isToday isYesterday isTomorrow isWeekday isWeekend |
||||||
|
syntax keyword coffeeSFunction contained isSunday isMonday isTuesday isWednesday isThursday isFriday isSaturday isFuture isLastWeek isLastMonth |
||||||
|
syntax keyword coffeeSFunction contained isLastYear isPast isThisWeek isThisMonth isThisYear isUTC isValid iso relative reset |
||||||
|
syntax keyword coffeeSFunction contained rewind set setISOWeek setWeekday toISOString toJSON millisecondsSince secondsSince minutesSince hoursSince |
||||||
|
syntax keyword coffeeSFunction contained daysSince weeksSince monthsSince yearsSince millisecondsUntil secondsUntil minutesUntil hoursUntil daysUntil weeksUntil |
||||||
|
syntax keyword coffeeSFunction contained monthsUntil yearsUntil millisecondAfter millisecondsAfter secondAfter secondsAfter minuteAfter minutesAfter hourAfter hoursAfter |
||||||
|
syntax keyword coffeeSFunction contained dayAfter daysAfter weekAfter weeksAfter monthAfter monthsAfter yearAfter yearsAfter millisecondAgo millisecondsAgo |
||||||
|
syntax keyword coffeeSFunction contained secondAgo secondsAgo minuteAgo minutesAgo hourAgo hoursAgo dayAgo daysAgo weekAgo weeksAgo |
||||||
|
syntax keyword coffeeSFunction contained monthAgo monthsAgo yearAgo yearsAgo millisecondBefore millisecondsBefore secondBefore secondsBefore minuteBefore minutesBefore |
||||||
|
syntax keyword coffeeSFunction contained hourBefore hoursBefore dayBefore daysBefore weekBefore weeksBefore monthBefore monthsBefore yearBefore yearsBefore |
||||||
|
syntax keyword coffeeSFunction contained millisecondFromNow millisecondsFromNow secondFromNow secondsFromNow minuteFromNow minutesFromNow hourFromNow hoursFromNow dayFromNow daysFromNow |
||||||
|
syntax keyword coffeeSFunction contained weekFromNow weeksFromNow monthFromNow monthsFromNow yearFromNow yearsFromNow utc |
||||||
|
|
||||||
|
" Range |
||||||
|
|
||||||
|
syntax keyword coffeeSFunction contained clamp clone every intersect isValid span toString union |
||||||
|
syntax keyword coffeeSFunction contained contain[s] |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeSFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,90 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.3.9 |
||||||
|
" URL: http://sugarjs.com/ |
||||||
|
" http://sugarjs.com/api |
||||||
|
|
||||||
|
syntax cluster javascriptSFunctions contains=javascriptSFunction |
||||||
|
|
||||||
|
" String |
||||||
|
syntax keyword javascriptSFunction contained add assign at camelize capitalize chars codes compact dasherize decodeBase64 |
||||||
|
syntax keyword javascriptSFunction contained each encodeBase64 endsWith escapeHTML escapeRegExp escapeURL first from hankaku has |
||||||
|
syntax keyword javascriptSFunction contained hasArabic hasCyrillic hasGreek hasHangul hasHan hasKanji hasHebrew hasHiragana hasKana hasKatakana |
||||||
|
syntax keyword javascriptSFunction contained hasLatin hasThai hasDevanagari hiragana humanize insert isBlank isArabic isCyrillic isGreek |
||||||
|
syntax keyword javascriptSFunction contained isHangul isHan isKanji isHebrew isHiragana isKana isKatakana isKatakana isThai isDevanagari |
||||||
|
syntax keyword javascriptSFunction contained katakana last lines normalize pad padLeft padRight paragraphs parameterize plualize |
||||||
|
syntax keyword javascriptSFunction contained remove removeTags repeat reverse shift singularize spacify startsWith stripTags titleize |
||||||
|
syntax keyword javascriptSFunction contained to toNumber trim trimLeft trimRight truncate underscore unescapeHTML unescapeURL words |
||||||
|
syntax keyword javascriptSFunction contained zenkaku |
||||||
|
|
||||||
|
" Number |
||||||
|
syntax keyword javascriptSFunction contained abbr bytes ceil chr downto duration floor format hex isEven |
||||||
|
syntax keyword javascriptSFunction contained isInteger isMultipleOf isOdd log abs sin asin cos acos tan |
||||||
|
syntax keyword javascriptSFunction contained atan sqrt exp pow metric ordinalize pad round times toNumber |
||||||
|
syntax keyword javascriptSFunction contained millisecond milliseconds second seconds minute minutes hour hours day days |
||||||
|
syntax keyword javascriptSFunction contained week weeks month months year years upto |
||||||
|
|
||||||
|
" Array |
||||||
|
|
||||||
|
syntax keyword javascriptSFunction contained create add all any at average clone compact count each |
||||||
|
syntax keyword javascriptSFunction contained every exclude filter find findAll findFrom findIndex findIndexFrom first flatten |
||||||
|
syntax keyword javascriptSFunction contained forEach from groupBy inGroups inGroupsOf include indexOf insert intersect isEmpty |
||||||
|
syntax keyword javascriptSFunction contained last lastIndexOf least map max min most none randomize reduce |
||||||
|
syntax keyword javascriptSFunction contained reduceRight remove removeAt sample some sortBy subtract sum to union |
||||||
|
syntax keyword javascriptSFunction contained unique zip |
||||||
|
|
||||||
|
" Object |
||||||
|
|
||||||
|
syntax keyword javascriptSFunction contained extended fromQueryString isArray isObject isBoolean isDate isFunction isNaN isNumber isString |
||||||
|
syntax keyword javascriptSFunction contained isRegExp toQueryString clone each map any all none count find |
||||||
|
syntax keyword javascriptSFunction contained findAll reduce isEmpty sum average min max least most equal |
||||||
|
syntax keyword javascriptSFunction contained has keys merge reject select size tap values watch |
||||||
|
|
||||||
|
" Function |
||||||
|
|
||||||
|
syntax keyword javascriptSFunction contained after bind cancel debounce delay everyfill lazyredrawonce throttle |
||||||
|
|
||||||
|
" RegExp |
||||||
|
|
||||||
|
syntax keyword javascriptSFunction contained escape addFlag getFlags removeFlag setFlags |
||||||
|
|
||||||
|
" Date |
||||||
|
syntax keyword javascriptSFunction contained addLocale create future getLocale now past range setLocale addMilliseconds addSeconds |
||||||
|
syntax keyword javascriptSFunction contained addMinutes addHours addDays addWeeks addMonths addYears advance beginningOfDay beginningOfWeek beginningOfMonth |
||||||
|
syntax keyword javascriptSFunction contained beginningOfYear clone daysInMonth endOfDay endOfWeek endOfMonth endOfYear format getISOWeek getUTCOffset |
||||||
|
syntax keyword javascriptSFunction contained getWeekday is isAfter isBefore isBetween isToday isYesterday isTomorrow isWeekday isWeekend |
||||||
|
syntax keyword javascriptSFunction contained isSunday isMonday isTuesday isWednesday isThursday isFriday isSaturday isFuture isLastWeek isLastMonth |
||||||
|
syntax keyword javascriptSFunction contained isLastYear isPast isThisWeek isThisMonth isThisYear isUTC isValid iso relative reset |
||||||
|
syntax keyword javascriptSFunction contained rewind set setISOWeek setWeekday toISOString toJSON millisecondsSince secondsSince minutesSince hoursSince |
||||||
|
syntax keyword javascriptSFunction contained daysSince weeksSince monthsSince yearsSince millisecondsUntil secondsUntil minutesUntil hoursUntil daysUntil weeksUntil |
||||||
|
syntax keyword javascriptSFunction contained monthsUntil yearsUntil millisecondAfter millisecondsAfter secondAfter secondsAfter minuteAfter minutesAfter hourAfter hoursAfter |
||||||
|
syntax keyword javascriptSFunction contained dayAfter daysAfter weekAfter weeksAfter monthAfter monthsAfter yearAfter yearsAfter millisecondAgo millisecondsAgo |
||||||
|
syntax keyword javascriptSFunction contained secondAgo secondsAgo minuteAgo minutesAgo hourAgo hoursAgo dayAgo daysAgo weekAgo weeksAgo |
||||||
|
syntax keyword javascriptSFunction contained monthAgo monthsAgo yearAgo yearsAgo millisecondBefore millisecondsBefore secondBefore secondsBefore minuteBefore minutesBefore |
||||||
|
syntax keyword javascriptSFunction contained hourBefore hoursBefore dayBefore daysBefore weekBefore weeksBefore monthBefore monthsBefore yearBefore yearsBefore |
||||||
|
syntax keyword javascriptSFunction contained millisecondFromNow millisecondsFromNow secondFromNow secondsFromNow minuteFromNow minutesFromNow hourFromNow hoursFromNow dayFromNow daysFromNow |
||||||
|
syntax keyword javascriptSFunction contained weekFromNow weeksFromNow monthFromNow monthsFromNow yearFromNow yearsFromNow utc |
||||||
|
|
||||||
|
" Range |
||||||
|
|
||||||
|
syntax keyword javascriptSFunction contained clamp clone every intersect isValid span toString union |
||||||
|
syntax keyword javascriptSFunction contained contain[s] |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptSFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,90 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.3.9 |
||||||
|
" URL: http://sugarjs.com/ |
||||||
|
" http://sugarjs.com/api |
||||||
|
|
||||||
|
syntax cluster lsSFunctions contains=lsSFunction |
||||||
|
|
||||||
|
" String |
||||||
|
syntax keyword lsSFunction contained add assign at camelize capitalize chars codes compact dasherize decodeBase64 |
||||||
|
syntax keyword lsSFunction contained each encodeBase64 endsWith escapeHTML escapeRegExp escapeURL first from hankaku has |
||||||
|
syntax keyword lsSFunction contained hasArabic hasCyrillic hasGreek hasHangul hasHan hasKanji hasHebrew hasHiragana hasKana hasKatakana |
||||||
|
syntax keyword lsSFunction contained hasLatin hasThai hasDevanagari hiragana humanize insert isBlank isArabic isCyrillic isGreek |
||||||
|
syntax keyword lsSFunction contained isHangul isHan isKanji isHebrew isHiragana isKana isKatakana isKatakana isThai isDevanagari |
||||||
|
syntax keyword lsSFunction contained katakana last lines normalize pad padLeft padRight paragraphs parameterize plualize |
||||||
|
syntax keyword lsSFunction contained remove removeTags repeat reverse shift singularize spacify startsWith stripTags titleize |
||||||
|
syntax keyword lsSFunction contained to toNumber trim trimLeft trimRight truncate underscore unescapeHTML unescapeURL words |
||||||
|
syntax keyword lsSFunction contained zenkaku |
||||||
|
|
||||||
|
" Number |
||||||
|
syntax keyword lsSFunction contained abbr bytes ceil chr downto duration floor format hex isEven |
||||||
|
syntax keyword lsSFunction contained isInteger isMultipleOf isOdd log abs sin asin cos acos tan |
||||||
|
syntax keyword lsSFunction contained atan sqrt exp pow metric ordinalize pad round times toNumber |
||||||
|
syntax keyword lsSFunction contained millisecond milliseconds second seconds minute minutes hour hours day days |
||||||
|
syntax keyword lsSFunction contained week weeks month months year years upto |
||||||
|
|
||||||
|
" Array |
||||||
|
|
||||||
|
syntax keyword lsSFunction contained create add all any at average clone compact count each |
||||||
|
syntax keyword lsSFunction contained every exclude filter find findAll findFrom findIndex findIndexFrom first flatten |
||||||
|
syntax keyword lsSFunction contained forEach from groupBy inGroups inGroupsOf include indexOf insert intersect isEmpty |
||||||
|
syntax keyword lsSFunction contained last lastIndexOf least map max min most none randomize reduce |
||||||
|
syntax keyword lsSFunction contained reduceRight remove removeAt sample some sortBy subtract sum to union |
||||||
|
syntax keyword lsSFunction contained unique zip |
||||||
|
|
||||||
|
" Object |
||||||
|
|
||||||
|
syntax keyword lsSFunction contained extended fromQueryString isArray isObject isBoolean isDate isFunction isNaN isNumber isString |
||||||
|
syntax keyword lsSFunction contained isRegExp toQueryString clone each map any all none count find |
||||||
|
syntax keyword lsSFunction contained findAll reduce isEmpty sum average min max least most equal |
||||||
|
syntax keyword lsSFunction contained has keys merge reject select size tap values watch |
||||||
|
|
||||||
|
" Function |
||||||
|
|
||||||
|
syntax keyword lsSFunction contained after bind cancel debounce delay everyfill lazyredrawonce throttle |
||||||
|
|
||||||
|
" RegExp |
||||||
|
|
||||||
|
syntax keyword lsSFunction contained escape addFlag getFlags removeFlag setFlags |
||||||
|
|
||||||
|
" Date |
||||||
|
syntax keyword lsSFunction contained addLocale create future getLocale now past range setLocale addMilliseconds addSeconds |
||||||
|
syntax keyword lsSFunction contained addMinutes addHours addDays addWeeks addMonths addYears advance beginningOfDay beginningOfWeek beginningOfMonth |
||||||
|
syntax keyword lsSFunction contained beginningOfYear clone daysInMonth endOfDay endOfWeek endOfMonth endOfYear format getISOWeek getUTCOffset |
||||||
|
syntax keyword lsSFunction contained getWeekday is isAfter isBefore isBetween isToday isYesterday isTomorrow isWeekday isWeekend |
||||||
|
syntax keyword lsSFunction contained isSunday isMonday isTuesday isWednesday isThursday isFriday isSaturday isFuture isLastWeek isLastMonth |
||||||
|
syntax keyword lsSFunction contained isLastYear isPast isThisWeek isThisMonth isThisYear isUTC isValid iso relative reset |
||||||
|
syntax keyword lsSFunction contained rewind set setISOWeek setWeekday toISOString toJSON millisecondsSince secondsSince minutesSince hoursSince |
||||||
|
syntax keyword lsSFunction contained daysSince weeksSince monthsSince yearsSince millisecondsUntil secondsUntil minutesUntil hoursUntil daysUntil weeksUntil |
||||||
|
syntax keyword lsSFunction contained monthsUntil yearsUntil millisecondAfter millisecondsAfter secondAfter secondsAfter minuteAfter minutesAfter hourAfter hoursAfter |
||||||
|
syntax keyword lsSFunction contained dayAfter daysAfter weekAfter weeksAfter monthAfter monthsAfter yearAfter yearsAfter millisecondAgo millisecondsAgo |
||||||
|
syntax keyword lsSFunction contained secondAgo secondsAgo minuteAgo minutesAgo hourAgo hoursAgo dayAgo daysAgo weekAgo weeksAgo |
||||||
|
syntax keyword lsSFunction contained monthAgo monthsAgo yearAgo yearsAgo millisecondBefore millisecondsBefore secondBefore secondsBefore minuteBefore minutesBefore |
||||||
|
syntax keyword lsSFunction contained hourBefore hoursBefore dayBefore daysBefore weekBefore weeksBefore monthBefore monthsBefore yearBefore yearsBefore |
||||||
|
syntax keyword lsSFunction contained millisecondFromNow millisecondsFromNow secondFromNow secondsFromNow minuteFromNow minutesFromNow hourFromNow hoursFromNow dayFromNow daysFromNow |
||||||
|
syntax keyword lsSFunction contained weekFromNow weeksFromNow monthFromNow monthsFromNow yearFromNow yearsFromNow utc |
||||||
|
|
||||||
|
" Range |
||||||
|
|
||||||
|
syntax keyword lsSFunction contained clamp clone every intersect isValid span toString union |
||||||
|
syntax keyword lsSFunction contained contain[s] |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsSFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,90 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: prelude.ls for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2013/07/26 |
||||||
|
" Version: 1.3.9 |
||||||
|
" URL: http://sugarjs.com/ |
||||||
|
" http://sugarjs.com/api |
||||||
|
|
||||||
|
syntax cluster typescriptSFunctions contains=typescriptSFunction |
||||||
|
|
||||||
|
" String |
||||||
|
syntax keyword typescriptSFunction contained add assign at camelize capitalize chars codes compact dasherize decodeBase64 |
||||||
|
syntax keyword typescriptSFunction contained each encodeBase64 endsWith escapeHTML escapeRegExp escapeURL first from hankaku has |
||||||
|
syntax keyword typescriptSFunction contained hasArabic hasCyrillic hasGreek hasHangul hasHan hasKanji hasHebrew hasHiragana hasKana hasKatakana |
||||||
|
syntax keyword typescriptSFunction contained hasLatin hasThai hasDevanagari hiragana humanize insert isBlank isArabic isCyrillic isGreek |
||||||
|
syntax keyword typescriptSFunction contained isHangul isHan isKanji isHebrew isHiragana isKana isKatakana isKatakana isThai isDevanagari |
||||||
|
syntax keyword typescriptSFunction contained katakana last lines normalize pad padLeft padRight paragraphs parameterize plualize |
||||||
|
syntax keyword typescriptSFunction contained remove removeTags repeat reverse shift singularize spacify startsWith stripTags titleize |
||||||
|
syntax keyword typescriptSFunction contained to toNumber trim trimLeft trimRight truncate underscore unescapeHTML unescapeURL words |
||||||
|
syntax keyword typescriptSFunction contained zenkaku |
||||||
|
|
||||||
|
" Number |
||||||
|
syntax keyword typescriptSFunction contained abbr bytes ceil chr downto duration floor format hex isEven |
||||||
|
syntax keyword typescriptSFunction contained isInteger isMultipleOf isOdd log abs sin asin cos acos tan |
||||||
|
syntax keyword typescriptSFunction contained atan sqrt exp pow metric ordinalize pad round times toNumber |
||||||
|
syntax keyword typescriptSFunction contained millisecond milliseconds second seconds minute minutes hour hours day days |
||||||
|
syntax keyword typescriptSFunction contained week weeks month months year years upto |
||||||
|
|
||||||
|
" Array |
||||||
|
|
||||||
|
syntax keyword typescriptSFunction contained create add all any at average clone compact count each |
||||||
|
syntax keyword typescriptSFunction contained every exclude filter find findAll findFrom findIndex findIndexFrom first flatten |
||||||
|
syntax keyword typescriptSFunction contained forEach from groupBy inGroups inGroupsOf include indexOf insert intersect isEmpty |
||||||
|
syntax keyword typescriptSFunction contained last lastIndexOf least map max min most none randomize reduce |
||||||
|
syntax keyword typescriptSFunction contained reduceRight remove removeAt sample some sortBy subtract sum to union |
||||||
|
syntax keyword typescriptSFunction contained unique zip |
||||||
|
|
||||||
|
" Object |
||||||
|
|
||||||
|
syntax keyword typescriptSFunction contained extended fromQueryString isArray isObject isBoolean isDate isFunction isNaN isNumber isString |
||||||
|
syntax keyword typescriptSFunction contained isRegExp toQueryString clone each map any all none count find |
||||||
|
syntax keyword typescriptSFunction contained findAll reduce isEmpty sum average min max least most equal |
||||||
|
syntax keyword typescriptSFunction contained has keys merge reject select size tap values watch |
||||||
|
|
||||||
|
" Function |
||||||
|
|
||||||
|
syntax keyword typescriptSFunction contained after bind cancel debounce delay everyfill lazyredrawonce throttle |
||||||
|
|
||||||
|
" RegExp |
||||||
|
|
||||||
|
syntax keyword typescriptSFunction contained escape addFlag getFlags removeFlag setFlags |
||||||
|
|
||||||
|
" Date |
||||||
|
syntax keyword typescriptSFunction contained addLocale create future getLocale now past range setLocale addMilliseconds addSeconds |
||||||
|
syntax keyword typescriptSFunction contained addMinutes addHours addDays addWeeks addMonths addYears advance beginningOfDay beginningOfWeek beginningOfMonth |
||||||
|
syntax keyword typescriptSFunction contained beginningOfYear clone daysInMonth endOfDay endOfWeek endOfMonth endOfYear format getISOWeek getUTCOffset |
||||||
|
syntax keyword typescriptSFunction contained getWeekday is isAfter isBefore isBetween isToday isYesterday isTomorrow isWeekday isWeekend |
||||||
|
syntax keyword typescriptSFunction contained isSunday isMonday isTuesday isWednesday isThursday isFriday isSaturday isFuture isLastWeek isLastMonth |
||||||
|
syntax keyword typescriptSFunction contained isLastYear isPast isThisWeek isThisMonth isThisYear isUTC isValid iso relative reset |
||||||
|
syntax keyword typescriptSFunction contained rewind set setISOWeek setWeekday toISOString toJSON millisecondsSince secondsSince minutesSince hoursSince |
||||||
|
syntax keyword typescriptSFunction contained daysSince weeksSince monthsSince yearsSince millisecondsUntil secondsUntil minutesUntil hoursUntil daysUntil weeksUntil |
||||||
|
syntax keyword typescriptSFunction contained monthsUntil yearsUntil millisecondAfter millisecondsAfter secondAfter secondsAfter minuteAfter minutesAfter hourAfter hoursAfter |
||||||
|
syntax keyword typescriptSFunction contained dayAfter daysAfter weekAfter weeksAfter monthAfter monthsAfter yearAfter yearsAfter millisecondAgo millisecondsAgo |
||||||
|
syntax keyword typescriptSFunction contained secondAgo secondsAgo minuteAgo minutesAgo hourAgo hoursAgo dayAgo daysAgo weekAgo weeksAgo |
||||||
|
syntax keyword typescriptSFunction contained monthAgo monthsAgo yearAgo yearsAgo millisecondBefore millisecondsBefore secondBefore secondsBefore minuteBefore minutesBefore |
||||||
|
syntax keyword typescriptSFunction contained hourBefore hoursBefore dayBefore daysBefore weekBefore weeksBefore monthBefore monthsBefore yearBefore yearsBefore |
||||||
|
syntax keyword typescriptSFunction contained millisecondFromNow millisecondsFromNow secondFromNow secondsFromNow minuteFromNow minutesFromNow hourFromNow hoursFromNow dayFromNow daysFromNow |
||||||
|
syntax keyword typescriptSFunction contained weekFromNow weeksFromNow monthFromNow monthsFromNow yearFromNow yearsFromNow utc |
||||||
|
|
||||||
|
" Range |
||||||
|
|
||||||
|
syntax keyword typescriptSFunction contained clamp clone every intersect isValid span toString union |
||||||
|
syntax keyword typescriptSFunction contained contain[s] |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_prelude_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_prelude_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptSFunction PreProc |
||||||
|
|
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,128 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: underscore.js for coffee |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/18 |
||||||
|
" Version: 1.7.0 |
||||||
|
" URL: http://underscorejs.org/ |
||||||
|
" LoDash: 4.0.0 |
||||||
|
" URL: http://lodash.com/ |
||||||
|
|
||||||
|
syntax keyword coffeeunderscore _ containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||||
|
" syntax match coffeeunderscoredot contained /\./ nextgroup=@coffee_Functions |
||||||
|
" syntax match coffeeunderscoredot contained /([^)]*)\./ nextgroup=@coffee_Functions |
||||||
|
|
||||||
|
syntax cluster coffee_Functions contains=coffee_collections,coffee_strings,coffee_arrays,coffee_functions,coffee_objects,coffee_chaining,coffee_utility,coffee_lodash,coffee_math,coffee_number |
||||||
|
|
||||||
|
syntax match coffee_collections contained /contains/ |
||||||
|
syntax keyword coffee_collections contained include |
||||||
|
syntax keyword coffee_collections contained each map reduce reduceRight find filter where findWhere |
||||||
|
syntax keyword coffee_collections contained reject every some invoke pluck max min sortBy |
||||||
|
syntax keyword coffee_collections contained groupBy indexBy countBy shuffle toArray size |
||||||
|
syntax keyword coffee_collections contained partition iteratee |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_collections contained partition sortByAll includes callback |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_collections contained flatMap commit next plant reverse toJSON valueOf |
||||||
|
syntax keyword coffee_collections contained forEachRight invokeMap keyBy orderBy sample sampleSize |
||||||
|
|
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_strings contained camelCase capitalize deburr endsWith escapeRegExp |
||||||
|
syntax keyword coffee_strings contained kebabCase pad padLeft padRight repeat snakeCase |
||||||
|
syntax keyword coffee_strings contained startsWith trim trimLeft trimRight trunc words |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_strings contained lowerCase lowerFirst padEnd padStart replace startCase |
||||||
|
syntax keyword coffee_strings contained startWith toLower toUpper trimEnd trimStart truncate upperCase |
||||||
|
syntax keyword coffee_strings contained upperFirst |
||||||
|
|
||||||
|
syntax keyword coffee_arrays contained first initial last rest compact flatten without union |
||||||
|
syntax keyword coffee_arrays contained intersection difference uniq zip object indextOf |
||||||
|
syntax keyword coffee_arrays contained lastIndexOf sortedIndex range |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_arrays contained chunk dropRight dropRightWhile dropWhile flattenDeep |
||||||
|
syntax keyword coffee_arrays contained pullAt slice sortedLastIndex takeRight takeRightWhile |
||||||
|
syntax keyword coffee_arrays contained takeWhile |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_arrays contained concat differenceBy differenceWith drop fill findLastIndex |
||||||
|
syntax keyword coffee_arrays contained fromPairs head indexOf intersection intersectionBy intersectionWith |
||||||
|
syntax keyword coffee_arrays contained join pull pullAll pullAllBy remove slice sortedIndexBy sortedIndexOf |
||||||
|
syntax keyword coffee_arrays contained sortedLastIndexBy sortedLastIndexOf sortedUniq sortedUniqBy tail |
||||||
|
syntax keyword coffee_arrays contained take takeRightWhile unionBy unionWith uniqBy uniqWith unzipWith |
||||||
|
syntax keyword coffee_arrays contained xorBy xorWith zipObject zipWith |
||||||
|
|
||||||
|
syntax keyword coffee_functions contained bind bindAll partial memoize delay throttle debounce |
||||||
|
syntax keyword coffee_functions contained once after before wrap negate compose flow flowRight |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_functions contained ary before curryRight negate rearg |
||||||
|
syntax keyword coffee_functions contained backflow compose partial cancel |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_functions contained curry defer eachRight findLast flip negate overArgs rest spread unary |
||||||
|
|
||||||
|
syntax keyword coffee_objects contained keys values pairs invert functions extend pick omit |
||||||
|
syntax keyword coffee_objects contained defaults clone tap has isEqual isEmpty isElement isArray |
||||||
|
syntax keyword coffee_objects contained isObject isArguments isFunction isString isNumber |
||||||
|
syntax keyword coffee_objects contained isFinite isBoolean isDate isRegExp isNaN isNull |
||||||
|
syntax keyword coffee_objects contained isUndefined property matches |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_objects contained keysIn valuesIn assign get set |
||||||
|
syntax keyword coffee_objects contained mapKeys |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_objects contained assignIn assignInWith assignWith defaultsDeep extendWith |
||||||
|
syntax keyword coffee_objects contained findKey findLastKey forIn forInRight forOwn forOwnRight |
||||||
|
syntax keyword coffee_objects contained functionsIn hasIn mergeWith omitBy pickBy setWith toPairs |
||||||
|
syntax keyword coffee_objects contained toPairsIn transform unset |
||||||
|
" |
||||||
|
syntax keyword coffee_utility contained noConflict identify times random mixin uniqueId |
||||||
|
syntax keyword coffee_utility contained escape unescape result template iteratee noop |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_utility contained attempt matches matchesProperty propertyOf constant now |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_utility contained cond conforms flow identity matches method methodOf nthArg |
||||||
|
syntax keyword coffee_utility contained over overEvery overSome rangeRight times toPath uniqueId |
||||||
|
|
||||||
|
syntax keyword coffee_chaining contained chain value thru |
||||||
|
|
||||||
|
syntax keyword coffee_lodash contained at bindKey cloneDeep createCallback findIndex findKey |
||||||
|
syntax keyword coffee_lodash contained forEach forIn forOwn isPlainObject merge parseInt partial |
||||||
|
syntax keyword coffee_lodash contained partialRight runInContext support unzip where |
||||||
|
syntax keyword coffee_lodash contained capitalize match slice trim trimLeft trimRight |
||||||
|
syntax keyword coffee_lodash contained constant mapValues now property xor |
||||||
|
syntax keyword coffee_lodash contained create noop transform |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword coffee_lodash contained isError isMatch isNative isTypedArray toPlainObject |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_lodash contained clone cloneDeepWith cloneWith eq gt gte isArrayLike isArrayLikeObject |
||||||
|
syntax keyword coffee_lodash contained isEqualWith isInteger isLength isMatchWith isNil isObjectLike isSafeInteger |
||||||
|
syntax keyword coffee_lodash contained isSymbol lt lte toInteger toLength toNumber toSafeInteger toString |
||||||
|
syntax keyword coffee_lodash contained templateSettings evaluate imports interpolate varible |
||||||
|
syntax keyword coffee_lodash contained VERSION |
||||||
|
|
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword coffee_math contained add ceil floor max maxBy mean min minBy round subtract sum sumBy |
||||||
|
syntax keyword coffee_number contained clamp inRange |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_coffee_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_coffee_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink coffeeunderscore Constant |
||||||
|
|
||||||
|
HiLink coffee_collections PreProc |
||||||
|
HiLink coffee_strings PreProc |
||||||
|
HiLink coffee_arrays PreProc |
||||||
|
HiLink coffee_functions PreProc |
||||||
|
HiLink coffee_objects PreProc |
||||||
|
HiLink coffee_utility PreProc |
||||||
|
HiLink coffee_chaining PreProc |
||||||
|
HiLink coffee_lodash PreProc |
||||||
|
HiLink coffee_math PreProc |
||||||
|
HiLink coffee_number PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,128 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: underscore.js for javascript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/18 |
||||||
|
" Version: 1.7.0 |
||||||
|
" URL: http://underscorejs.org/ |
||||||
|
" LoDash: 4.0.0 |
||||||
|
" URL: http://lodash.com/ |
||||||
|
|
||||||
|
syntax keyword javascriptunderscore _ containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||||
|
" syntax match javascriptunderscoredot contained /\./ nextgroup=@javascript_Functions |
||||||
|
" syntax match javascriptunderscoredot contained /([^)]*)\./ nextgroup=@javascript_Functions |
||||||
|
|
||||||
|
syntax cluster javascript_Functions contains=javascript_collections,javascript_strings,javascript_arrays,javascript_functions,javascript_objects,javascript_chaining,javascript_utility,javascript_lodash,javascript_math,javascript_number |
||||||
|
|
||||||
|
syntax match javascript_collections contained /contains/ |
||||||
|
syntax keyword javascript_collections contained include |
||||||
|
syntax keyword javascript_collections contained each map reduce reduceRight find filter where findWhere |
||||||
|
syntax keyword javascript_collections contained reject every some invoke pluck max min sortBy |
||||||
|
syntax keyword javascript_collections contained groupBy indexBy countBy shuffle toArray size |
||||||
|
syntax keyword javascript_collections contained partition iteratee |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_collections contained partition sortByAll includes callback |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_collections contained flatMap commit next plant reverse toJSON valueOf |
||||||
|
syntax keyword javascript_collections contained forEachRight invokeMap keyBy orderBy sample sampleSize |
||||||
|
|
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_strings contained camelCase capitalize deburr endsWith escapeRegExp |
||||||
|
syntax keyword javascript_strings contained kebabCase pad padLeft padRight repeat snakeCase |
||||||
|
syntax keyword javascript_strings contained startsWith trim trimLeft trimRight trunc words |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_strings contained lowerCase lowerFirst padEnd padStart replace startCase |
||||||
|
syntax keyword javascript_strings contained startWith toLower toUpper trimEnd trimStart truncate upperCase |
||||||
|
syntax keyword javascript_strings contained upperFirst |
||||||
|
|
||||||
|
syntax keyword javascript_arrays contained first initial last rest compact flatten without union |
||||||
|
syntax keyword javascript_arrays contained intersection difference uniq zip object indextOf |
||||||
|
syntax keyword javascript_arrays contained lastIndexOf sortedIndex range |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_arrays contained chunk dropRight dropRightWhile dropWhile flattenDeep |
||||||
|
syntax keyword javascript_arrays contained pullAt slice sortedLastIndex takeRight takeRightWhile |
||||||
|
syntax keyword javascript_arrays contained takeWhile |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_arrays contained concat differenceBy differenceWith drop fill findLastIndex |
||||||
|
syntax keyword javascript_arrays contained fromPairs head indexOf intersection intersectionBy intersectionWith |
||||||
|
syntax keyword javascript_arrays contained join pull pullAll pullAllBy remove slice sortedIndexBy sortedIndexOf |
||||||
|
syntax keyword javascript_arrays contained sortedLastIndexBy sortedLastIndexOf sortedUniq sortedUniqBy tail |
||||||
|
syntax keyword javascript_arrays contained take takeRightWhile unionBy unionWith uniqBy uniqWith unzipWith |
||||||
|
syntax keyword javascript_arrays contained xorBy xorWith zipObject zipWith |
||||||
|
|
||||||
|
syntax keyword javascript_functions contained bind bindAll partial memoize delay throttle debounce |
||||||
|
syntax keyword javascript_functions contained once after before wrap negate compose flow flowRight |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_functions contained ary before curryRight negate rearg |
||||||
|
syntax keyword javascript_functions contained backflow compose partial cancel |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_functions contained curry defer eachRight findLast flip negate overArgs rest spread unary |
||||||
|
|
||||||
|
syntax keyword javascript_objects contained keys values pairs invert functions extend pick omit |
||||||
|
syntax keyword javascript_objects contained defaults clone tap has isEqual isEmpty isElement isArray |
||||||
|
syntax keyword javascript_objects contained isObject isArguments isFunction isString isNumber |
||||||
|
syntax keyword javascript_objects contained isFinite isBoolean isDate isRegExp isNaN isNull |
||||||
|
syntax keyword javascript_objects contained isUndefined property matches |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_objects contained keysIn valuesIn assign get set |
||||||
|
syntax keyword javascript_objects contained mapKeys |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_objects contained assignIn assignInWith assignWith defaultsDeep extendWith |
||||||
|
syntax keyword javascript_objects contained findKey findLastKey forIn forInRight forOwn forOwnRight |
||||||
|
syntax keyword javascript_objects contained functionsIn hasIn mergeWith omitBy pickBy setWith toPairs |
||||||
|
syntax keyword javascript_objects contained toPairsIn transform unset |
||||||
|
" |
||||||
|
syntax keyword javascript_utility contained noConflict identify times random mixin uniqueId |
||||||
|
syntax keyword javascript_utility contained escape unescape result template iteratee noop |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_utility contained attempt matches matchesProperty propertyOf constant now |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_utility contained cond conforms flow identity matches method methodOf nthArg |
||||||
|
syntax keyword javascript_utility contained over overEvery overSome rangeRight times toPath uniqueId |
||||||
|
|
||||||
|
syntax keyword javascript_chaining contained chain value thru |
||||||
|
|
||||||
|
syntax keyword javascript_lodash contained at bindKey cloneDeep createCallback findIndex findKey |
||||||
|
syntax keyword javascript_lodash contained forEach forIn forOwn isPlainObject merge parseInt partial |
||||||
|
syntax keyword javascript_lodash contained partialRight runInContext support unzip where |
||||||
|
syntax keyword javascript_lodash contained capitalize match slice trim trimLeft trimRight |
||||||
|
syntax keyword javascript_lodash contained constant mapValues now property xor |
||||||
|
syntax keyword javascript_lodash contained create noop transform |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword javascript_lodash contained isError isMatch isNative isTypedArray toPlainObject |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_lodash contained clone cloneDeepWith cloneWith eq gt gte isArrayLike isArrayLikeObject |
||||||
|
syntax keyword javascript_lodash contained isEqualWith isInteger isLength isMatchWith isNil isObjectLike isSafeInteger |
||||||
|
syntax keyword javascript_lodash contained isSymbol lt lte toInteger toLength toNumber toSafeInteger toString |
||||||
|
syntax keyword javascript_lodash contained templateSettings evaluate imports interpolate varible |
||||||
|
syntax keyword javascript_lodash contained VERSION |
||||||
|
|
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword javascript_math contained add ceil floor max maxBy mean min minBy round subtract sum sumBy |
||||||
|
syntax keyword javascript_number contained clamp inRange |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_javascript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_javascript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink javascriptunderscore Constant |
||||||
|
|
||||||
|
HiLink javascript_collections PreProc |
||||||
|
HiLink javascript_strings PreProc |
||||||
|
HiLink javascript_arrays PreProc |
||||||
|
HiLink javascript_functions PreProc |
||||||
|
HiLink javascript_objects PreProc |
||||||
|
HiLink javascript_utility PreProc |
||||||
|
HiLink javascript_chaining PreProc |
||||||
|
HiLink javascript_lodash PreProc |
||||||
|
HiLink javascript_math PreProc |
||||||
|
HiLink javascript_number PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,128 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: underscore.js for ls |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/18 |
||||||
|
" Version: 1.7.0 |
||||||
|
" URL: http://underscorejs.org/ |
||||||
|
" LoDash: 4.0.0 |
||||||
|
" URL: http://lodash.com/ |
||||||
|
|
||||||
|
syntax keyword lsunderscore _ containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||||
|
" syntax match lsunderscoredot contained /\./ nextgroup=@ls_Functions |
||||||
|
" syntax match lsunderscoredot contained /([^)]*)\./ nextgroup=@ls_Functions |
||||||
|
|
||||||
|
syntax cluster ls_Functions contains=ls_collections,ls_strings,ls_arrays,ls_functions,ls_objects,ls_chaining,ls_utility,ls_lodash,ls_math,ls_number |
||||||
|
|
||||||
|
syntax match ls_collections contained /contains/ |
||||||
|
syntax keyword ls_collections contained include |
||||||
|
syntax keyword ls_collections contained each map reduce reduceRight find filter where findWhere |
||||||
|
syntax keyword ls_collections contained reject every some invoke pluck max min sortBy |
||||||
|
syntax keyword ls_collections contained groupBy indexBy countBy shuffle toArray size |
||||||
|
syntax keyword ls_collections contained partition iteratee |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_collections contained partition sortByAll includes callback |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_collections contained flatMap commit next plant reverse toJSON valueOf |
||||||
|
syntax keyword ls_collections contained forEachRight invokeMap keyBy orderBy sample sampleSize |
||||||
|
|
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_strings contained camelCase capitalize deburr endsWith escapeRegExp |
||||||
|
syntax keyword ls_strings contained kebabCase pad padLeft padRight repeat snakeCase |
||||||
|
syntax keyword ls_strings contained startsWith trim trimLeft trimRight trunc words |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_strings contained lowerCase lowerFirst padEnd padStart replace startCase |
||||||
|
syntax keyword ls_strings contained startWith toLower toUpper trimEnd trimStart truncate upperCase |
||||||
|
syntax keyword ls_strings contained upperFirst |
||||||
|
|
||||||
|
syntax keyword ls_arrays contained first initial last rest compact flatten without union |
||||||
|
syntax keyword ls_arrays contained intersection difference uniq zip object indextOf |
||||||
|
syntax keyword ls_arrays contained lastIndexOf sortedIndex range |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_arrays contained chunk dropRight dropRightWhile dropWhile flattenDeep |
||||||
|
syntax keyword ls_arrays contained pullAt slice sortedLastIndex takeRight takeRightWhile |
||||||
|
syntax keyword ls_arrays contained takeWhile |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_arrays contained concat differenceBy differenceWith drop fill findLastIndex |
||||||
|
syntax keyword ls_arrays contained fromPairs head indexOf intersection intersectionBy intersectionWith |
||||||
|
syntax keyword ls_arrays contained join pull pullAll pullAllBy remove slice sortedIndexBy sortedIndexOf |
||||||
|
syntax keyword ls_arrays contained sortedLastIndexBy sortedLastIndexOf sortedUniq sortedUniqBy tail |
||||||
|
syntax keyword ls_arrays contained take takeRightWhile unionBy unionWith uniqBy uniqWith unzipWith |
||||||
|
syntax keyword ls_arrays contained xorBy xorWith zipObject zipWith |
||||||
|
|
||||||
|
syntax keyword ls_functions contained bind bindAll partial memoize delay throttle debounce |
||||||
|
syntax keyword ls_functions contained once after before wrap negate compose flow flowRight |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_functions contained ary before curryRight negate rearg |
||||||
|
syntax keyword ls_functions contained backflow compose partial cancel |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_functions contained curry defer eachRight findLast flip negate overArgs rest spread unary |
||||||
|
|
||||||
|
syntax keyword ls_objects contained keys values pairs invert functions extend pick omit |
||||||
|
syntax keyword ls_objects contained defaults clone tap has isEqual isEmpty isElement isArray |
||||||
|
syntax keyword ls_objects contained isObject isArguments isFunction isString isNumber |
||||||
|
syntax keyword ls_objects contained isFinite isBoolean isDate isRegExp isNaN isNull |
||||||
|
syntax keyword ls_objects contained isUndefined property matches |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_objects contained keysIn valuesIn assign get set |
||||||
|
syntax keyword ls_objects contained mapKeys |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_objects contained assignIn assignInWith assignWith defaultsDeep extendWith |
||||||
|
syntax keyword ls_objects contained findKey findLastKey forIn forInRight forOwn forOwnRight |
||||||
|
syntax keyword ls_objects contained functionsIn hasIn mergeWith omitBy pickBy setWith toPairs |
||||||
|
syntax keyword ls_objects contained toPairsIn transform unset |
||||||
|
" |
||||||
|
syntax keyword ls_utility contained noConflict identify times random mixin uniqueId |
||||||
|
syntax keyword ls_utility contained escape unescape result template iteratee noop |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_utility contained attempt matches matchesProperty propertyOf constant now |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_utility contained cond conforms flow identity matches method methodOf nthArg |
||||||
|
syntax keyword ls_utility contained over overEvery overSome rangeRight times toPath uniqueId |
||||||
|
|
||||||
|
syntax keyword ls_chaining contained chain value thru |
||||||
|
|
||||||
|
syntax keyword ls_lodash contained at bindKey cloneDeep createCallback findIndex findKey |
||||||
|
syntax keyword ls_lodash contained forEach forIn forOwn isPlainObject merge parseInt partial |
||||||
|
syntax keyword ls_lodash contained partialRight runInContext support unzip where |
||||||
|
syntax keyword ls_lodash contained capitalize match slice trim trimLeft trimRight |
||||||
|
syntax keyword ls_lodash contained constant mapValues now property xor |
||||||
|
syntax keyword ls_lodash contained create noop transform |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword ls_lodash contained isError isMatch isNative isTypedArray toPlainObject |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_lodash contained clone cloneDeepWith cloneWith eq gt gte isArrayLike isArrayLikeObject |
||||||
|
syntax keyword ls_lodash contained isEqualWith isInteger isLength isMatchWith isNil isObjectLike isSafeInteger |
||||||
|
syntax keyword ls_lodash contained isSymbol lt lte toInteger toLength toNumber toSafeInteger toString |
||||||
|
syntax keyword ls_lodash contained templateSettings evaluate imports interpolate varible |
||||||
|
syntax keyword ls_lodash contained VERSION |
||||||
|
|
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword ls_math contained add ceil floor max maxBy mean min minBy round subtract sum sumBy |
||||||
|
syntax keyword ls_number contained clamp inRange |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_ls_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_ls_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink lsunderscore Constant |
||||||
|
|
||||||
|
HiLink ls_collections PreProc |
||||||
|
HiLink ls_strings PreProc |
||||||
|
HiLink ls_arrays PreProc |
||||||
|
HiLink ls_functions PreProc |
||||||
|
HiLink ls_objects PreProc |
||||||
|
HiLink ls_utility PreProc |
||||||
|
HiLink ls_chaining PreProc |
||||||
|
HiLink ls_lodash PreProc |
||||||
|
HiLink ls_math PreProc |
||||||
|
HiLink ls_number PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,128 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: underscore.js for typescript |
||||||
|
" Maintainer: othree <othree@gmail.com> |
||||||
|
" Last Change: 2016/01/18 |
||||||
|
" Version: 1.7.0 |
||||||
|
" URL: http://underscorejs.org/ |
||||||
|
" LoDash: 4.0.0 |
||||||
|
" URL: http://lodash.com/ |
||||||
|
|
||||||
|
syntax keyword typescriptunderscore _ containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||||
|
" syntax match typescriptunderscoredot contained /\./ nextgroup=@typescript_Functions |
||||||
|
" syntax match typescriptunderscoredot contained /([^)]*)\./ nextgroup=@typescript_Functions |
||||||
|
|
||||||
|
syntax cluster typescript_Functions contains=typescript_collections,typescript_strings,typescript_arrays,typescript_functions,typescript_objects,typescript_chaining,typescript_utility,typescript_lodash,typescript_math,typescript_number |
||||||
|
|
||||||
|
syntax match typescript_collections contained /contains/ |
||||||
|
syntax keyword typescript_collections contained include |
||||||
|
syntax keyword typescript_collections contained each map reduce reduceRight find filter where findWhere |
||||||
|
syntax keyword typescript_collections contained reject every some invoke pluck max min sortBy |
||||||
|
syntax keyword typescript_collections contained groupBy indexBy countBy shuffle toArray size |
||||||
|
syntax keyword typescript_collections contained partition iteratee |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_collections contained partition sortByAll includes callback |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_collections contained flatMap commit next plant reverse toJSON valueOf |
||||||
|
syntax keyword typescript_collections contained forEachRight invokeMap keyBy orderBy sample sampleSize |
||||||
|
|
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_strings contained camelCase capitalize deburr endsWith escapeRegExp |
||||||
|
syntax keyword typescript_strings contained kebabCase pad padLeft padRight repeat snakeCase |
||||||
|
syntax keyword typescript_strings contained startsWith trim trimLeft trimRight trunc words |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_strings contained lowerCase lowerFirst padEnd padStart replace startCase |
||||||
|
syntax keyword typescript_strings contained startWith toLower toUpper trimEnd trimStart truncate upperCase |
||||||
|
syntax keyword typescript_strings contained upperFirst |
||||||
|
|
||||||
|
syntax keyword typescript_arrays contained first initial last rest compact flatten without union |
||||||
|
syntax keyword typescript_arrays contained intersection difference uniq zip object indextOf |
||||||
|
syntax keyword typescript_arrays contained lastIndexOf sortedIndex range |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_arrays contained chunk dropRight dropRightWhile dropWhile flattenDeep |
||||||
|
syntax keyword typescript_arrays contained pullAt slice sortedLastIndex takeRight takeRightWhile |
||||||
|
syntax keyword typescript_arrays contained takeWhile |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_arrays contained concat differenceBy differenceWith drop fill findLastIndex |
||||||
|
syntax keyword typescript_arrays contained fromPairs head indexOf intersection intersectionBy intersectionWith |
||||||
|
syntax keyword typescript_arrays contained join pull pullAll pullAllBy remove slice sortedIndexBy sortedIndexOf |
||||||
|
syntax keyword typescript_arrays contained sortedLastIndexBy sortedLastIndexOf sortedUniq sortedUniqBy tail |
||||||
|
syntax keyword typescript_arrays contained take takeRightWhile unionBy unionWith uniqBy uniqWith unzipWith |
||||||
|
syntax keyword typescript_arrays contained xorBy xorWith zipObject zipWith |
||||||
|
|
||||||
|
syntax keyword typescript_functions contained bind bindAll partial memoize delay throttle debounce |
||||||
|
syntax keyword typescript_functions contained once after before wrap negate compose flow flowRight |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_functions contained ary before curryRight negate rearg |
||||||
|
syntax keyword typescript_functions contained backflow compose partial cancel |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_functions contained curry defer eachRight findLast flip negate overArgs rest spread unary |
||||||
|
|
||||||
|
syntax keyword typescript_objects contained keys values pairs invert functions extend pick omit |
||||||
|
syntax keyword typescript_objects contained defaults clone tap has isEqual isEmpty isElement isArray |
||||||
|
syntax keyword typescript_objects contained isObject isArguments isFunction isString isNumber |
||||||
|
syntax keyword typescript_objects contained isFinite isBoolean isDate isRegExp isNaN isNull |
||||||
|
syntax keyword typescript_objects contained isUndefined property matches |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_objects contained keysIn valuesIn assign get set |
||||||
|
syntax keyword typescript_objects contained mapKeys |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_objects contained assignIn assignInWith assignWith defaultsDeep extendWith |
||||||
|
syntax keyword typescript_objects contained findKey findLastKey forIn forInRight forOwn forOwnRight |
||||||
|
syntax keyword typescript_objects contained functionsIn hasIn mergeWith omitBy pickBy setWith toPairs |
||||||
|
syntax keyword typescript_objects contained toPairsIn transform unset |
||||||
|
" |
||||||
|
syntax keyword typescript_utility contained noConflict identify times random mixin uniqueId |
||||||
|
syntax keyword typescript_utility contained escape unescape result template iteratee noop |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_utility contained attempt matches matchesProperty propertyOf constant now |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_utility contained cond conforms flow identity matches method methodOf nthArg |
||||||
|
syntax keyword typescript_utility contained over overEvery overSome rangeRight times toPath uniqueId |
||||||
|
|
||||||
|
syntax keyword typescript_chaining contained chain value thru |
||||||
|
|
||||||
|
syntax keyword typescript_lodash contained at bindKey cloneDeep createCallback findIndex findKey |
||||||
|
syntax keyword typescript_lodash contained forEach forIn forOwn isPlainObject merge parseInt partial |
||||||
|
syntax keyword typescript_lodash contained partialRight runInContext support unzip where |
||||||
|
syntax keyword typescript_lodash contained capitalize match slice trim trimLeft trimRight |
||||||
|
syntax keyword typescript_lodash contained constant mapValues now property xor |
||||||
|
syntax keyword typescript_lodash contained create noop transform |
||||||
|
" lodash 3.0.0 |
||||||
|
syntax keyword typescript_lodash contained isError isMatch isNative isTypedArray toPlainObject |
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_lodash contained clone cloneDeepWith cloneWith eq gt gte isArrayLike isArrayLikeObject |
||||||
|
syntax keyword typescript_lodash contained isEqualWith isInteger isLength isMatchWith isNil isObjectLike isSafeInteger |
||||||
|
syntax keyword typescript_lodash contained isSymbol lt lte toInteger toLength toNumber toSafeInteger toString |
||||||
|
syntax keyword typescript_lodash contained templateSettings evaluate imports interpolate varible |
||||||
|
syntax keyword typescript_lodash contained VERSION |
||||||
|
|
||||||
|
" lodash 4.0.0 |
||||||
|
syntax keyword typescript_math contained add ceil floor max maxBy mean min minBy round subtract sum sumBy |
||||||
|
syntax keyword typescript_number contained clamp inRange |
||||||
|
|
||||||
|
" Define the default highlighting. |
||||||
|
" For version 5.7 and earlier: only when not done already |
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||||
|
if version >= 508 || !exists("did_underscore_typescript_syntax_inits") |
||||||
|
if version < 508 |
||||||
|
let did_underscore_typescript_syntax_inits = 1 |
||||||
|
command -nargs=+ HiLink hi link <args> |
||||||
|
else |
||||||
|
command -nargs=+ HiLink hi def link <args> |
||||||
|
endif |
||||||
|
|
||||||
|
HiLink typescriptunderscore Constant |
||||||
|
|
||||||
|
HiLink typescript_collections PreProc |
||||||
|
HiLink typescript_strings PreProc |
||||||
|
HiLink typescript_arrays PreProc |
||||||
|
HiLink typescript_functions PreProc |
||||||
|
HiLink typescript_objects PreProc |
||||||
|
HiLink typescript_utility PreProc |
||||||
|
HiLink typescript_chaining PreProc |
||||||
|
HiLink typescript_lodash PreProc |
||||||
|
HiLink typescript_math PreProc |
||||||
|
HiLink typescript_number PreProc |
||||||
|
|
||||||
|
delcommand HiLink |
||||||
|
endif |
@ -0,0 +1,7 @@ |
|||||||
|
for filetype in 'coffee' 'ls' 'typescript' |
||||||
|
do |
||||||
|
for lib in 'jquery' 'underscore' 'backbone' 'prelude' 'angularjs' 'angularuirouter' 'requirejs' 'sugar' 'jasmine' 'chai' 'react' 'flux' 'handlebars' |
||||||
|
do |
||||||
|
sed "s/javascript/$filetype/g" $lib.javascript.vim > $lib.$filetype.vim |
||||||
|
done |
||||||
|
done |
@ -0,0 +1,6 @@ |
|||||||
|
NAME=javascript-libraries-syntax.vim
|
||||||
|
VERSION=0.4
|
||||||
|
|
||||||
|
bundle-deps: |
||||||
|
$(call fetch_github,ID,REPOSITORY,BRANCH,PATH,TARGET_PATH)
|
||||||
|
$(call fetch_url,FILE_URL,TARGET_PATH)
|
@ -1 +0,0 @@ |
|||||||
Subproject commit 48eb1b343684c9db3835209757095050bc501824 |
|
@ -0,0 +1,148 @@ |
|||||||
|
Vimple |
||||||
|
------ |
||||||
|
|
||||||
|
__Pacifying Vimmers__ |
||||||
|
|
||||||
|
++Version 0.9 -- Lil' Vimmer++ |
||||||
|
|
||||||
|
http://of-vim-and-vigor.blogspot.com/2012/03/pacifying-vimmers.html[Ad] |
||||||
|
|
||||||
|
Perhaps most usefully, Vimple provides a few maps and commands to make |
||||||
|
the casual vimmer's life a little easier, such as: |
||||||
|
|
||||||
|
=== `:View ex-command` |
||||||
|
|
||||||
|
Opens a split with the output of `ex-command`. |
||||||
|
|
||||||
|
=== `z=` |
||||||
|
|
||||||
|
Shows spelling suggestions in an overlay window. Pressing `<enter>` |
||||||
|
will replace the word under the cursor in the original window with the |
||||||
|
current word under the cursor in the overlay. |
||||||
|
|
||||||
|
Use `<plug>vimple_spell_suggest` if you want to map this behaviour |
||||||
|
to a differnt key. |
||||||
|
|
||||||
|
=== `[I` |
||||||
|
|
||||||
|
Shows identifier search results in an overlay window. Pressing `<enter>` |
||||||
|
will jump to the associated line of the identifier under the cursor. |
||||||
|
|
||||||
|
Use `<plug>vimple_ident_search` if you want to map this behaviour |
||||||
|
to a differnt key. |
||||||
|
|
||||||
|
=== `g]` |
||||||
|
|
||||||
|
Shows tag search results in an overlay window. Pressing `<enter>` |
||||||
|
will jump to the associated line of the tag under the cursor. |
||||||
|
|
||||||
|
Use `<plug>vimple_tag_search` if you want to map this behaviour |
||||||
|
to a differnt key. |
||||||
|
|
||||||
|
=== `SCall( script , function , arg )` |
||||||
|
|
||||||
|
A function which calls script-local `function` in `script` |
||||||
|
with arguments `arg`. This lets you call `<SNR>` / `s:` |
||||||
|
functions by script name rather than SNR (script-number). |
||||||
|
|
||||||
|
=== `:Silently ex-command` |
||||||
|
|
||||||
|
Performs the series of bar-separated ex-commands silently. |
||||||
|
|
||||||
|
=== `:QFdo ex-command` |
||||||
|
|
||||||
|
Performs the series of bar-separated ex-commands over the buffers in the QuickFix list. |
||||||
|
|
||||||
|
NOTE: The location-list analogue is `:LLdo` |
||||||
|
|
||||||
|
=== `:BufTypeDo type ex-commands` |
||||||
|
|
||||||
|
Performs the series of bar-separated ex-commands over the buffers of the given +type+. |
||||||
|
|
||||||
|
=== `:BufMatchDo pattern ex-commands` |
||||||
|
|
||||||
|
Performs the series of bar-separated ex-commands over the buffers with names matching +pattern+. |
||||||
|
|
||||||
|
=== `:Collect register-or-variable ex-command` |
||||||
|
|
||||||
|
Saves the output of `ex-command` into the specified register |
||||||
|
or variable. |
||||||
|
|
||||||
|
=== `Collect('register-or-variable ex-command')` |
||||||
|
|
||||||
|
Saves the output of `ex-command` into the specified register |
||||||
|
or variable and returns the output for further use in |
||||||
|
expressions. |
||||||
|
|
||||||
|
=== `GCollect( pattern )` |
||||||
|
|
||||||
|
Uses `pattern` in a `:global /pattern/` command and returns |
||||||
|
the results as a list of lines. |
||||||
|
|
||||||
|
:echo GCollect('^\s*===\s*') |
||||||
|
|
||||||
|
=== `GCCollect( pattern )` |
||||||
|
|
||||||
|
Uses `pattern` in a `:global /pattern/` command and returns |
||||||
|
the results as a list of lines with the `pattern` stripped. |
||||||
|
|
||||||
|
:echo GCCollect('^\s*===\s*') |
||||||
|
|
||||||
|
=== `:MyMaps` |
||||||
|
|
||||||
|
Shows your currently active |:map|s and |:imap|s in a new buffer. :MyMaps |
||||||
|
attempts to group related maps to more easily allow you to create a custom map |
||||||
|
layout for your various |'filetype'|s. |
||||||
|
|
||||||
|
=== `Scope()` |
||||||
|
|
||||||
|
The Scope() function attempts to show the current function or |
||||||
|
class/method scope. Some people like to display this information in |
||||||
|
their `statusline`, like: |
||||||
|
|
||||||
|
set statusline=%f%m%r%h%w\ [%n:%{&ff}/%Y]\%{Scope()}%=[0x\%04.4B][%03v][%p%%\ line\ %l\ of\ %L] |
||||||
|
|
||||||
|
Currently only Vim & Python (and Python only for testing purposes, created by a NON Pythonista -- patches welcome) have been implemented, but it is very easy for you to write scope functions for your own filetypes. Take Ruby for example: Create `~/.vim/ftplugin/ruby_scope.vim` like this: |
||||||
|
|
||||||
|
---- |
||||||
|
function! Scope_ruby() |
||||||
|
let class_scope = scope#inspect('^\s*class\s\+\([a-zA-Z0-9_.]\+\)', '^\s*end') |
||||||
|
let method_scope = scope#inspect('^\s*def\s\+\([a-zA-Z0-9_.]\+\)', '^\s*end') |
||||||
|
return ' ' . join(map(class_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' :: ') |
||||||
|
\. ' >> ' . join(map(method_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' > ') |
||||||
|
endfunction |
||||||
|
---- |
||||||
|
|
||||||
|
NOTE: The above example for Ruby is woefully inadequate. A better effect |
||||||
|
might be achievable with more context in the regex patterns. The |
||||||
|
patterns in `syntax/ruby.vim` might be useful. Parsing with regex is futile. |
||||||
|
|
||||||
|
=== Composable Completions |
||||||
|
|
||||||
|
By default, `jj` in insert mode activates a user-extendible |
||||||
|
meta-completion list. The default list includes abbreviations (if you |
||||||
|
have https://github.com/dahu/Aboriginal), some date-time patterns and |
||||||
|
the built-in dictionary completion (`<c-x><c-k>`). |
||||||
|
|
||||||
|
The default `jj` can be overridden like this: |
||||||
|
|
||||||
|
imap <c-x><c-c> <plug>vimple_completers_trigger |
||||||
|
|
||||||
|
Vimple also provides VimLOO (Object Oriented VimL) objects |
||||||
|
for these read-only ++:ex++ commands: |
||||||
|
|
||||||
|
* ++:ls++ -- vimple#bl |
||||||
|
* ++:scriptnames++ -- vimple#sn |
||||||
|
* ++:highlight++ -- vimple#hl |
||||||
|
* ++:version++ -- vimple#vn |
||||||
|
* ++:marks++ -- vimple#ma |
||||||
|
* ++:undolist++ -- vimple#ul |
||||||
|
* ++:maps++ -- vimple#mp |
||||||
|
|
||||||
|
NOTE: The awesome plugin |
||||||
|
https://github.com/Raimondi/vim-buffalo[buffalo] uses the |
||||||
|
`vimple#bl` object. |
||||||
|
|
||||||
|
In addition to these existing ++:ex++ wrappers, Vimple allows |
||||||
|
developers to craft their own objects too. See autoload/vimple/*.vim |
||||||
|
for examples. |
@ -0,0 +1,107 @@ |
|||||||
|
function! args#merge_dict(initial, ...) |
||||||
|
let dict = a:initial |
||||||
|
for arg in a:000 |
||||||
|
if type(arg) == type({}) |
||||||
|
call extend(dict, arg) |
||||||
|
elseif type(arg) == type('') |
||||||
|
if exists(arg) |
||||||
|
call extend(dict, eval(arg)) |
||||||
|
endif |
||||||
|
elseif type(arg) == type([]) |
||||||
|
if ! empty(arg[0]) |
||||||
|
if has_key(arg[0][arg[1]], arg[2]) |
||||||
|
call extend(dict, get(arg[0][arg[1]], arg[2])) |
||||||
|
endif |
||||||
|
endif |
||||||
|
else |
||||||
|
echohl Warning |
||||||
|
echom 'args#merge_dict: Unhandled type: ' . type(arg) |
||||||
|
echohl None |
||||||
|
endif |
||||||
|
unlet arg |
||||||
|
endfor |
||||||
|
return dict |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! args#merge_string(initial, ...) |
||||||
|
let str = a:initial |
||||||
|
for arg in a:000 |
||||||
|
if type(arg) == type('') |
||||||
|
if exists(arg) |
||||||
|
let str = eval(arg) |
||||||
|
endif |
||||||
|
elseif type(arg) == type([]) |
||||||
|
if ! empty(arg[0]) |
||||||
|
if has_key(arg[0][arg[1]], arg[2]) |
||||||
|
let str = get(arg[0][arg[1]], arg[2]) |
||||||
|
endif |
||||||
|
endif |
||||||
|
else |
||||||
|
echohl Warning |
||||||
|
echom 'args#merge_string: Unhandled type: ' . type(arg) |
||||||
|
echohl None |
||||||
|
endif |
||||||
|
unlet arg |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! args#merge(initial, ...) |
||||||
|
let initial = a:initial |
||||||
|
let type = type(initial) |
||||||
|
if type == type({}) |
||||||
|
return call('args#merge_dict', [initial] + a:000) |
||||||
|
elseif type == type('') |
||||||
|
return call('args#merge_string', [initial] + a:000) |
||||||
|
else |
||||||
|
echohl Warning |
||||||
|
echom 'args#merge: Unhandled type: ' . type |
||||||
|
echohl None |
||||||
|
end |
||||||
|
endfunction |
||||||
|
|
||||||
|
if expand('%:p') == expand('<sfile>:p') |
||||||
|
" TEST string merge |
||||||
|
|
||||||
|
func! args#test_merge_2(...) |
||||||
|
return args#merge( |
||||||
|
\ 'override me' |
||||||
|
\, 'g:default' |
||||||
|
\, 'g:default_2' |
||||||
|
\, [a:000, 0, 'my_default'] |
||||||
|
\) |
||||||
|
endfunc |
||||||
|
|
||||||
|
let default = 'default' |
||||||
|
silent! unlet default_2 |
||||||
|
echo 'default' == args#test_merge_2() |
||||||
|
|
||||||
|
let default_2 = 'default 2' |
||||||
|
echo 'default 2' == args#test_merge_2() |
||||||
|
|
||||||
|
echo 'my default' == args#test_merge_2({'my_default' : 'my default'}) |
||||||
|
|
||||||
|
" TEST dict merge |
||||||
|
|
||||||
|
let default_styles = { |
||||||
|
\ 'one' : 1 |
||||||
|
\, 'two' : 2 |
||||||
|
\, 'three' : 3 |
||||||
|
\} |
||||||
|
|
||||||
|
func! args#test_merge_1(...) |
||||||
|
return args#merge( |
||||||
|
\ {} |
||||||
|
\, g:default_styles |
||||||
|
\, 'g:default_styles_2' |
||||||
|
\, [a:000, 0, 'my_styles'] |
||||||
|
\) |
||||||
|
endfunc |
||||||
|
|
||||||
|
silent! unlet g:default_styles_2 |
||||||
|
echo default_styles == args#test_merge_1() |
||||||
|
echo default_styles != args#test_merge_1({'my_styles': {'one' : 4}}) |
||||||
|
echo {'one' : 4, 'two' : 2, 'three' : 3} == args#test_merge_1({'my_styles' : {'one' : 4}}) |
||||||
|
let g:default_styles_2 = {'one' : 5} |
||||||
|
echo {'one' : 5, 'two' : 2, 'three' : 3} == args#test_merge_1() |
||||||
|
endif |
@ -0,0 +1,67 @@ |
|||||||
|
let s:old_cfu = '' |
||||||
|
|
||||||
|
function! complete#reset() |
||||||
|
let &completefunc = s:old_cfu |
||||||
|
let s:old_cfu = '' |
||||||
|
augroup CompleteTrigger |
||||||
|
au! |
||||||
|
augroup END |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! complete#trigger(func) |
||||||
|
if s:old_cfu == '' |
||||||
|
let s:old_cfu = &completefunc |
||||||
|
endif |
||||||
|
let &completefunc = a:func |
||||||
|
augroup CompleteTrigger |
||||||
|
au! |
||||||
|
au CursorMovedI * call complete#reset() |
||||||
|
augroup END |
||||||
|
return "\<c-x>\<c-u>" |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Example Completers |
||||||
|
"------------------- |
||||||
|
" |
||||||
|
function! complete#short_files_in_path(findstart, base) |
||||||
|
if a:findstart |
||||||
|
let line = getline('.') |
||||||
|
let start = col('.') - 1 |
||||||
|
while start > 0 && line[start - 1] =~ '\f' |
||||||
|
let start -= 1 |
||||||
|
endwhile |
||||||
|
return start |
||||||
|
else |
||||||
|
let res = map(globpath(&path, a:base . '*', 0, 1) |
||||||
|
\, 'fnamemodify(v:val, ":t")') |
||||||
|
return res |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! complete#files_in_path(findstart, base) |
||||||
|
if a:findstart |
||||||
|
let line = getline('.') |
||||||
|
let start = col('.') - 1 |
||||||
|
while start > 0 && line[start - 1] =~ '\f' |
||||||
|
let start -= 1 |
||||||
|
endwhile |
||||||
|
return start |
||||||
|
else |
||||||
|
let res = map(globpath(&path, a:base . '*', 0, 1) |
||||||
|
\, 'substitute(v:val, "^\.\/", "", "")') |
||||||
|
return res |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! complete#foist(findstart, base) |
||||||
|
if a:findstart |
||||||
|
return 0 |
||||||
|
else |
||||||
|
let base = matchstr(a:base, '^\s*\zs.*\ze\s*$') |
||||||
|
let all_buf_lines = [] |
||||||
|
let curbuf = bufnr('%') |
||||||
|
silent bufdo call extend(all_buf_lines, getline(1, '$')) |
||||||
|
exe "buffer " . curbuf |
||||||
|
return filter(all_buf_lines, 'stridx(v:val, base) > -1') |
||||||
|
endif |
||||||
|
endfunction |
@ -0,0 +1,73 @@ |
|||||||
|
let completers#completers = [ |
||||||
|
\ {'word': "\<c-x>\<c-a>", 'abbr': 'abbreviation'} |
||||||
|
\, {'word': "\<c-x>\<c-z>", 'abbr': 'datetime'} |
||||||
|
\, {'word': "\<c-x>\<c-k>", 'abbr': 'dictionary'} |
||||||
|
\] |
||||||
|
|
||||||
|
function! completers#trigger(findstart, base) |
||||||
|
if a:findstart |
||||||
|
let line = getline('.') |
||||||
|
let start = col('.') - 1 |
||||||
|
while start > 0 && line[start-1] =~ '\w' |
||||||
|
let start -= 1 |
||||||
|
endwhile |
||||||
|
let b:completers_start = start |
||||||
|
return start |
||||||
|
else |
||||||
|
augroup AfterCompleters |
||||||
|
au! |
||||||
|
au CompleteDone * call completers#apply_completion() |
||||||
|
augroup END |
||||||
|
return map(deepcopy(g:completers#completers), 'extend(v:val, {"word" : a:base . get(v:val, "word")})') |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! completers#apply_completion() |
||||||
|
augroup AfterCompleters |
||||||
|
au! |
||||||
|
augroup END |
||||||
|
let reg_un = @@ |
||||||
|
exe 'normal! d' . (b:completers_start + 1) . '|' |
||||||
|
if col('.') == (col('$')-1) && col('.') != 1 |
||||||
|
let @@ = ' ' . @@ |
||||||
|
endif |
||||||
|
call feedkeys(@@) |
||||||
|
let @@ = reg_un |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! completers#datetime(findstart, base) |
||||||
|
if a:findstart |
||||||
|
let line = getline('.') |
||||||
|
let start = col('.') - 1 |
||||||
|
while start > 0 && line[start - 1] =~ '[a-zA-Z0-9-./]' |
||||||
|
let start -= 1 |
||||||
|
endwhile |
||||||
|
return start |
||||||
|
else |
||||||
|
let now = localtime() |
||||||
|
let datetimes = [] |
||||||
|
for ts in ['%c', '%Y %b %d %X', '%Y%m%d %T', '%Y-%m-%d', '%Y%m%d', '%H:%M'] |
||||||
|
call add(datetimes, strftime(ts, now)) |
||||||
|
endfor |
||||||
|
return filter(datetimes, 'v:val =~ "^" . a:base') |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! completers#abbrevs(findstart, base) |
||||||
|
if exists('*CompleteAbbrevs') |
||||||
|
return CompleteAbbrevs(a:findstart, a:base) |
||||||
|
else |
||||||
|
echohl Error |
||||||
|
echom 'Requires https://github.com/dahu/Aboriginal' |
||||||
|
echohl NONE |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! completers#init() |
||||||
|
inoremap <expr> <plug>vimple_completers_trigger complete#trigger('completers#trigger') |
||||||
|
if !hasmapto('<plug>vimple_completers_trigger', 'i') |
||||||
|
imap <unique><silent> jj <plug>vimple_completers_trigger |
||||||
|
endif |
||||||
|
inoremap <expr> <c-x><c-a> complete#trigger('completers#abbrevs') |
||||||
|
inoremap <expr> <c-x><c-z> complete#trigger('completers#datetime') |
||||||
|
endfunction |
@ -0,0 +1,3 @@ |
|||||||
|
function! file#read(file) |
||||||
|
return filereadable(a:file) ? readfile(a:file) : [] |
||||||
|
endfunction |
@ -0,0 +1,208 @@ |
|||||||
|
" list#flat([elem, ...]) {{{1 |
||||||
|
" |
||||||
|
" Flatten the arguments into a single list. |
||||||
|
" |
||||||
|
" given: a = ['a', 'b'] |
||||||
|
" b = [1, 2] |
||||||
|
" list#flat(a,b) : ['a', 'b', 1, 2] |
||||||
|
" |
||||||
|
function! list#flat(...) |
||||||
|
let fl = [] |
||||||
|
let list = a:000 |
||||||
|
if a:0 == 1 |
||||||
|
let list = list[0] |
||||||
|
endif |
||||||
|
for el in list |
||||||
|
if type(el) == type([]) |
||||||
|
call extend(fl, list#flat(el)) |
||||||
|
else |
||||||
|
call extend(fl, [el]) |
||||||
|
endif |
||||||
|
unlet el |
||||||
|
endfor |
||||||
|
return fl |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! list#split(list, match) |
||||||
|
let ret = [] |
||||||
|
let r = [] |
||||||
|
for e in a:list |
||||||
|
if e =~ a:match |
||||||
|
call add(ret, r) |
||||||
|
let r = [] |
||||||
|
else |
||||||
|
call add(r, e) |
||||||
|
endif |
||||||
|
endfor |
||||||
|
call add(ret, r) |
||||||
|
return ret |
||||||
|
endfunction |
||||||
|
|
||||||
|
" list#zip(list_a, list_b, method) {{{1 |
||||||
|
" |
||||||
|
" Join each element of list_a with the corresponding element of list_b |
||||||
|
" Use the third argument, method, to dictate how the elements should be |
||||||
|
" combined: |
||||||
|
" given: a = [a, b] |
||||||
|
" b = [1, 2] |
||||||
|
" 0 = flattened list : [a, 1, b, 2] |
||||||
|
" 1 = list groups : [[a, 1], [b, 2]] |
||||||
|
" x = join separator x : [ax1, bx2] |
||||||
|
" |
||||||
|
" NOTE: If one list is longer than the other, the tail of that list is added |
||||||
|
" to the result. |
||||||
|
function! list#zip(a, b, ...) |
||||||
|
let method = 1 |
||||||
|
if a:0 |
||||||
|
let method = a:1 |
||||||
|
endif |
||||||
|
let i = 0 |
||||||
|
let r = [] |
||||||
|
let l_a = len(a:a) |
||||||
|
let l_b = len(a:b) |
||||||
|
let n = min([len(a:a), len(a:b)]) |
||||||
|
while i < n |
||||||
|
if method == "0" |
||||||
|
call add(r, a:a[i]) |
||||||
|
call add(r, a:b[i]) |
||||||
|
elseif method == "1" |
||||||
|
call add(r, [a:a[i], a:b[i]]) |
||||||
|
else |
||||||
|
call add(r, join([a:a[i], a:b[i]], method)) |
||||||
|
endif |
||||||
|
let i+= 1 |
||||||
|
endwhile |
||||||
|
if l_a == l_b |
||||||
|
return r |
||||||
|
elseif l_a > l_b |
||||||
|
exe "return r + a:a[" . n . ":]" |
||||||
|
else |
||||||
|
exe "return r + a:b[" . n . ":]" |
||||||
|
endif |
||||||
|
endfunction "}}}1 |
||||||
|
|
||||||
|
" list#inject(list, init, funcref) |
||||||
|
function! list#inject(list, init, funcref) |
||||||
|
if ! exists('*' . a:funcref) |
||||||
|
throw 'vimple: list#inject(): Funcref ' . a:funcref . ' does not exist!' |
||||||
|
return a:init |
||||||
|
elseif empty(a:list) |
||||||
|
return a:init |
||||||
|
else |
||||||
|
let i = a:list[0] |
||||||
|
let r = a:list[1:-1] |
||||||
|
let v = call(a:funcref, [a:init, i]) |
||||||
|
return list#inject(r, v, a:funcref) |
||||||
|
endif |
||||||
|
endf |
||||||
|
|
||||||
|
" partition list into count-element sublists |
||||||
|
function! list#partition(list, count) |
||||||
|
let lst = deepcopy(a:list) |
||||||
|
let len = len(lst) |
||||||
|
let cnt = a:count |
||||||
|
let newlists = [] |
||||||
|
if cnt <= 0 |
||||||
|
throw 'vimple: list#partition: count must be positive' |
||||||
|
endif |
||||||
|
if cnt >= len |
||||||
|
return lst |
||||||
|
endif |
||||||
|
for idx in range(0, len - 1, cnt) |
||||||
|
if cnt > len(lst) |
||||||
|
let cnt = len(lst) |
||||||
|
endif |
||||||
|
call add(newlists, remove(lst, 0, (cnt - 1))) |
||||||
|
endfor |
||||||
|
return newlists |
||||||
|
endfunc |
||||||
|
|
||||||
|
" partition list into cols sublists and join with colsep=\t |
||||||
|
" list#lspread(list, cols, colsep="\t") |
||||||
|
" returns a list |
||||||
|
function! list#lspread(list, cols, ...) |
||||||
|
let colsep = "\t" |
||||||
|
if a:0 |
||||||
|
let colsep = a:1 |
||||||
|
endif |
||||||
|
return map(list#partition(a:list, a:cols), 'join(v:val, "' . escape(colsep, '"') . '")') |
||||||
|
endfunction |
||||||
|
|
||||||
|
" partition list into cols sublists and join with col and row seps |
||||||
|
" list#spread(list, cols, colsep, rowsep) |
||||||
|
" returns a string |
||||||
|
function! list#spread(list, cols, ...) |
||||||
|
let colsep = "\t" |
||||||
|
let rowsep = "\n" |
||||||
|
if a:0 |
||||||
|
if a:0 == 2 |
||||||
|
let colsep = a:1 |
||||||
|
let rowsep = a:2 |
||||||
|
else |
||||||
|
let colsep = a:1 |
||||||
|
endif |
||||||
|
endif |
||||||
|
return join(list#lspread(a:list, a:cols, colsep), rowsep) |
||||||
|
endfunction |
||||||
|
|
||||||
|
" " map expr over each element of each sublist of list |
||||||
|
" function! list#lmap(list, expr) |
||||||
|
" return map(a:list, 'map(v:val, ''' . a:expr . ''')') |
||||||
|
" endfunction |
||||||
|
|
||||||
|
function! list#shuffle(a) |
||||||
|
let b = deepcopy(a:a) |
||||||
|
let n = 0 |
||||||
|
let length = len(b) |
||||||
|
while n < length |
||||||
|
let tmp = b[n] |
||||||
|
let dst = rng#rand() % length |
||||||
|
let b[n] = b[dst] |
||||||
|
let b[dst] = tmp |
||||||
|
let n += 1 |
||||||
|
endwhile |
||||||
|
return b |
||||||
|
endfunction |
||||||
|
|
||||||
|
" list#paste(a, b, join, sep) |
||||||
|
" Emulate the unix paste command |
||||||
|
" Arguments: |
||||||
|
" a - each of 'a' and 'b' are lists, or |
||||||
|
" b - strings containing 'sep' (default='\n') delimited elements |
||||||
|
" join - separator (default=' ') to use when joining each respective line of |
||||||
|
" a and b |
||||||
|
" sep - separator (default='\n') to use when splitting a and b (if strings) |
||||||
|
" e.g. |
||||||
|
" ------v yank following into register a - "a3yy |
||||||
|
" one |
||||||
|
" two |
||||||
|
" three |
||||||
|
" ------v yank following into register b - "b3yy |
||||||
|
" satu |
||||||
|
" dua |
||||||
|
" tiga |
||||||
|
" call append('.', Paste(@a, @b)) |
||||||
|
function! list#paste(a, b, ...) |
||||||
|
let join = (a:0 >= 1) ? a:1 : ' ' |
||||||
|
let sep = (a:0 == 2) ? a:2 : '\n' |
||||||
|
if type(a:a) == 1 |
||||||
|
let a = split(a:a, sep) |
||||||
|
let b = split(a:b, sep) |
||||||
|
else |
||||||
|
let a = a:a |
||||||
|
let b = a:b |
||||||
|
end |
||||||
|
return list#zip(a, b, join) |
||||||
|
endfunction |
||||||
|
|
||||||
|
" list#lrotate(array) |
||||||
|
" Perform a Left Rotate on array |
||||||
|
function! list#lrotate(a) |
||||||
|
return extend(a:a[1:-1], [a:a[0]]) |
||||||
|
endfunction |
||||||
|
|
||||||
|
" list#rrotate(array) |
||||||
|
" Perform a Right Rotate on array |
||||||
|
function! list#rrotate(a) |
||||||
|
return extend([a:a[-1]], a:a[0:-2]) |
||||||
|
endfunction |
@ -0,0 +1,21 @@ |
|||||||
|
" location-list niceties (copied from autoload/loclist.vim) |
||||||
|
" Barry Arthur, Mar 2015 |
||||||
|
|
||||||
|
function! loclist#bufnames() |
||||||
|
return uniq(sort(map(getloclist(0), 'bufname(v:val.bufnr)'))) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! loclist#to_args(global) |
||||||
|
let global = !empty(a:global) |
||||||
|
let arg_cmd = global ? 'args ' : 'arglocal ' |
||||||
|
exe arg_cmd . join(map(loclist#bufnames(), 'escape(v:val, " ")'), ' ') |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! loclist#do(cmd) |
||||||
|
" create a new window so as not to interfere with user's arglist |
||||||
|
split |
||||||
|
call loclist#to_args(0) " 0 == local not global |
||||||
|
exe 'argdo ' . a:cmd |
||||||
|
close |
||||||
|
endfunction |
||||||
|
|
@ -0,0 +1,91 @@ |
|||||||
|
function! s:as_category(category) |
||||||
|
return toupper(substitute(a:category, '_', ' ', 'g')) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! s:sort_numerically(a, b) |
||||||
|
return (a:a[1] - a:b[1]) > 0 |
||||||
|
endfunction |
||||||
|
|
||||||
|
" function! s:beyes_base() |
||||||
|
|
||||||
|
" return obj |
||||||
|
" endfunction |
||||||
|
|
||||||
|
function! ml#beyes#new(category, ...) |
||||||
|
" let obj = s:beyes_base() |
||||||
|
|
||||||
|
let obj = {} |
||||||
|
let obj.categories = {} |
||||||
|
let obj.words = 0 |
||||||
|
let obj.counts = {} |
||||||
|
let obj.word_count = {} |
||||||
|
|
||||||
|
func obj.add_category(category) |
||||||
|
let arg_type = type(a:category) |
||||||
|
if arg_type == type({}) |
||||||
|
call extend(self.categories, a:category) |
||||||
|
elseif arg_type == type([]) |
||||||
|
for c in a:category |
||||||
|
call self.add_category(c) |
||||||
|
endfor |
||||||
|
elseif arg_type == type('') || type(0) || type(0.0) |
||||||
|
let self.categories[s:as_category(a:category)] = {} |
||||||
|
else |
||||||
|
echoerr 'ml#beyes#add_category Error: Unable to handle argument type ' . type(a:category) . ' for argument ' . string(a:category) |
||||||
|
endif |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.train(category, text) |
||||||
|
let category = s:as_category(a:category) |
||||||
|
let self.word_count[category] = get(self.word_count, category, 0) |
||||||
|
let self.counts[category] = get(self.counts, category, 0) + 1 |
||||||
|
for [word, cnt] in items(string#words(a:text)) |
||||||
|
let self.categories[category][word] = get(self.categories[category], word, 0) + cnt |
||||||
|
let self.word_count[category] += cnt |
||||||
|
let self.words += cnt |
||||||
|
endfor |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" Returns the scores in each category of the provided `text`, eg: |
||||||
|
" {"Uninteresting" : -12.6997928013932, "Interesting" : -18.4206807439524} |
||||||
|
" The score closest to 0 is the one picked out by classify() |
||||||
|
func obj.classifications(text) |
||||||
|
let scores = {} |
||||||
|
let training_count = 0.0 |
||||||
|
for cnt in values(self.counts) |
||||||
|
let training_count += cnt |
||||||
|
endfor |
||||||
|
for [category, words] in items(self.categories) |
||||||
|
let scores[category] = 0 |
||||||
|
let total = get(self.word_count, category, 1) * 1.0 |
||||||
|
for [word, cnt] in items(string#words(a:text)) |
||||||
|
let scores[category] += log(get(words, word, 0.1) / total) |
||||||
|
endfor |
||||||
|
" add in prior probability for the category |
||||||
|
let scores[category] += log(get(self.counts, category, 0.1) / training_count) |
||||||
|
endfor |
||||||
|
return scores |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.classify(text) |
||||||
|
" return sort(items(self.classifications(a:text)), 's:sort_numerically') |
||||||
|
return sort(items(self.classifications(a:text)), 's:sort_numerically')[0][0] |
||||||
|
endfunc |
||||||
|
|
||||||
|
|
||||||
|
call obj.add_category(a:category) |
||||||
|
if a:0 |
||||||
|
for c in a:000 |
||||||
|
call obj.add_category(c) |
||||||
|
endfor |
||||||
|
endif |
||||||
|
|
||||||
|
return obj |
||||||
|
endfunction |
||||||
|
|
||||||
|
" let b = ml#beyes#new('yes', 'no') |
||||||
|
" call b.train('yes', 'this is something good') |
||||||
|
" call b.train('no', 'this is something bad and full of hate') |
||||||
|
" echo b.classifications('something to hate you with') |
||||||
|
" echo b.classify('something to hate you with') |
@ -0,0 +1,196 @@ |
|||||||
|
" Porter stemmer in VimL. |
||||||
|
" |
||||||
|
" Taken from: |
||||||
|
" http://burakkanber.com/blog/machine-learning-full-text-search-in-javascript-relevance-scoring/ |
||||||
|
" Which referenced: |
||||||
|
" Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, |
||||||
|
" no. 3, pp 130-137, |
||||||
|
" |
||||||
|
" see also http://www.tartarus.org/~martin/PorterStemmer |
||||||
|
|
||||||
|
let s:step2list = { |
||||||
|
\ "ational" : "ate" |
||||||
|
\, "tional" : "tion" |
||||||
|
\, "enci" : "ence" |
||||||
|
\, "anci" : "ance" |
||||||
|
\, "izer" : "ize" |
||||||
|
\, "bli" : "ble" |
||||||
|
\, "alli" : "al" |
||||||
|
\, "entli" : "ent" |
||||||
|
\, "eli" : "e" |
||||||
|
\, "ousli" : "ous" |
||||||
|
\, "ization" : "ize" |
||||||
|
\, "ation" : "ate" |
||||||
|
\, "ator" : "ate" |
||||||
|
\, "alism" : "al" |
||||||
|
\, "iveness" : "ive" |
||||||
|
\, "fulness" : "ful" |
||||||
|
\, "ousness" : "ous" |
||||||
|
\, "aliti" : "al" |
||||||
|
\, "iviti" : "ive" |
||||||
|
\, "biliti" : "ble" |
||||||
|
\, "logi" : "log" |
||||||
|
\} |
||||||
|
|
||||||
|
let s:step3list = { |
||||||
|
\ "icate" : "ic" |
||||||
|
\, "ative" : "" |
||||||
|
\, "alize" : "al" |
||||||
|
\, "iciti" : "ic" |
||||||
|
\, "ical" : "ic" |
||||||
|
\, "ful" : "" |
||||||
|
\, "ness" : "" |
||||||
|
\} |
||||||
|
|
||||||
|
let s:c = "[^aeiou]" " consonant |
||||||
|
let s:v = "[aeiouy]" " vowel |
||||||
|
let s:C = s:c . "[^aeiouy]*" " consonant sequence |
||||||
|
let s:V = s:v . "[aeiou]*" " vowel sequence |
||||||
|
|
||||||
|
let s:mgr0 = '^\(' . s:C . '\)\?' . s:V . s:C " [C]VC... is m>0 |
||||||
|
let s:meq1 = '^\(' . s:C . '\)\?' . s:V . s:C . '\(' . s:V . '\)\?$' " [C]VC[V] is m=1 |
||||||
|
let s:mgr1 = '^\(' . s:C . '\)\?' . s:V . s:C . s:V . s:C " [C]VCVC... is m>1 |
||||||
|
let s:s_v = '^\(' . s:C . '\)\?' . s:v " vowel in stem |
||||||
|
|
||||||
|
function! s:p(s) |
||||||
|
return |
||||||
|
echom string(a:s) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! ml#porter#stemmer(w) |
||||||
|
let w = a:w |
||||||
|
|
||||||
|
if len(w) < 3 |
||||||
|
return w |
||||||
|
endif |
||||||
|
|
||||||
|
let firstch = w[0] |
||||||
|
if firstch == 'y' |
||||||
|
let w = 'Y' . w[1:] |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 1a |
||||||
|
let re = '^\(.\{-}\)\(ss\|i\)es$' |
||||||
|
let re2 = '^\(.\{-}\)\([^s]\)s$' |
||||||
|
|
||||||
|
if w =~ re |
||||||
|
let w = substitute(w, re, '\1\2', '') |
||||||
|
elseif w =~ re2 |
||||||
|
let w = substitute(w, re2, '\1\2', '') |
||||||
|
endif |
||||||
|
|
||||||
|
call s:p(w) |
||||||
|
|
||||||
|
" Step 1b |
||||||
|
let re = '^\(.\{-}\)eed$' |
||||||
|
let re2 = '^\(.\{-}\)\(ed\|ing\)$' |
||||||
|
|
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let re = s:mgr0 |
||||||
|
if fp[1] =~ re |
||||||
|
let re = '.$' |
||||||
|
let w = substitute(w, re, '', '') |
||||||
|
endif |
||||||
|
elseif w =~ re2 |
||||||
|
let fp = matchlist(w, re2) |
||||||
|
let stem = fp[1] |
||||||
|
let re2 = s:s_v |
||||||
|
if stem =~ re2 |
||||||
|
let w = stem |
||||||
|
let re2 = '\(at\|bl\|iz\)$' |
||||||
|
let re3 = '\([^aeiouylsz]\)\1$' |
||||||
|
let re4 = '^' . s:C . s:v . '[^aeiouwxy]$' |
||||||
|
if w =~ re2 |
||||||
|
let w = w . 'e' |
||||||
|
elseif w =~ re3 |
||||||
|
let re = '.$' |
||||||
|
let w = substitute(w, re, '', '') |
||||||
|
elseif w =~ re4 |
||||||
|
let w = w . 'e' |
||||||
|
endif |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 1c |
||||||
|
let re = '^\(.\{-}\)y$' |
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let stem = fp[1] |
||||||
|
let re = s:s_v |
||||||
|
if stem =~ re |
||||||
|
let w = stem . 'i' |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 2 |
||||||
|
let re = '^\(.\{-}\)\(ational\|tional\|enci\|anci\|izer\|bli\|alli\|entli\|eli\|ousli\|ization\|ation\|ator\|alism\|iveness\|fulness\|ousness\|aliti\|iviti\|biliti\|logi\)$' |
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let stem = fp[1] |
||||||
|
let suffix = fp[2] |
||||||
|
let re = s:mgr0 |
||||||
|
if stem =~ re |
||||||
|
let w = stem . s:step2list[suffix] |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 3 |
||||||
|
let re = '^\(.\{-}\)\(icate\|ative\|alize\|iciti\|ical\|ful\|ness\)$' |
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let stem = fp[1] |
||||||
|
let suffix = fp[2] |
||||||
|
let re = s:mgr0 |
||||||
|
if stem =~ re |
||||||
|
let w = stem . s:step3list[suffix] |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 4 |
||||||
|
let re = '^\(.\{-}\)\(al\|ance\|ence\|er\|ic\|able\|ible\|ant\|ement\|ment\|ent\|ou\|ism\|ate\|iti\|ous\|ive\|ize\)$' |
||||||
|
let re2 = '^\(.\{-}\)\(s\|t\)\(ion\)$' |
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let stem = fp[1] |
||||||
|
let re = s:mgr1 |
||||||
|
if stem =~ re |
||||||
|
let w = stem |
||||||
|
endif |
||||||
|
elseif w =~ re2 |
||||||
|
let fp = matchlist(w, re2) |
||||||
|
let stem = fp[1] . fp[2] |
||||||
|
let re2 = s:mgr1 |
||||||
|
if stem =~ re2 |
||||||
|
let w = stem |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
" Step 5 |
||||||
|
let re = '^\(.\{-}\)e$' |
||||||
|
if w =~ re |
||||||
|
let fp = matchlist(w, re) |
||||||
|
let stem = fp[1] |
||||||
|
let re = s:mgr1 |
||||||
|
let re2 = s:meq1 |
||||||
|
let re3 = '^' . s:C . s:v . '[^aeiouwxy]$' |
||||||
|
if (stem =~ re || stem =~ re2) && stem !~ re3 |
||||||
|
let w = stem |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
let re = 'll$' |
||||||
|
let re2 = s:mgr1 |
||||||
|
if w =~ re && w =~ re2 |
||||||
|
let re = '.$' |
||||||
|
let w = substitute(w, re, '', '') |
||||||
|
endif |
||||||
|
|
||||||
|
" and turn initial Y back to y |
||||||
|
|
||||||
|
if firstch == 'y' |
||||||
|
let w = 'y' . w[1:] |
||||||
|
endif |
||||||
|
|
||||||
|
return w |
||||||
|
endfunction |
@ -0,0 +1,115 @@ |
|||||||
|
function! overlay#controller(...) |
||||||
|
if a:0 |
||||||
|
for [key, act] in items(a:1) |
||||||
|
exe 'nnoremap <buffer> ' . key . ' ' . act |
||||||
|
endfor |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
let s:overlay_count = 1 |
||||||
|
|
||||||
|
function! overlay#show(list, actions, ...) |
||||||
|
let overlay_parent_altbuf = bufnr('#') |
||||||
|
let overlay_parent = bufnr('%') |
||||||
|
|
||||||
|
let options = { |
||||||
|
\ 'filter' : 1, |
||||||
|
\ 'use_split' : 0, |
||||||
|
\ 'auto_act' : 0, |
||||||
|
\ 'name' : '__overlay__' |
||||||
|
\ } |
||||||
|
if a:0 |
||||||
|
if type(a:1) == type({}) |
||||||
|
call extend(options, a:1) |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
if options.name == '__overlay__' |
||||||
|
let options.name .= s:overlay_count . '__' |
||||||
|
let s:overlay_count += 1 |
||||||
|
endif |
||||||
|
|
||||||
|
if options.use_split |
||||||
|
hide noautocmd split |
||||||
|
endif |
||||||
|
hide noautocmd enew |
||||||
|
let b:options = options |
||||||
|
" let b:overlay_use_split = b:options.use_split |
||||||
|
let b:overlay_parent = overlay_parent |
||||||
|
let b:overlay_parent_altbuf = overlay_parent_altbuf |
||||||
|
setlocal buftype=nofile |
||||||
|
setlocal bufhidden=hide |
||||||
|
setlocal noswapfile |
||||||
|
setlocal nobuflisted |
||||||
|
setlocal foldmethod=manual |
||||||
|
setlocal foldcolumn=0 |
||||||
|
setlocal nospell |
||||||
|
setlocal modifiable |
||||||
|
setlocal noreadonly |
||||||
|
for o in keys(filter(copy(options), 'v:key =~ "^set"')) |
||||||
|
exe o |
||||||
|
endfor |
||||||
|
exe 'file ' . b:options.name |
||||||
|
|
||||||
|
1 |
||||||
|
call overlay#update(a:list) |
||||||
|
|
||||||
|
let old_is = &incsearch |
||||||
|
set incsearch |
||||||
|
let old_hls = &hlsearch |
||||||
|
set hlsearch |
||||||
|
call overlay#controller(a:actions) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! overlay#update(list) |
||||||
|
let line = line('.') |
||||||
|
% delete |
||||||
|
call append(0, a:list) |
||||||
|
$ |
||||||
|
delete _ |
||||||
|
exe line |
||||||
|
if b:options.filter |
||||||
|
if exists(':Filter') |
||||||
|
Filter |
||||||
|
else |
||||||
|
call feedkeys('/') |
||||||
|
endif |
||||||
|
endif |
||||||
|
if b:options.auto_act |
||||||
|
if line('$') == 1 |
||||||
|
call feedkeys("\<enter>") |
||||||
|
endif |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! overlay#close() |
||||||
|
if b:options.use_split |
||||||
|
let scratch_buf = bufnr('') |
||||||
|
wincmd q |
||||||
|
exe 'bwipe ' . scratch_buf |
||||||
|
else |
||||||
|
exe 'buffer ' . b:overlay_parent |
||||||
|
bwipe # |
||||||
|
if exists('b:overlay_parent_altbuf') |
||||||
|
\ && buflisted(b:overlay_parent_altbuf) |
||||||
|
exe 'buffer ' . b:overlay_parent_altbuf |
||||||
|
silent! buffer # |
||||||
|
endif |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! overlay#select_line() |
||||||
|
let line = getline('.') |
||||||
|
call overlay#close() |
||||||
|
return line |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! overlay#select_buffer() |
||||||
|
let lines = getline(1,'$') |
||||||
|
call overlay#close() |
||||||
|
return lines |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! overlay#command(cmd, actions, options) |
||||||
|
call overlay#show(vimple#redir(a:cmd), a:actions, a:options) |
||||||
|
endfunction |
@ -0,0 +1,58 @@ |
|||||||
|
function! parse#ini#from_file(file) |
||||||
|
let file = a:file |
||||||
|
if ! filereadable(file) |
||||||
|
throw "E484: Can't open file " . file |
||||||
|
endif |
||||||
|
return parse#ini#from_string(join(readfile(file), "\n")) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! parse#ini#from_string(string) |
||||||
|
let scanner = string#scanner(a:string) |
||||||
|
let data = {} |
||||||
|
let current_section = data |
||||||
|
|
||||||
|
while ! scanner.eos() |
||||||
|
call scanner.skip('\_s\+') |
||||||
|
if scanner.scan(';') != "" |
||||||
|
call scanner.skip_until('[\r\n]\+') |
||||||
|
elseif scanner.scan('\[\([^\]]\+\)\]') != "" |
||||||
|
let section_name = scanner.matches[1] |
||||||
|
let data[section_name] = {} |
||||||
|
let current_section = data[section_name] |
||||||
|
elseif scanner.scan('\([^=]\+\)\s*=\s*\(\%([\r\n]\@!.\)*\)') != "" |
||||||
|
let current_section[string#trim(scanner.matches[1])] |
||||||
|
\ = string#eval((scanner.matches[2])) |
||||||
|
endif |
||||||
|
endwhile |
||||||
|
|
||||||
|
return data |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! parse#ini#to_file(hash, file) |
||||||
|
call writefile(split(parse#ini#to_string(a:hash), "\n"), a:file) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! parse#ini#to_string(hash) |
||||||
|
let hash = a:hash |
||||||
|
let head = '' |
||||||
|
let body = '' |
||||||
|
if type(hash) != type({}) |
||||||
|
throw 'Expected Dictionary but given ' . variable#type_to_string(hash) |
||||||
|
endif |
||||||
|
for [section, values] in items(hash) |
||||||
|
if type(values) == type({}) |
||||||
|
let body .= '[' . section . "]\n" |
||||||
|
for [name, val] in items(values) |
||||||
|
let body .= name . ' = ' . string#to_string(val) . "\n" |
||||||
|
unlet val |
||||||
|
endfor |
||||||
|
elseif type(values) == type([]) |
||||||
|
" what now?! |
||||||
|
else |
||||||
|
let head .= section . ' = ' . string#to_string(values) . "\n" |
||||||
|
endif |
||||||
|
unlet values |
||||||
|
endfor |
||||||
|
return head . body |
||||||
|
endfunction |
||||||
|
|
@ -0,0 +1,23 @@ |
|||||||
|
" quickfix niceties |
||||||
|
" Barry Arthur, Jan 2012 |
||||||
|
|
||||||
|
" original idea from: |
||||||
|
" http://stackoverflow.com/questions/1830839/how-to-open-multiple-files-in-vim-after-vimgrep |
||||||
|
|
||||||
|
function! quickfix#bufnames() |
||||||
|
return uniq(sort(map(getqflist(), 'bufname(v:val.bufnr)'))) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! quickfix#to_args(global) |
||||||
|
let global = !empty(a:global) |
||||||
|
let arg_cmd = global ? 'args ' : 'arglocal ' |
||||||
|
exe arg_cmd . join(map(quickfix#bufnames(), 'escape(v:val, " ")'), ' ') |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! quickfix#do(cmd) |
||||||
|
" create a new window so as not to interfere with user's arglist |
||||||
|
split |
||||||
|
call quickfix#to_args(0) " 0 == local not global |
||||||
|
exe 'argdo ' . a:cmd |
||||||
|
close |
||||||
|
endfunction |
@ -0,0 +1,74 @@ |
|||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
function! regex#ExtendedRegex(...) |
||||||
|
let erex = {} |
||||||
|
let erex.lookup_function = '' |
||||||
|
let erex.lookup_dict = {} |
||||||
|
|
||||||
|
func erex.default_lookup(name) dict |
||||||
|
return eval(a:name) |
||||||
|
endfunc |
||||||
|
|
||||||
|
"TODO: revisit this with eval() solution |
||||||
|
func erex.lookup(name) dict |
||||||
|
if empty(self.lookup_function) |
||||||
|
return call(self.default_lookup, [a:name], self) |
||||||
|
else |
||||||
|
"TODO: this 'self' dict arg needs to be the object's self... |
||||||
|
return call(self.lookup_function, [a:name], self.lookup_dict) |
||||||
|
endif |
||||||
|
endfunc |
||||||
|
|
||||||
|
func erex.expand_composition_atom(ext_reg) dict |
||||||
|
let ext_reg = a:ext_reg |
||||||
|
let composition_atom = '\\%{\s*\([^,} \t]\+\)\%(\s*,\s*\(\d\+\)\%(\s*,\s*\(.\{-}\)\)\?\)\?\s*}' |
||||||
|
let remaining = match(ext_reg, composition_atom) |
||||||
|
while remaining != -1 |
||||||
|
let [_, name, cnt, sep ;__] = matchlist(ext_reg, composition_atom) |
||||||
|
let cnt = cnt ? cnt : 1 |
||||||
|
let sep = escape(escape(sep, '.*[]$^'), '\\') |
||||||
|
let pattern = escape(self.lookup(name), '\\' ) |
||||||
|
let ext_reg = substitute(ext_reg, composition_atom, join(repeat([pattern], cnt), sep), '') |
||||||
|
let remaining = match(ext_reg, composition_atom) |
||||||
|
endwhile |
||||||
|
return ext_reg |
||||||
|
endfunc |
||||||
|
|
||||||
|
func erex.expand(ext_reg) dict |
||||||
|
return self.expand_composition_atom(a:ext_reg) |
||||||
|
endfunc |
||||||
|
|
||||||
|
func erex.parse_multiline_regex(ext_reg) dict |
||||||
|
return substitute(substitute(substitute(a:ext_reg, '#\s\+\S\+', '', 'g'), '\\\@<! ', '', 'g'), '\(\\\\\)\@<=\zs\s\+', '', 'g') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" common public API |
||||||
|
|
||||||
|
func erex.register_lookup(callback) dict |
||||||
|
let self.lookup_function = a:callback |
||||||
|
endfunc |
||||||
|
|
||||||
|
func erex.register_lookup_dict(dict) dict |
||||||
|
let self.lookup_dict = a:dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func erex.parse(ext_reg) dict |
||||||
|
return self.expand(self.parse_multiline_regex(a:ext_reg)) |
||||||
|
endfunc |
||||||
|
|
||||||
|
if a:0 |
||||||
|
call erex.register_lookup(a:1) |
||||||
|
if a:0 > 1 |
||||||
|
call erex.register_lookup_dict(a:2) |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
return erex |
||||||
|
endfunction |
||||||
|
|
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
|
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,18 @@ |
|||||||
|
" George Marsaglia's Multiply-with-carry Random Number Generator |
||||||
|
" Modified to work within Vim's semantics |
||||||
|
let s:m_w = 1 + getpid() |
||||||
|
let s:m_z = localtime() |
||||||
|
|
||||||
|
" not sure of the wisdom of generating a full 32-bit RN here |
||||||
|
" and then using abs() on the sucker. Feedback welcome. |
||||||
|
function! rng#rand(...) |
||||||
|
if a:0 == 0 |
||||||
|
let s:m_z = (36969 * and(s:m_z, 0xffff)) + (s:m_z / 65536) |
||||||
|
let s:m_w = (18000 * and(s:m_w, 0xffff)) + (s:m_w / 65536) |
||||||
|
return (s:m_z * 65536) + s:m_w " 32-bit result |
||||||
|
elseif a:0 == 1 " We return a number in [0, a:1] or [a:1, 0] |
||||||
|
return a:1 < 0 ? rng#rand(a:1,0) : rng#rand(0,a:1) |
||||||
|
else " if a:0 >= 2 |
||||||
|
return abs(rng#rand()) % (abs(a:2 - a:1) + 1) + a:1 |
||||||
|
endif |
||||||
|
endfunction |
@ -0,0 +1,92 @@ |
|||||||
|
function! scope#pair(head, tail) |
||||||
|
let obj = {} |
||||||
|
let obj.head = a:head |
||||||
|
let obj.tail = a:tail |
||||||
|
let obj.head_line_number = obj.head[0] |
||||||
|
let obj.tail_line_number = obj.tail[0] |
||||||
|
|
||||||
|
if len(obj.head[1]) == 0 |
||||||
|
let obj.head_string = '' |
||||||
|
elseif join(obj.head[1][1:]) == '' |
||||||
|
let obj.head_string = obj.head[1][0] |
||||||
|
else |
||||||
|
let obj.head_string = string#trim(join(obj.head[1][1:], ' ')) |
||||||
|
endif |
||||||
|
|
||||||
|
if len(obj.tail[1]) == 0 |
||||||
|
let obj.tail_string = '' |
||||||
|
elseif join(obj.tail[1][1:]) == '' |
||||||
|
let obj.tail_string = obj.tail[1][0] |
||||||
|
else |
||||||
|
let obj.tail_string = join(obj.tail[1][1:], ' ') |
||||||
|
endif |
||||||
|
|
||||||
|
return obj |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! scope#inspect(head_pattern, tail_pattern) |
||||||
|
let obj = {} |
||||||
|
let obj.head_search_pattern = substitute(a:head_pattern, '\\(', '\\%(', 'g') |
||||||
|
let obj.head_collect_pattern = a:head_pattern |
||||||
|
let obj.tail_search_pattern = substitute(a:tail_pattern, '\\(', '\\%(', 'g') |
||||||
|
if obj.tail_search_pattern !~ '\\z[es]' && obj.tail_search_pattern !~ '\$$' |
||||||
|
let obj.tail_search_pattern = obj.tail_search_pattern . '\zs' |
||||||
|
endif |
||||||
|
let obj.tail_collect_pattern = a:tail_pattern |
||||||
|
|
||||||
|
func obj.init() |
||||||
|
let self.stack = [] |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.push(head, tail) |
||||||
|
call add(self.stack, scope#pair([a:head, matchlist(getline(a:head), self.head_collect_pattern)], [a:tail, matchlist(getline(a:tail), self.tail_collect_pattern)])) |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.find_outer_tail() |
||||||
|
let self.outer_tail = searchpair(self.head_search_pattern, '', self.tail_search_pattern, 'rcnW') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.find_outer_head() |
||||||
|
let self.outer_head = searchpair(self.head_search_pattern, '', self.tail_search_pattern, 'rbcnW') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.find_current_head() |
||||||
|
let self.current_head = searchpair(self.head_search_pattern, '', self.tail_search_pattern, 'bW') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.find_current_tail() |
||||||
|
let self.current_tail = searchpair(self.head_search_pattern, '', self.tail_search_pattern, 'nW') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.scope() |
||||||
|
let self.stack = reverse(list#lrotate(self.stack)) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.get_scope() |
||||||
|
call self.init() |
||||||
|
call self.find_outer_tail() |
||||||
|
if self.outer_tail == 0 |
||||||
|
return self |
||||||
|
endif |
||||||
|
|
||||||
|
let cur_pos = getpos('.') |
||||||
|
|
||||||
|
call self.find_outer_head() |
||||||
|
if self.outer_head == 0 |
||||||
|
return self |
||||||
|
endif |
||||||
|
call self.push(self.outer_head, self.outer_tail) |
||||||
|
call self.find_current_head() |
||||||
|
while self.current_head > self.outer_head |
||||||
|
call self.find_current_tail() |
||||||
|
call self.push(self.current_head, self.current_tail) |
||||||
|
call self.find_current_head() |
||||||
|
endwhile |
||||||
|
|
||||||
|
call setpos('.', cur_pos) |
||||||
|
return self.scope() |
||||||
|
endfunction |
||||||
|
|
||||||
|
return obj.get_scope() |
||||||
|
endfunction |
@ -0,0 +1,47 @@ |
|||||||
|
let s:script_dir = expand('<sfile>:p:h:h') |
||||||
|
let s:script_db = s:script_dir . '/scripts.db' |
||||||
|
let s:init_sql = 'create virtual table plugins using fts4 (plugin, file, type, content);' |
||||||
|
let s:content_sql = 'insert into plugins values("%s", "%s", "%s", "%s")' |
||||||
|
|
||||||
|
function! scripts#query(sql) |
||||||
|
let sql = 'sqlite3 ' . s:script_db . " '" . a:sql . "'" |
||||||
|
return system(sql) |
||||||
|
endfunc |
||||||
|
|
||||||
|
function! scripts#escape(value) |
||||||
|
return substitute(substitute(a:value, '"', '""', 'g'), "'", "'\"'\"'", 'g') |
||||||
|
endfunc |
||||||
|
|
||||||
|
function! scripts#init() |
||||||
|
if filereadable(s:script_db) |
||||||
|
call delete(s:script_db) |
||||||
|
endif |
||||||
|
call scripts#query(s:init_sql) |
||||||
|
redir => scripts |
||||||
|
silent scriptnames |
||||||
|
redir END |
||||||
|
for s in split(scripts, "\n") |
||||||
|
if s == "" |
||||||
|
continue |
||||||
|
endif |
||||||
|
let file = matchstr(s, '^\s*\d\+:\s*\zs\(.*\)') |
||||||
|
let content = readfile(file) |
||||||
|
let plugin = '' |
||||||
|
if file =~ '/\.\?\(ex\|gvim\|vim\)rc$' |
||||||
|
let type = 'vimrc' |
||||||
|
let plugin = matchstr(file, '/\zs.\+\ze/\.\?\(ex\|gvim\|vim\)rc$') |
||||||
|
elseif file =~ '/autoload/' |
||||||
|
let type = 'autoload' |
||||||
|
elseif file =~ '/after/' |
||||||
|
let type = matchstr(file, '/\zsafter/.\+\ze/[^/]\+$') |
||||||
|
else |
||||||
|
let type = matchstr(file, '.*/\zs.\+\ze/[^/]\+$') |
||||||
|
endif |
||||||
|
if plugin == '' |
||||||
|
let plugin = matchstr(file, '.*/\zs.\+\ze/' . type) |
||||||
|
endif |
||||||
|
echo scripts#query(printf(s:content_sql, scripts#escape(plugin), scripts#escape(file), scripts#escape(type), scripts#escape(join(content, "\n")))) |
||||||
|
endfor |
||||||
|
endfunction |
||||||
|
|
||||||
|
command! ScriptMatch echo scripts#query('select file from plugins where content match "' . scripts#escape(<q-args>) . '"') |
@ -0,0 +1,292 @@ |
|||||||
|
function! string#scanner(str) |
||||||
|
let obj = {} |
||||||
|
if type(a:str) == type([]) |
||||||
|
let obj.string = join(a:str, "\n") |
||||||
|
else |
||||||
|
let obj.string = a:str |
||||||
|
endif |
||||||
|
let obj.length = len(obj.string) |
||||||
|
let obj.index = 0 |
||||||
|
|
||||||
|
func obj.eos() dict |
||||||
|
return self.index >= self.length |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.inject(str) |
||||||
|
let self.string = strpart(self.string, 0, self.index) |
||||||
|
\ . a:str . strpart(self.string, self.index) |
||||||
|
let self.length = len(self.string) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.skip(pat) dict |
||||||
|
let pos = matchend(self.string, '\_^' . a:pat, self.index) |
||||||
|
if pos != -1 |
||||||
|
let self.index = pos |
||||||
|
endif |
||||||
|
return pos |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.skip_until(pat) dict |
||||||
|
let pos = matchend(self.string, '\_.\{-}\ze' . a:pat, self.index) |
||||||
|
if pos != -1 |
||||||
|
let self.index = pos |
||||||
|
endif |
||||||
|
return pos |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.scan(pat) dict |
||||||
|
" Use \_^ here to anchor the match at the start of the index. |
||||||
|
" Otherwise it finds the first match after index. |
||||||
|
let m = matchlist(self.string, '\_^' . a:pat, self.index) |
||||||
|
if ! empty(m) |
||||||
|
let self.index += len(m[0]) |
||||||
|
let self.matches = m |
||||||
|
return m[0] |
||||||
|
endif |
||||||
|
return "" |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.collect(pat) dict |
||||||
|
let matches = [] |
||||||
|
while ! self.eos() |
||||||
|
if self.skip_until(a:pat) == -1 |
||||||
|
break |
||||||
|
endif |
||||||
|
call add(matches, self.scan(a:pat)) |
||||||
|
endwhile |
||||||
|
return matches |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.split(sep, ...) dict |
||||||
|
let keepsep = 0 |
||||||
|
if a:0 |
||||||
|
let keepsep = a:1 |
||||||
|
endif |
||||||
|
let pieces = [] |
||||||
|
let old_index = 0 |
||||||
|
while ! self.eos() |
||||||
|
if self.skip_until(a:sep) == -1 |
||||||
|
call add(pieces, strpart(self.string, old_index)) |
||||||
|
break |
||||||
|
endif |
||||||
|
let the_piece = strpart(self.string, old_index, (self.index - old_index)) |
||||||
|
call add(pieces, the_piece) |
||||||
|
let the_sep = self.scan(a:sep) |
||||||
|
if keepsep && (the_sep != '') |
||||||
|
call add(pieces, the_sep) |
||||||
|
endif |
||||||
|
if old_index == self.index |
||||||
|
call add(pieces, strpart(self.string, old_index, 1)) |
||||||
|
let self.index += 1 |
||||||
|
endif |
||||||
|
let old_index = self.index |
||||||
|
endwhile |
||||||
|
return pieces |
||||||
|
endfunc |
||||||
|
|
||||||
|
return obj |
||||||
|
endfunction |
||||||
|
|
||||||
|
" A list of tokens with navigation methods & element access |
||||||
|
function! string#tokens() |
||||||
|
let obj = {} |
||||||
|
let obj.tokens = [] |
||||||
|
let obj.index = 0 |
||||||
|
let obj.cur_tok = [] |
||||||
|
let obj.next_tok = [] |
||||||
|
|
||||||
|
"foo |
||||||
|
func obj.finalise() |
||||||
|
call add(self.tokens, ['_end_', '_end_', self.tokens[-1][-1]]) |
||||||
|
let self.num_tokens = len(self.tokens) |
||||||
|
let self.next_tok = self.tokens[0] |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.next() |
||||||
|
let self.cur_tok = self.next_tok |
||||||
|
if self.index < self.num_tokens |
||||||
|
let self.index += 1 |
||||||
|
endif |
||||||
|
let self.next_tok = self.tokens[self.index] |
||||||
|
return self.cur_tok |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.add(type, value, line) |
||||||
|
call add(self.tokens, [a:type, a:value, a:line]) |
||||||
|
endfunc |
||||||
|
|
||||||
|
return obj |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! string#lexer(string) |
||||||
|
let obj = {} |
||||||
|
let obj.tokens = string#tokens() |
||||||
|
let obj.string = '' |
||||||
|
let obj.line_continuation_pattern = '\n\s*\\' |
||||||
|
let obj.pattern_order = [ |
||||||
|
\ 'whitespace', 'name' |
||||||
|
\, 'float_number', 'hex_number', 'oct_number', 'int_number' |
||||||
|
\, 'tq_string', 'dq_string', 'sq_string' |
||||||
|
\, 'operator', 'comment', 'unknown' |
||||||
|
\] |
||||||
|
let obj.newline_patterns = [ |
||||||
|
\ 'whitespace' |
||||||
|
\, 'tq_string', 'dq_string', 'sq_string' |
||||||
|
\, 'comment', 'unknown' |
||||||
|
\] |
||||||
|
let obj.patterns = { |
||||||
|
\ 'whitespace' : ['\s\+', '\n\%(\s*\\\s*\)\?'] |
||||||
|
\, 'name' : ['[ablgstw]:\w*', '[_a-zA-Z]\+'] |
||||||
|
\, 'float_number' : ['\d\+\.\d\+\%([eE][+-]\?\d\+\)\?'] |
||||||
|
\, 'hex_number' : ['0x\x\+'] |
||||||
|
\, 'oct_number' : ['0\o\+'] |
||||||
|
\, 'int_number' : ['\d\+'] |
||||||
|
\, 'tq_string' : ['"""\_.\{-}"""'] |
||||||
|
\, 'dq_string' : ['"\%(\\\.\|[^\n]\)*"'] |
||||||
|
\, 'sq_string' : ['''\%(''''\|\_.\)\{-}'''] |
||||||
|
\, 'operator' : ['[\\\[\](){}<>:,./\\?=+!@#$%^&*`~|-]\+'] |
||||||
|
\, 'comment' : ['"[^\n]*\n'] |
||||||
|
\, 'unknown' : ['\S\+'] |
||||||
|
\} |
||||||
|
|
||||||
|
func obj.new(str) |
||||||
|
let self.tokens = string#tokens() |
||||||
|
if type(a:str) == type([]) |
||||||
|
let self.string = join(a:str, "\n") |
||||||
|
else |
||||||
|
let self.string = a:str |
||||||
|
endif |
||||||
|
let self.ss = string#scanner(self.string . "\n") |
||||||
|
call self.lex() |
||||||
|
let self.tokens = self.tokens.finalise() |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.join_line_continuations(string) |
||||||
|
return substitute(a:string, self.line_continuation_pattern, '', 'g') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.lex() |
||||||
|
let lines = 1 |
||||||
|
while self.ss.index < self.ss.length |
||||||
|
let matched = 0 |
||||||
|
for type in self.pattern_order |
||||||
|
for pat in self.patterns[type] |
||||||
|
let value = self.ss.scan(pat) |
||||||
|
if value != '' |
||||||
|
let matched = 1 |
||||||
|
let t_value = value |
||||||
|
if index(self.newline_patterns, type) != -1 |
||||||
|
let value = self.join_line_continuations(value) |
||||||
|
endif |
||||||
|
call self.tokens.add(type, value, lines) |
||||||
|
if index(self.newline_patterns, type) != -1 |
||||||
|
let lines += len(substitute(t_value, '[^\n]', '', 'g')) |
||||||
|
endif |
||||||
|
break |
||||||
|
endif |
||||||
|
endfor |
||||||
|
if matched |
||||||
|
break |
||||||
|
endif |
||||||
|
endfor |
||||||
|
endwhile |
||||||
|
endfunc |
||||||
|
|
||||||
|
return obj.new(a:string) |
||||||
|
endfunction |
||||||
|
|
||||||
|
|
||||||
|
let s:stops = map( |
||||||
|
\ ["a" , "about" , "above" , "after" , "again" , "against" , "all" , "am" , "an" , "and" , "any" , "are" , "aren't" , "as" , "at" , "be" , "because" , "been" , "before" , "being" , "below" , "between" , "both" , "but" , "by" , "can't" , "cannot" , "could" , "couldn't" , "did" , "didn't" , "do" , "does" , "doesn't" , "doing" , "don't" , "down" , "during" , "each" , "few" , "for" , "from" , "further" , "had" , "hadn't" , "has" , "hasn't" , "have" , "haven't" , "having" , "he" , "he'd" , "he'll" , "he's" , "her" , "here" , "here's" , "hers" , "herself" , "him" , "himself" , "his" , "how" , "how's" , "i" , "i'd" , "i'll" , "i'm" , "i've" , "if" , "in" , "into" , "is" , "isn't" , "it" , "it's" , "its" , "itself" , "let's" , "me" , "more" , "most" , "mustn't" , "my" , "myself" , "no" , "nor" , "not" , "of" , "off" , "on" , "once" , "only" , "or" , "other" , "ought" , "our" , "ours" , "ourselves" , "out" , "over" , "own" , "same" , "shan't" , "she" , "she'd" , "she'll" , "she's" , "should" , "shouldn't" , "so" , "some" , "such" , "than" , "that" , "that's" , "the" , "their" , "theirs" , "them" , "themselves" , "then" , "there" , "there's" , "these" , "they" , "they'd" , "they'll" , "they're" , "they've" , "this" , "those" , "through" , "to" , "too" , "under" , "until" , "up" , "very" , "was" , "wasn't" , "we" , "we'd" , "we'll" , "we're" , "we've" , "were" , "weren't" , "what" , "what's" , "when" , "when's" , "where" , "where's" , "which" , "while" , "who" , "who's" , "whom" , "why" , "why's" , "with" , "won't" , "would" , "wouldn't" , "you" , "you'd" , "you'll" , "you're" , "you've" , "your" , "yours" , "yourself" , "yourselves"] |
||||||
|
\, 'ml#porter#stemmer(v:val)') |
||||||
|
|
||||||
|
function! string#tokenize(text) |
||||||
|
let t = (type(a:text) == type([]) ? join(a:text, ' ') : a:text) |
||||||
|
let text = map( |
||||||
|
\ split( |
||||||
|
\ substitute( |
||||||
|
\ substitute( |
||||||
|
\ substitute(tolower(t) |
||||||
|
\ , '\W', ' ', 'g') |
||||||
|
\ , '\s\+', ' ', 'g') |
||||||
|
\ , '^\s*\(.\{-}\)\s*$', '\1', '') |
||||||
|
\ , ' ') |
||||||
|
\, 'ml#porter#stemmer(v:val)') |
||||||
|
|
||||||
|
" Filter out stops |
||||||
|
let out = [] |
||||||
|
for word in text |
||||||
|
if index(s:stops, word) == -1 |
||||||
|
call add(out, word) |
||||||
|
endif |
||||||
|
endfor |
||||||
|
|
||||||
|
return out |
||||||
|
endfunction |
||||||
|
|
||||||
|
|
||||||
|
function! string#trim(str) |
||||||
|
return matchstr(a:str, '^\_s*\zs.\{-}\ze\_s*$') |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! string#to_string(obj) |
||||||
|
let obj = a:obj |
||||||
|
if type(obj) < 2 |
||||||
|
return obj |
||||||
|
else |
||||||
|
return string(obj) |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! string#eval(line) |
||||||
|
let line = string#trim(a:line) |
||||||
|
if line[0] =~ '[{[]' |
||||||
|
return eval(line) |
||||||
|
else |
||||||
|
return line |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
" range(number) - ['A' .. 'A'+number] |
||||||
|
" range(65, 90) - ['a' .. 'z'] |
||||||
|
" range('a', 'f') - ['a' .. 'f'] |
||||||
|
" range('A', 6) - ['A' .. 'F'] |
||||||
|
function! string#range(...) |
||||||
|
if ! a:0 |
||||||
|
throw 'vimple string#range: not enough arguments' |
||||||
|
endif |
||||||
|
if a:0 > 2 |
||||||
|
throw 'vimple string#range: too many arguments' |
||||||
|
endif |
||||||
|
if a:0 == 1 |
||||||
|
return map(range(a:1), 'nr2char(char2nr("A")+v:val)') |
||||||
|
else |
||||||
|
if type(a:1) == type(0) |
||||||
|
let start = a:1 |
||||||
|
else |
||||||
|
let start = char2nr(a:1) |
||||||
|
endif |
||||||
|
if type(a:2) == type(0) |
||||||
|
if type(a:1) == type(0) |
||||||
|
let end = a:2 |
||||||
|
else |
||||||
|
let end = (start + a:2) - 1 |
||||||
|
endif |
||||||
|
else |
||||||
|
let end = char2nr(a:2) |
||||||
|
endif |
||||||
|
return map(range(start, end), 'nr2char(v:val)') |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
" returns a dict of {word : count} |
||||||
|
function! string#words(text) |
||||||
|
let words = {} |
||||||
|
for w in split(a:text) |
||||||
|
let words[w] = get(words, w, 0) + 1 |
||||||
|
endfor |
||||||
|
return words |
||||||
|
endfunction |
@ -0,0 +1,3 @@ |
|||||||
|
function! variable#type_to_string(var) |
||||||
|
return ['Number', 'String', 'Funcref', 'List', 'Dictionary', 'Float'][type(a:var)] |
||||||
|
endfunction |
@ -0,0 +1,256 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vim library provides objects for builtin ++:ex++ commands |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Version: 0.9 |
||||||
|
" Description: Vimple provides VimLOO (Object Oriented VimL) objects for |
||||||
|
" Vim's write-only ++:ex++ commands, such as ++:ls++, |
||||||
|
" ++:scriptnames++ and ++:highlight++. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
let g:vimple_version = '0.9' |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" Library Interface: {{{1 |
||||||
|
"let str = vimple#format( |
||||||
|
" \ format, |
||||||
|
" \ { 'b': ['d', 1], |
||||||
|
" \ 'f': ['s', "abc"], |
||||||
|
" \ 'n': ['s', "efg"], |
||||||
|
" \ 'l': ['s', "hij"]}, |
||||||
|
" \ default |
||||||
|
" \ ) |
||||||
|
|
||||||
|
function! vimple#format(format, args_d, default) |
||||||
|
let format = a:format == '' ? a:default : a:format |
||||||
|
let format = substitute(format, '\(%%\)*\zs%[-0-9#+ .]*c', a:default, 'g') |
||||||
|
|
||||||
|
let args = '' |
||||||
|
let items = map(split(substitute(format, '%%', '', 'g'), '\ze%'), 'matchstr(v:val, ''^%[-+#. 0-9]*.'')') |
||||||
|
call map(items, 'substitute(v:val, ''^%[-0-9#+ .]*\(.\)'', ''\1'', "g")') |
||||||
|
for item in items |
||||||
|
let arg_l = get(a:args_d, item, '') |
||||||
|
if type(arg_l) != type([]) |
||||||
|
continue |
||||||
|
endif |
||||||
|
let args .= arg_l[0] == 's' ? string(arg_l[1]) : arg_l[1] |
||||||
|
let args .= args[-1] =~ ',' ? '' : ', ' |
||||||
|
endfor |
||||||
|
let args = substitute(args, '^\s*,\s*\(.\{-}\),\s*$', '\1', '') |
||||||
|
|
||||||
|
let format = substitute(format, '\%(%%\)*%[-1-9#+ .]*\zs.', '\=get(a:args_d[submatch(0)], 0,submatch(0))', 'g') |
||||||
|
let printf_str ='printf("'.escape(format, '\"').'", '.args.')' |
||||||
|
|
||||||
|
return eval(printf_str) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#redir(command, ...) |
||||||
|
let split_pat = '\n' |
||||||
|
let str = '' |
||||||
|
if a:0 != 0 |
||||||
|
let split_pat = a:1 |
||||||
|
endif |
||||||
|
let lang = v:lang |
||||||
|
silent! language messages C |
||||||
|
redir => str |
||||||
|
silent exe a:command |
||||||
|
redir END |
||||||
|
silent! exec 'language messages ' . lang |
||||||
|
return split(str, split_pat) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#associate(lines, subs, maps) |
||||||
|
let lst = copy(a:lines) |
||||||
|
for i in range(0, len(lst) - 1) |
||||||
|
" echo lst[i] |
||||||
|
for s in a:subs |
||||||
|
" echo " " . string(s) |
||||||
|
let lst[i] = substitute(lst[i], s[0], s[1], s[2]) |
||||||
|
" echo " -->" . string(lst[i]) |
||||||
|
endfor |
||||||
|
endfor |
||||||
|
call filter(lst, 'v:val != ""') |
||||||
|
for m in a:maps |
||||||
|
" echo "\n" . m |
||||||
|
call map(lst, m) |
||||||
|
" echo "-->" . string(lst) |
||||||
|
endfor |
||||||
|
return lst |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#join(data, pattern) |
||||||
|
let x = -1 |
||||||
|
let lines = repeat([''], len(a:data)) |
||||||
|
for line in a:data |
||||||
|
if line =~ a:pattern |
||||||
|
let lines[x] .= line |
||||||
|
else |
||||||
|
let x += 1 |
||||||
|
let lines[x] = line |
||||||
|
endif |
||||||
|
endfor |
||||||
|
return filter(lines, 'v:val !~ "^$"') |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#echoc(data) |
||||||
|
for sets in a:data |
||||||
|
exe "echohl " . sets[0] |
||||||
|
exe "echon " . string(sets[1]) |
||||||
|
endfor |
||||||
|
echohl Normal |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! s:vimple_highlight(name, attrs) |
||||||
|
if !hlexists(a:name) |
||||||
|
silent exe "hi ".a:name." ".a:attrs |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Solarized inspired default colours... |
||||||
|
" Doesn't override existing user-defined colours for these highlight terms. |
||||||
|
" Shown with case here, but actually case-insensitive within Vim. |
||||||
|
" |
||||||
|
" TODO: Only vaguely considered at this stage. Based on the 16 colour |
||||||
|
" solarized pallette |
||||||
|
" the order of applying these to echoc is important |
||||||
|
" |
||||||
|
function! vimple#default_colorscheme() |
||||||
|
" Buffer List |
||||||
|
call s:vimple_highlight('vimple_BL_Number' , 'ctermfg=4 ctermbg=8 guifg=#0087ff guibg=#1c1c1c') |
||||||
|
call s:vimple_highlight('vimple_BL_Line' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') |
||||||
|
call s:vimple_highlight('vimple_BL_Name' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#1c1c1c') |
||||||
|
call s:vimple_highlight('vimple_BL_Unlisted' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') |
||||||
|
call s:vimple_highlight('vimple_BL_CurrentBuffer' , 'ctermfg=14 ctermbg=0 guifg=#8a8a8a guibg=#262626') |
||||||
|
call s:vimple_highlight('vimple_BL_AlternateBuffer' , 'ctermfg=14 ctermbg=0 guifg=#8a8a8a guibg=#262626') |
||||||
|
" buffer active |
||||||
|
call s:vimple_highlight('vimple_BL_Active' , 'ctermfg=12 ctermbg=0 guifg=#808080 guibg=#262626') |
||||||
|
call s:vimple_highlight('vimple_BL_Hidden' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') |
||||||
|
" flags |
||||||
|
call s:vimple_highlight('vimple_BL_Current' , 'ctermfg=5 guifg=#af005f') |
||||||
|
call s:vimple_highlight('vimple_BL_Alternate' , 'ctermfg=13 guifg=#5f5faf') |
||||||
|
call s:vimple_highlight('vimple_BL_Modifiable' , 'ctermfg=2 guifg=#5f8700') |
||||||
|
call s:vimple_highlight('vimple_BL_Readonly' , 'ctermfg=6 guifg=#00afaf') |
||||||
|
call s:vimple_highlight('vimple_BL_Modified' , 'ctermfg=9 guifg=#d75f00') |
||||||
|
call s:vimple_highlight('vimple_BL_ReadError' , 'ctermfg=1 guifg=#af0000') |
||||||
|
|
||||||
|
" Scriptnames |
||||||
|
call s:vimple_highlight('vimple_SN_Number' , 'ctermfg=4 ctermbg=8 guifg=#0087ff guibg=#1c1c1c') |
||||||
|
call s:vimple_highlight('vimple_SN_Term' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#1c1c1c') |
||||||
|
|
||||||
|
" Options |
||||||
|
call s:vimple_highlight('vimple_OP_BoolEnabled' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#262626') |
||||||
|
call s:vimple_highlight('vimple_OP_BoolDisabled' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#tracer() |
||||||
|
let d = {} |
||||||
|
func d.t() |
||||||
|
return expand('<sfile>') |
||||||
|
endfunc |
||||||
|
echom d.t() |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Buffer Line Filter {{{1 |
||||||
|
function! vimple#filter(lines, options) |
||||||
|
let obj = {} |
||||||
|
let obj.lines = a:lines |
||||||
|
let obj.options = a:options |
||||||
|
|
||||||
|
func obj.initialize() dict |
||||||
|
if has_key(self.options, 'new') |
||||||
|
enew |
||||||
|
endif |
||||||
|
if has_key(self.options, 'msg') |
||||||
|
let self.msg = self.options.msg |
||||||
|
else |
||||||
|
let self.msg = 'Filter: ' |
||||||
|
endif |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.filter() dict |
||||||
|
let old_hls = &hlsearch |
||||||
|
set hlsearch |
||||||
|
call self.incremental() |
||||||
|
let &hlsearch = old_hls |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.incremental() dict |
||||||
|
let c = '' |
||||||
|
let self.partial = '' |
||||||
|
let &ul = &ul |
||||||
|
call self.update(0) |
||||||
|
while 1 |
||||||
|
call self.update(1) |
||||||
|
let c = nr2char(getchar()) |
||||||
|
if c == "\<cr>" |
||||||
|
break |
||||||
|
elseif c == "\<c-w>" |
||||||
|
if self.partial =~ '\k\+\s*$' |
||||||
|
let self.partial = substitute(self.partial, '\k\+\s*$', '', '') |
||||||
|
else |
||||||
|
let self.partial = substitute(self.partial, '.*\k\+\zs.*$', '', '') |
||||||
|
endif |
||||||
|
elseif c == "\<esc>" |
||||||
|
silent undo |
||||||
|
break |
||||||
|
elseif c == '' |
||||||
|
let self.partial = self.partial[:-2] |
||||||
|
else |
||||||
|
let self.partial .= c |
||||||
|
endif |
||||||
|
endwhile |
||||||
|
endfunc |
||||||
|
|
||||||
|
func obj.update(undojoin) dict |
||||||
|
if a:undojoin |
||||||
|
undojoin |
||||||
|
endif |
||||||
|
%delete |
||||||
|
let partial = substitute(substitute(self.partial, ' ', '.*', 'g'), '\.\*$', '', '') |
||||||
|
if partial =~ '\.\*\$$' |
||||||
|
let partial = substitute(partial, '\.\*\$$', '$', '') |
||||||
|
endif |
||||||
|
call append(0, filter(copy(self.lines), 'v:val =~ partial')) |
||||||
|
$delete |
||||||
|
if self.partial == '' |
||||||
|
nohlsearch |
||||||
|
else |
||||||
|
exe "silent! norm! /" . partial . "\<cr>" |
||||||
|
endif |
||||||
|
1 |
||||||
|
redraw |
||||||
|
echo self.msg . self.partial |
||||||
|
endfunc |
||||||
|
|
||||||
|
return obj.initialize() |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,105 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :abbreviations builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :abbreviations command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/abbreviations.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#abbreviations.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#abbreviations |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
" abbreviations object |
||||||
|
|
||||||
|
function! vimple#abbreviations#new() |
||||||
|
let ab = {} |
||||||
|
let ab.__data = {} |
||||||
|
let ab.__filter = '' |
||||||
|
|
||||||
|
func ab.update() dict abort |
||||||
|
let self.__data = vimple#associate(vimple#join(vimple#redir('iabbrev'), '^\s\+'), |
||||||
|
\ [['^\S\+\s*\(\S\+\)\s*\(.*\)$', '\1\t\2', '']], |
||||||
|
\ ['split(v:val, "\t", 2)', |
||||||
|
\ '{"abbr": v:val[0],' |
||||||
|
\. '"type": "i",' |
||||||
|
\. '"expansion": substitute(v:val[1], "\\s\\+", " ", "g")}']) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" takes two optional arguments: |
||||||
|
" 1 : format |
||||||
|
" 2 : data |
||||||
|
func ab.to_s(...) dict |
||||||
|
let default = "%t %a %e\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let data = a:0 > 1 ? a:2.__data : self.__data |
||||||
|
let str = '' |
||||||
|
let data = sort(data, 'vimple#comparators#abbrly') |
||||||
|
for i in range(0, len(data) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'a': ['s', data[i]['abbr']], |
||||||
|
\ 't': ['s', data[i]['type']], |
||||||
|
\ 'e': ['s', data[i]['expansion']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
func ab.to_l(...) dict |
||||||
|
return self.__data |
||||||
|
endfunc |
||||||
|
|
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
func ab.print() dict |
||||||
|
let str = self.to_s() |
||||||
|
let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') |
||||||
|
call vimple#echoc(dta) |
||||||
|
endfunc |
||||||
|
|
||||||
|
func ab.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__data, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func ab.filter_by_abbr(abbr) dict abort |
||||||
|
return self.filter('v:val["abbr"] =~ "' . escape(a:abbr, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func ab.sort() |
||||||
|
return sort(self.__data, vimple#comparators#abbrly) |
||||||
|
endfunc |
||||||
|
|
||||||
|
call ab.update() |
||||||
|
return ab |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,66 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple Sort Comparators |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple sort comparators |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/comparators.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#comparators.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#comparators |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
function! vimple#comparators#numerically(i1, i2) |
||||||
|
let i1 = str2nr(a:i1) |
||||||
|
let i2 = str2nr(a:i2) |
||||||
|
return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#comparators#abbrly(i1, i2) |
||||||
|
let i1 = a:i1['abbr'] |
||||||
|
let i2 = a:i2['abbr'] |
||||||
|
return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#comparators#termly(i1, i2) |
||||||
|
let i1 = a:i1['term'] |
||||||
|
let i2 = a:i2['term'] |
||||||
|
return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#comparators#rhsly(i1, i2) |
||||||
|
let i1 = matchstr(a:i1['rhs'], '\c^.*\zs<plug>.*') |
||||||
|
let i2 = matchstr(a:i2['rhs'], '\c^.*\zs<plug>.*') |
||||||
|
return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#comparators#lhsly(i1, i2) |
||||||
|
let i1 = a:i1['lhs'] |
||||||
|
let i2 = a:i2['lhs'] |
||||||
|
return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,103 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :highlight builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :highlight command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/highlight.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#highlight.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#highlight |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
" Highlight object |
||||||
|
|
||||||
|
function! vimple#highlight#new() |
||||||
|
let hl = {} |
||||||
|
let hl.__data = {} |
||||||
|
let hl.__filter = '' |
||||||
|
|
||||||
|
func hl.update() dict abort |
||||||
|
let self.__data = vimple#associate(vimple#join(vimple#redir('highlight'), '^\s\+'), |
||||||
|
\ [['^\(\S\+\)\s*\S\+\s*\(.*\)$', '\1\t\2', '']], |
||||||
|
\ ['split(v:val, "\t", 2)', |
||||||
|
\ '{"term": v:val[0],' |
||||||
|
\. '"attrs": substitute(v:val[1], "\\s\\+", " ", "g")}']) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" takes two optional arguments: |
||||||
|
" 1 : format |
||||||
|
" 2 : data |
||||||
|
func hl.to_s(...) dict |
||||||
|
let default = "%t %a\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let data = a:0 > 1 ? a:2.__data : self.__data |
||||||
|
let str = '' |
||||||
|
let data = sort(data, 'vimple#comparators#termly') |
||||||
|
for i in range(0, len(data) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 't': ['s', data[i]['term']], |
||||||
|
\ 'a': ['s', data[i]['attrs']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hl.to_l(...) dict |
||||||
|
return self.__data |
||||||
|
endfunc |
||||||
|
|
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
func hl.print() dict |
||||||
|
let str = self.to_s() |
||||||
|
let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') |
||||||
|
call vimple#echoc(dta) |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hl.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__data, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hl.filter_by_term(term) dict abort |
||||||
|
return self.filter('v:val["term"] =~ "' . escape(a:term, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hl.sort() |
||||||
|
return sort(self.__data, vimple#comparators#termly) |
||||||
|
endfunc |
||||||
|
|
||||||
|
call hl.update() |
||||||
|
return hl |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,90 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :history builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :history command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/history.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#history.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#history |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
|
||||||
|
function! vimple#history#new() |
||||||
|
let hist = {} |
||||||
|
let hist.__commands = {} |
||||||
|
let hist.__filter = '' |
||||||
|
|
||||||
|
func hist.update() dict abort |
||||||
|
let self.__commands = vimple#associate(vimple#redir('history'), |
||||||
|
\ [['^\s*#.*', '', ''], |
||||||
|
\ ['[^0-9]*\(\%(\d\+\)\|#\)\s*\(.*\)$', '\1-=-=\2', '']], |
||||||
|
\ ['split(v:val, "-=-=")', '{"number": v:val[0], "command": v:val[1]}']) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hist.to_s(...) dict |
||||||
|
let default = "%3n %s\n" |
||||||
|
"let format = default |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let commands = a:0 > 1 ? a:2.__commands : self.__commands |
||||||
|
let str = '' |
||||||
|
for i in range(0, len(commands) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'n': ['d', commands[i]['number']], |
||||||
|
\ 's': ['s', commands[i]['command']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
" Note: This is a LOT of dancing just to get coloured numbers ;) |
||||||
|
func hist.print() dict |
||||||
|
call self.update() |
||||||
|
call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hist.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__commands, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func hist.filter_by_name(name) dict abort |
||||||
|
return self.filter('v:val["command"] =~ "' . escape(a:name, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call hist.update() |
||||||
|
return hist |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,386 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :ls builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :ls command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/ls.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#ls.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#ls |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
" TODO: Use one s:dict instead of recreating the whole thing. Easier to debug. |
||||||
|
" TODO: Improve alignment of line numbers of print(). |
||||||
|
|
||||||
|
function! vimple#ls#new() |
||||||
|
let bl = {} |
||||||
|
let bl.__buffers = {} |
||||||
|
let bl.current = 0 |
||||||
|
let bl.alternate = 0 |
||||||
|
let bl.__filter = '' |
||||||
|
|
||||||
|
" public interface {{{1 |
||||||
|
|
||||||
|
func bl._filename(bufnum, fallback) |
||||||
|
let bname = bufname(a:bufnum) |
||||||
|
if bname =~ '^\s*$' |
||||||
|
let bname = a:fallback |
||||||
|
endif |
||||||
|
echo '####' . bname . '#### |
||||||
|
return bname |
||||||
|
endfunc |
||||||
|
|
||||||
|
" update {{{2 |
||||||
|
func bl.update() dict abort |
||||||
|
let bufferlist = vimple#associate(vimple#redir('ls!'), |
||||||
|
\ [[ '^\s*\(\d\+\)\(\s*[-u%#ah=+x ]*\)\s\+\"\(.*\)\"\s\+\(\S\+\%(\s\+\S\+\)*\)\s\+\(\d\+\)\%(\s\+.*\)\?$', |
||||||
|
\ '\1,\2,\4,\5,\3', |
||||||
|
\ '' ]], |
||||||
|
\ [ 'split(v:val, ",")', |
||||||
|
\ 'add(v:val[0:3], join(v:val[4:-1], ","))', |
||||||
|
\ '{"number": v:val[0],' |
||||||
|
\.'"line_text": v:val[2],' |
||||||
|
\.'"line": v:val[3],' |
||||||
|
\.'"name": (v:val[4] =~ ''\[.\{-}\]'' ? (bufname(v:val[0] + 0) ? bufname(v:val[0] + 0) : v:val[4]) : v:val[4]),' |
||||||
|
\.'"listed": v:val[1] !~ "u",' |
||||||
|
\.'"current": v:val[1] =~ "%",' |
||||||
|
\.'"alternate": v:val[1] =~ "#",' |
||||||
|
\.'"active": v:val[1] =~ "a",' |
||||||
|
\.'"hidden": v:val[1] =~ "h",' |
||||||
|
\.'"modifiable": v:val[1] !~ "-",' |
||||||
|
\.'"readonly": v:val[1] =~ "=",' |
||||||
|
\.'"modified": v:val[1] =~ "+",' |
||||||
|
\.'"read_error": v:val[1] =~ "x"}' ]) |
||||||
|
|
||||||
|
let self.__buffers = {} |
||||||
|
for bfr in map(copy(bufferlist), '{v:val["number"]: v:val}') |
||||||
|
call extend(self.__buffers, bfr) |
||||||
|
endfor |
||||||
|
if self.__filter != '' |
||||||
|
call filter(self.__buffers, self.__filter) |
||||||
|
endif |
||||||
|
|
||||||
|
let current_l = filter(copy(bufferlist), 'v:val["current"] == 1') |
||||||
|
let alternate_l = filter(copy(bufferlist), 'v:val["alternate"] == 1') |
||||||
|
let self.current = len(current_l) > 0 ?current_l[0].number : 0 |
||||||
|
let self.alternate = len(alternate_l) > 0 ? alternate_l[0].number : 0 |
||||||
|
return self |
||||||
|
endfun |
||||||
|
|
||||||
|
" to_s([format]) {{{2 |
||||||
|
" format: When absent or empty the default value ("%3b%f\"%n\" line %l\n") |
||||||
|
" will be used. |
||||||
|
" Use %b, %n, %f and %l to insert the buffer number, name, flags and cursor |
||||||
|
" line respectively . The last character will be replaced by d or s as |
||||||
|
" required by printf(), so you can include extra flags (e.g.: %3b). |
||||||
|
func bl.to_s(...) dict |
||||||
|
" An empty format argument uses the default. |
||||||
|
let default = "%3b%f\"%n\" %t %l\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
" Apply filter. |
||||||
|
let buffers = self.data() |
||||||
|
|
||||||
|
let str = '' |
||||||
|
for key in sort(keys(buffers), 'vimple#comparators#numerically') |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'b': ['d', buffers[key]['number']], |
||||||
|
\ 'f': ['s', self.buffer_flags(buffers[key])], |
||||||
|
\ 't': ['s', buffers[key]['line_text']], |
||||||
|
\ 'n': ['s', buffers[key]['name']], |
||||||
|
\ 'l': ['s', buffers[key]['line']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_l {{{2 |
||||||
|
func bl.to_l(...) dict |
||||||
|
return values(call(self.buffers, a:000, self).__buffers) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_d {{{2 |
||||||
|
func bl.to_d(...) dict |
||||||
|
return call(self.buffers, a:000, self).__buffers |
||||||
|
endfunc |
||||||
|
|
||||||
|
" print {{{2 |
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
func bl.print(...) dict |
||||||
|
let bang = a:0 ? a:1 : 0 |
||||||
|
call self.update() |
||||||
|
"let str = self.to_s() |
||||||
|
" following code is from hl.print() and would not work as is here |
||||||
|
"let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') |
||||||
|
"call vimple#echoc(dta) |
||||||
|
let pairs = [] |
||||||
|
let data = self.data() |
||||||
|
let max_length = max(map(deepcopy(values(self.data())), 'len(v:val.name)')) |
||||||
|
for buffer in sort(values(data), self.compare, self) |
||||||
|
if !bang && !buffer.listed |
||||||
|
continue |
||||||
|
endif |
||||||
|
call add(pairs, ['vimple_BL_Nnumber', printf('%3d',buffer.number)]) |
||||||
|
if buffer.listed |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
else |
||||||
|
call add(pairs, ['vimple_BL_Unlisted', 'u']) |
||||||
|
endif |
||||||
|
if buffer.current |
||||||
|
call add(pairs, ['vimple_BL_Current', '%']) |
||||||
|
elseif buffer.alternate |
||||||
|
call add(pairs, ['vimple_BL_Alternate', '#']) |
||||||
|
else |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
endif |
||||||
|
if buffer.active |
||||||
|
call add(pairs, ['vimple_BL_Active', 'a']) |
||||||
|
elseif buffer.hidden |
||||||
|
call add(pairs, ['vimple_BL_Hidden', 'h']) |
||||||
|
else |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
endif |
||||||
|
if !buffer.modifiable |
||||||
|
call add(pairs, ['vimple_BL_Modifiable', '-']) |
||||||
|
elseif buffer.readonly |
||||||
|
call add(pairs, ['vimple_BL_Readonly', '=']) |
||||||
|
else |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
endif |
||||||
|
if buffer.read_error |
||||||
|
call add(pairs, ['vimple_BL_RearError', 'x']) |
||||||
|
elseif buffer.modified |
||||||
|
call add(pairs, ['vimple_BL_Modified', '+']) |
||||||
|
else |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
endif |
||||||
|
call add(pairs, ['Normal', ' ']) |
||||||
|
call add(pairs, [ |
||||||
|
\ buffer.current ? |
||||||
|
\ 'vimple_BL_CurrentBuffer' : |
||||||
|
\ buffer.alternate ? |
||||||
|
\ 'vimple_BL_AlternateBuffer' : |
||||||
|
\ 'Normal', |
||||||
|
\ '"' . buffer.name . '"']) |
||||||
|
let spaces = len(buffer.name) >= 29 ? 1 : 29 - len(buffer.name) |
||||||
|
call add(pairs, ['Normal', |
||||||
|
\ repeat(' ', spaces)]) |
||||||
|
call add(pairs, ['vimple_BL_Line', |
||||||
|
\ buffer.line_text . ' ']) |
||||||
|
call add(pairs, ['vimple_BL_Line', |
||||||
|
\ buffer.line . "\<NL>" |
||||||
|
\ ]) |
||||||
|
endfor |
||||||
|
call vimple#echoc(pairs) |
||||||
|
" Remove the last <NL>. Why? |
||||||
|
let pairs[-1][1] = pairs[-1][-1][:-2] |
||||||
|
return pairs |
||||||
|
endfunc |
||||||
|
|
||||||
|
" compare {{{3 |
||||||
|
func bl.compare(k1, k2) dict |
||||||
|
let k1 = a:k1.number * 1 |
||||||
|
let k2 = a:k2.number * 1 |
||||||
|
return k1 == k2 ? 0 : k1 > k2 ? 1 : -1 |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter {{{2 |
||||||
|
func bl.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__buffers, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
" get_filter {{{3 |
||||||
|
func bl.get_filter() dict |
||||||
|
return string(self.__filter) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter_add_or {{{3 |
||||||
|
func bl.filter_add_or(filter) dict |
||||||
|
let self.__filter .= ' || ' . a:filter |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter_add_and {{{3 |
||||||
|
func bl.filter_add_and(filter) dict |
||||||
|
let self.__filter .= ' && ' . a:filter |
||||||
|
endfunc |
||||||
|
|
||||||
|
" merge {{{3 |
||||||
|
func bl.merge(bl) dict |
||||||
|
let bl = deepcopy(self) |
||||||
|
call extend(bl.__buffers, a:bl.__buffers, 'keep') |
||||||
|
call bl.filter_add_or(a:bl.__filter) |
||||||
|
return bl |
||||||
|
endfunc |
||||||
|
|
||||||
|
" and {{{3 |
||||||
|
func bl.and(filter) dict |
||||||
|
return call(self.buffers, [a:filter], self) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" hidden {{{3 |
||||||
|
func bl.hidden(...) dict |
||||||
|
let filters = { |
||||||
|
\ 1: 'v:val.hidden', |
||||||
|
\ 2: '!v:val.active && v:val.listed', |
||||||
|
\ 3: '!v:val.listed', |
||||||
|
\ 4: '!v:val.active && v:val.listed && !v:val.hidden', |
||||||
|
\ 5: '!v:val.active || !v:val.listed' |
||||||
|
\ } |
||||||
|
let choice = a:0 ? a:1 : 1 |
||||||
|
return self.filter_with_choice(choice, filters) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" active {{{3 |
||||||
|
func bl.active() dict |
||||||
|
return self.filter('v:val.active') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" modifiable {{{3 |
||||||
|
func bl.modifiable(...) dict |
||||||
|
let filters = { |
||||||
|
\ 1: '!v:val.modifiable', |
||||||
|
\ 2: '!v:val.modifiable || v:val.readonly' |
||||||
|
\ } |
||||||
|
let choice = a:0 ? a:1 : 1 |
||||||
|
return self.filter_with_choice(choice, filters) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" readonly {{{3 |
||||||
|
func bl.readonly(...) dict |
||||||
|
let filters = { |
||||||
|
\ 1: '!v:val.readonly', |
||||||
|
\ 2: '!v:val.modifiable || v:val.readonly' |
||||||
|
\ } |
||||||
|
let choice = a:0 ? a:1 : 1 |
||||||
|
return self.filter_with_choice(choice, filters) |
||||||
|
endfunc |
||||||
|
|
||||||
|
" modified {{{3 |
||||||
|
func bl.modified() dict |
||||||
|
return self.filter('v:val.modified') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" read_error {{{3 |
||||||
|
func bl.read_error() dict |
||||||
|
return self.filter('v:val.read_error') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" unloaded {{{3 |
||||||
|
func bl.unloaded() dict |
||||||
|
return self.filter('!v:val.active && !v:val.hidden && v:val.listed') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" buffers - alias for data {{{2 |
||||||
|
func bl.buffers(...) dict |
||||||
|
if !a:0 |
||||||
|
" Return listed buffers. |
||||||
|
return self.filter('v:val.listed') |
||||||
|
endif |
||||||
|
if a:1 =~ '^\%(non\?\|un\)' |
||||||
|
let arg = matchstr(a:1, '^\%(un\|non\)\zs.*') |
||||||
|
let bang = '!' |
||||||
|
else |
||||||
|
let arg = a:1 |
||||||
|
let bang = '' |
||||||
|
endif |
||||||
|
if arg == 'hidden' |
||||||
|
let filter = 'v:val.hidden' |
||||||
|
elseif arg == 'active' |
||||||
|
let filter = 'v:val.active' |
||||||
|
elseif arg == 'modifiable' |
||||||
|
let filter = 'v:val.modifiable' |
||||||
|
elseif arg == 'readonly' |
||||||
|
let filter = 'v:val.readonly' |
||||||
|
elseif arg == 'modified' |
||||||
|
let filter = 'v:val.modified' |
||||||
|
elseif arg == 'read_error' |
||||||
|
let filter = 'v:val.read_error' |
||||||
|
elseif arg == 'unloaded' |
||||||
|
let filter = '!v:val.active && !v:val.hidden && v:val.listed' |
||||||
|
elseif arg == 'listed' |
||||||
|
let filter = 'v:val.listed' |
||||||
|
elseif arg == 'all' |
||||||
|
let filter = '1' |
||||||
|
else |
||||||
|
let filter = arg |
||||||
|
endif |
||||||
|
let bl = self.filter(bang . '(' . filter . ')') |
||||||
|
return bl |
||||||
|
endfunc |
||||||
|
|
||||||
|
" data - alias for buffers {{{3 |
||||||
|
func bl.data() dict |
||||||
|
return self.__buffers |
||||||
|
endfunc |
||||||
|
|
||||||
|
" Private functions - don't need 'dict' modifier {{{2 |
||||||
|
|
||||||
|
" filter_with_choice {{{3 |
||||||
|
func bl.filter_with_choice(choice, filters, ...) |
||||||
|
if a:0 |
||||||
|
return filter(deepcopy(a:1), a:filters[a:choice]) |
||||||
|
else |
||||||
|
return self.filter(a:filters[a:choice]) |
||||||
|
endif |
||||||
|
endfunc |
||||||
|
|
||||||
|
" buffer_status {{{3 |
||||||
|
func bl.buffer_status(b) |
||||||
|
return a:b['active'] == 1 ? 'a' : a:b['hidden'] == 1 ? 'h' : '!' |
||||||
|
endfunc |
||||||
|
|
||||||
|
" buffer_type {{{3 |
||||||
|
func bl.buffer_type(b) |
||||||
|
return a:b['current'] == 1 ? '%' : a:b['alternate'] == 1 ? '#' : ' ' |
||||||
|
endfunc |
||||||
|
|
||||||
|
" buffer_flags {{{3 |
||||||
|
func bl.buffer_flags(b) |
||||||
|
return (a:b['listed'] == 0 ? 'u' : ' ') |
||||||
|
\. (a:b['current'] == 1 ? '%' : |
||||||
|
\ (a:b['alternate'] == 1 ? '#' : ' ')) |
||||||
|
\. (a:b['active'] == 1 ? 'a' : |
||||||
|
\ (a:b['hidden'] == 1 ? 'h' : ' ')) |
||||||
|
\. (a:b['modifiable'] == 0 ? '-' : |
||||||
|
\ (a:b['readonly'] == 1 ? '=' : ' ')) |
||||||
|
\. (a:b['modified'] == 1 ? '+' : ' ') |
||||||
|
\. (a:b['read_error'] == 1 ? 'x' : ' ') |
||||||
|
endfunc |
||||||
|
" }}}2 |
||||||
|
|
||||||
|
" constructor |
||||||
|
|
||||||
|
call bl.update() |
||||||
|
return bl |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,176 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :map builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :map command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/scriptnames.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#map.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#map |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
|
||||||
|
function! vimple#map#new() |
||||||
|
let m = {} |
||||||
|
let m.__data = {} |
||||||
|
let m.__filter = '' |
||||||
|
|
||||||
|
func m.update() dict abort |
||||||
|
let self.__data = vimple#associate(vimple#redir('map') + vimple#redir('map!'), |
||||||
|
\ [['', |
||||||
|
\ '', '']], |
||||||
|
\ ['[matchstr(v:val, ''^.''), |
||||||
|
\ matchstr(v:val, ''^.\s\+\zs\S\+''), |
||||||
|
\ matchstr(v:val, ''^.\s\+\S\+\s\+\zs[*& ]\ze[@ ]\S''), |
||||||
|
\ matchstr(v:val, ''^.\s\+\S\+\s\+[*& ]\zs[@ ]\ze\S''), |
||||||
|
\ matchstr(v:val, ''^.\s\+\S\+\s\+[*& ][@ ]\zs\S.*'') |
||||||
|
\ ]', |
||||||
|
\ '{"normal" : v:val[0] =~ "[n ]", |
||||||
|
\ "visual" : v:val[0] =~ "[vx ]", |
||||||
|
\ "select" : v:val[0] =~ "[vs ]", |
||||||
|
\ "operator" : v:val[0] =~ "[o ]", |
||||||
|
\ "insert" : v:val[0] =~ "[i!]", |
||||||
|
\ "lang" : v:val[0] =~ "l", |
||||||
|
\ "command" : v:val[0] =~ "[c!]", |
||||||
|
\ "lhs" : v:val[1], |
||||||
|
\ "remappable" : v:val[2] != "*", |
||||||
|
\ "script_remappable" : v:val[2] == "&", |
||||||
|
\ "buffer" : v:val[3] == "@", |
||||||
|
\ "rhs" : v:val[4] |
||||||
|
\ }']) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.map_type(map) |
||||||
|
let tt = ['normal', 'insert', 'select', 'visual', 'operator', 'command', 'lang'] |
||||||
|
let type = '' |
||||||
|
for i in range(0, (len(tt) - 1)) |
||||||
|
if a:map[tt[i]] |
||||||
|
if i == 3 |
||||||
|
if type == 's' |
||||||
|
let type = 'v' |
||||||
|
else |
||||||
|
let type = 'x' |
||||||
|
endif |
||||||
|
else |
||||||
|
let type = tt[i][0] |
||||||
|
endif |
||||||
|
endif |
||||||
|
endfor |
||||||
|
return type |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.map_extra(map) |
||||||
|
let et = ['remappable', 'script_remappable', 'buffer'] |
||||||
|
let rt = [' ', '&', '@'] |
||||||
|
let extra = '*' |
||||||
|
for i in range(0, (len(et) - 1)) |
||||||
|
if a:map[et[i]] |
||||||
|
let extra = rt[i] |
||||||
|
endif |
||||||
|
endfor |
||||||
|
return extra |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.to_s(...) dict |
||||||
|
let default = "%3n %s\n" |
||||||
|
let default = "%t %L %e %R\n" |
||||||
|
"let format = default |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let maps = a:0 > 1 ? a:2.__data : self.__data |
||||||
|
let str = '' |
||||||
|
" for i in range(0, len(maps) - 1) |
||||||
|
let lhs_plugs = self.filter('v:val["lhs"] =~ "\\c<plug>"').to_l() |
||||||
|
let rhs_plugs = self.filter('v:val["rhs"] =~ "\\c<plug>"').to_l() |
||||||
|
let non_plugs = self.filter('v:val["lhs"] !~ "\\c<plug>" && v:val["rhs"] !~ "\\c<plug>"').to_l() |
||||||
|
let all_maps = sort(lhs_plugs, 'vimple#comparators#lhsly') |
||||||
|
\+ sort(rhs_plugs, 'vimple#comparators#rhsly') |
||||||
|
\+ sort(non_plugs, 'vimple#comparators#lhsly') |
||||||
|
for map in all_maps |
||||||
|
let type = self.map_type(map) |
||||||
|
let extra = self.map_extra(map) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 't': ['s', type], |
||||||
|
\ 'L': ['s', map['lhs']], |
||||||
|
\ 'e': ['s', extra], |
||||||
|
\ 'R': ['s', map['rhs']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_l {{{2 |
||||||
|
func m.to_l(...) dict |
||||||
|
return self.__data |
||||||
|
endfunc |
||||||
|
|
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
" Note: This is a LOT of dancing just to get coloured numbers ;) |
||||||
|
func m.print() dict |
||||||
|
call self.update() |
||||||
|
call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__data, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.lhs_is(lhs) dict abort |
||||||
|
return self.filter('v:val["lhs"] ==# "' . escape(a:lhs, '\"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call m.update() |
||||||
|
return m |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! MyMaps() |
||||||
|
let maps = split(g:vimple#mp.update().filter('v:val["lhs"] !~ "\\c<plug>"').to_s("%t %e %L %R\n"), "\n") |
||||||
|
let max_l = 0 |
||||||
|
for s in maps |
||||||
|
let l = stridx(s, ' ', 5) |
||||||
|
let max_l = l > max_l ? l : max_l |
||||||
|
endfor |
||||||
|
let max_l += 1 |
||||||
|
let ms = [] |
||||||
|
let pat = '^.\s.\s\S\+\zs\s\+\ze' |
||||||
|
for s in maps |
||||||
|
let ns = match(s, pat) |
||||||
|
call add(ms, substitute(s, pat, repeat(' ', max_l - ns), '')) |
||||||
|
endfor |
||||||
|
return ms |
||||||
|
endfunction |
||||||
|
|
||||||
|
command! -nargs=0 -bar MyMaps call ShowInNewBuf(MyMaps()) |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
||||||
|
|
@ -0,0 +1,110 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :marks builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :marks command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/scriptnames.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#marks.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#marks |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
|
||||||
|
function! vimple#marks#new() |
||||||
|
let m = {} |
||||||
|
let m.__data = {} |
||||||
|
let m.__filter = '' |
||||||
|
|
||||||
|
func m.update() dict abort |
||||||
|
let self.__data = vimple#associate(vimple#redir('marks')[1:-1], |
||||||
|
\ [['^\s*', '', '']], |
||||||
|
\ ['split(v:val)', |
||||||
|
\ '{"mark" : v:val[0], |
||||||
|
\ "line" : v:val[1], |
||||||
|
\ "col" : v:val[2], |
||||||
|
\ "text" : substitute(join(v:val[3:-1], " "), "\n", "", ""), |
||||||
|
\ }']) |
||||||
|
|
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.to_s(...) dict |
||||||
|
let default = "%2m %5l %4o %t\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let marks = a:0 > 1 ? a:2.__data : self.__data |
||||||
|
let str = '' |
||||||
|
for i in range(0, len(marks) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'm': ['s', marks[i]['mark']], |
||||||
|
\ 'l': ['d', marks[i]['line']], |
||||||
|
\ 'o': ['d', marks[i]['col']], |
||||||
|
\ 't': ['s', marks[i]['text']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.to_l() dict |
||||||
|
return self.__data |
||||||
|
endfunc |
||||||
|
|
||||||
|
" " only able to colour print the default to_s() output at this stage |
||||||
|
" " Note: This is a LOT of dancing just to get coloured numbers ;) |
||||||
|
" func m.print() dict |
||||||
|
" call self.update() |
||||||
|
" call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') |
||||||
|
" endfunc |
||||||
|
|
||||||
|
"TODO: This looks like a candidate for moving into the parent class... no? |
||||||
|
func m.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__data, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.lhs_is(lhs) dict abort |
||||||
|
return self.filter('v:val["lhs"] ==# "' . escape(a:lhs, '\"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.local_marks() dict abort |
||||||
|
return self.filter('v:val["mark"] =~# "[a-z]"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.global_marks() dict abort |
||||||
|
return self.filter('v:val["mark"] =~# "[A-Z]"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call m.update() |
||||||
|
return m |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
||||||
|
|
@ -0,0 +1,209 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for options |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's options |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/options.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#options.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#options |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
function! vimple#options#new() |
||||||
|
if exists('g:vimple#op') |
||||||
|
return deepcopy(g:vimple#op).update() |
||||||
|
endif |
||||||
|
let op = {} |
||||||
|
let op.__options = {} |
||||||
|
let op.__filter = '' |
||||||
|
let op.__update_with_map = 0 |
||||||
|
|
||||||
|
" update {{{2 |
||||||
|
func op.update() dict abort |
||||||
|
if self.__update_with_map |
||||||
|
call map(self.__options, 'extend(v:val, {"value": eval("&".v:key)}, "force")') |
||||||
|
" Preserve filter. |
||||||
|
if !empty(self.__filter) |
||||||
|
call filter(self.__options, self.__filter) |
||||||
|
endif |
||||||
|
return self |
||||||
|
endif |
||||||
|
|
||||||
|
silent! options |
||||||
|
let content = getline(1, '$') |
||||||
|
close |
||||||
|
bwipe option-window |
||||||
|
|
||||||
|
let long = '' |
||||||
|
for l in content |
||||||
|
if l =~ '^\s*\%(".*\)\?$' |
||||||
|
continue |
||||||
|
elseif l =~ '^\s*\d' |
||||||
|
continue |
||||||
|
elseif l =~ '^\w' |
||||||
|
let [long, desc] = split(l, '\t') |
||||||
|
let self.__options[long] = {} |
||||||
|
let self.__options[long] = {'long' : long, 'desc' : desc} |
||||||
|
elseif l =~ '^\t' |
||||||
|
let self.__options[long].desc .= ' ' . matchstr(l, '^\t\zs.*') |
||||||
|
else |
||||||
|
if l =~ 'set \w\+=' |
||||||
|
let l = substitute(l, '^ \tset \(\w\+\)=', ' string \1 ', '') |
||||||
|
else |
||||||
|
let l = substitute(l, '^ \tset \(\w\+\)\t\(\w\+\)', '\=" bool " . (submatch(1) !~? "^no" ? submatch(1) : submatch(2)) . " " . (submatch(1) !~? "^no")', '') |
||||||
|
endif |
||||||
|
let [type, short] = matchlist(l, '^ \(\w\+\) \(\w\+\)')[1:2] |
||||||
|
call extend(self.__options[long], {'type' : type, 'short' : short, 'value': eval('&'.long)}) |
||||||
|
endif |
||||||
|
endfor |
||||||
|
|
||||||
|
for o in items(self.__options) |
||||||
|
call extend(o[1], {'scope' : (o[1].desc =~ '(.\{-}local.\{-})' ? matchstr(o[1].desc, '(\zs.\{-}\ze)') : 'global')}) |
||||||
|
call extend(self.__options, {o[1].short : o[1]}) |
||||||
|
endfor |
||||||
|
|
||||||
|
" Preserve filter. |
||||||
|
if !empty(self.__filter) |
||||||
|
call filter(self.__options, self.__filter) |
||||||
|
endif |
||||||
|
let self.__update_with_map = 1 |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_d {{{2 |
||||||
|
func op.to_d(...) dict |
||||||
|
return self.__options |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_l {{{2 |
||||||
|
func op.to_l(...) dict |
||||||
|
return map(items(self.__options), '[v:val[0], v:val[1].value]') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_s {{{2 |
||||||
|
func op.to_s(...) dict |
||||||
|
let default = "%-15l %-2p %1t %v\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let opts = a:0 > 1 ? a:2.__options : self.__options |
||||||
|
let str = '' |
||||||
|
for o in sort(items(opts)) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'l': ['s', o[1]['long']], |
||||||
|
\ 's': ['s', o[1]['short']], |
||||||
|
\ 'd': ['s', o[1]['desc']], |
||||||
|
\ 'p': ['s', join(map(filter(split(o[1]['scope']), 'index(["or", "local", "to"], v:val) == -1'), 'strpart(v:val, 0, 1)'), '')], |
||||||
|
\ 't': ['s', strpart(o[1]['type'], 0, 1)], |
||||||
|
\ 'v': ['s', o[1]['value']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
" changed {{{2 |
||||||
|
func op.changed() dict |
||||||
|
return self.filter('v:val.value !=# eval("&".v:key)') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" short {{{2 |
||||||
|
func op.short() dict |
||||||
|
return self.filter('v:val.short ==# v:key') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" long {{{2 |
||||||
|
func op.long() dict |
||||||
|
return self.filter('v:val.long ==# v:key') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" print {{{2 |
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
func op.print() dict |
||||||
|
"let str = self.to_s() |
||||||
|
" following code is from hl.print() and would not work as is here |
||||||
|
"let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') |
||||||
|
"call vimple#echoc(dta) |
||||||
|
let pairs = [] |
||||||
|
let changed = self.changed() |
||||||
|
let max_name = max(map(values(map(copy(self.__options), 'v:val.long." ".v:val.short.""')), 'len(v:val)')) |
||||||
|
for key in sort(keys(self.long().__options)) |
||||||
|
let option = self.__options[key] |
||||||
|
call add(pairs, ['vimple_BL_Number', option.long]) |
||||||
|
call add(pairs, ['Normal', ' (']) |
||||||
|
call add(pairs, ['vimple_BL_Hidden', option.short]) |
||||||
|
call add(pairs, ['Normal', ')' . repeat(' ', max_name - len(option.short) - len(option.long))]) |
||||||
|
let len = len(option.value) |
||||||
|
if len < &columns |
||||||
|
call add(pairs, ['Normal', option.value . "\<NL>"]) |
||||||
|
else |
||||||
|
let screen_len = &columns - max_name - 6 |
||||||
|
let i = 0 |
||||||
|
while i <= len |
||||||
|
let j = i + screen_len |
||||||
|
call add(pairs, ['Normal', repeat(' ', i == 0 ? 0 : max_name + 3) . option.value[i : j] . "\<NL>"]) |
||||||
|
let i = j + 1 |
||||||
|
endwhile |
||||||
|
endif |
||||||
|
if has_key(changed.__options, key) |
||||||
|
let len = len(eval('&'.key)) |
||||||
|
if len < &columns |
||||||
|
call add(pairs, ['vimple_BL_Alternate', repeat(' ', max_name + 3) . eval('&'.key) . "\<NL>"]) |
||||||
|
else |
||||||
|
let screen_len = &columns - max_name - 6 |
||||||
|
let i = 0 |
||||||
|
while i <= len |
||||||
|
let j = i + screen_len |
||||||
|
call add(pairs, ['vimple_BL_Alternate', repeat(' ', max_name + 3) . eval('&'.key)[i : j] . "\<NL>"]) |
||||||
|
let i = j + 1 |
||||||
|
endwhile |
||||||
|
endif |
||||||
|
endif |
||||||
|
endfor |
||||||
|
call vimple#echoc(pairs) |
||||||
|
" Remove the last <NL>. Why? |
||||||
|
let pairs[-1][1] = pairs[-1][-1][:-2] |
||||||
|
return pairs |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter {{{2 |
||||||
|
func op.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__options, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter_by_name {{{2 |
||||||
|
func op.filter_by_name(name) dict abort |
||||||
|
return self.filter('v:val["long"] =~ "' . escape(a:name, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call op.update() |
||||||
|
return op |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,100 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :scriptnames builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :scriptnames command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/scriptnames.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#scriptnames.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#scriptnames |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
" TODO: Use the Numerically sort comparator for print() |
||||||
|
|
||||||
|
function! vimple#scriptnames#new() |
||||||
|
let sn = {} |
||||||
|
let sn.__scripts = {} |
||||||
|
let sn.__filter = '' |
||||||
|
|
||||||
|
" update {{{2 |
||||||
|
func sn.update() dict abort |
||||||
|
let self.__scripts = vimple#associate(vimple#redir('scriptnames'), |
||||||
|
\ [['^\s*\(\d\+\):\s*\(.*\)$', |
||||||
|
\ '\1,\2', '']], |
||||||
|
\ ['split(v:val, ",")', '{"number": v:val[0], "script": v:val[1]}']) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_l {{{2 |
||||||
|
func sn.to_l(...) dict |
||||||
|
return self.__scripts |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_s {{{2 |
||||||
|
func sn.to_s(...) dict |
||||||
|
let default = "%3n %s\n" |
||||||
|
"let format = default |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let scripts = a:0 > 1 ? a:2.__scripts : self.__scripts |
||||||
|
let str = '' |
||||||
|
for i in range(0, len(scripts) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'n': ['d', scripts[i]['number']], |
||||||
|
\ 's': ['s', scripts[i]['script']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
" print {{{2 |
||||||
|
" only able to colour print the default to_s() output at this stage |
||||||
|
" Note: This is a LOT of dancing just to get coloured numbers ;) |
||||||
|
func sn.print() dict |
||||||
|
call self.update() |
||||||
|
call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter {{{2 |
||||||
|
func sn.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__scripts, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter_by_name {{{2 |
||||||
|
func sn.filter_by_name(name) dict abort |
||||||
|
return self.filter('v:val["script"] =~ "' . escape(a:name, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call sn.update() |
||||||
|
return sn |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,176 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :undolist builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :undolist command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/scriptnames.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#undolist.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#undolist |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
function! vimple#undolist#get_undolist() |
||||||
|
let bnum = bufnr('%') |
||||||
|
let bname = bufname('%') |
||||||
|
let ulist = vimple#undolist#new() |
||||||
|
if len(ulist.to_l()) != 0 |
||||||
|
return [ulist.sort_by_age().to_l()[-1]['age'], bnum, bname] |
||||||
|
else |
||||||
|
return [99999999999, bnum, bname] |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#undolist#most_recently_used() |
||||||
|
let orig_pos = getpos('.') |
||||||
|
let orig_pos[0] = bufnr('%') |
||||||
|
|
||||||
|
let uls = [] |
||||||
|
bufdo call add(uls, vimple#undolist#get_undolist()) |
||||||
|
call sort(uls) |
||||||
|
|
||||||
|
exe 'buffer ' . orig_pos[0] |
||||||
|
let orig_pos[0] = 0 |
||||||
|
call setpos('.', orig_pos) |
||||||
|
return reverse(uls) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#undolist#print_mru() |
||||||
|
let mru = vimple#undolist#most_recently_used() |
||||||
|
let str = '' |
||||||
|
for buf in mru |
||||||
|
let str .= printf("%3d %s\n", buf[1], buf[2]) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunction |
||||||
|
|
||||||
|
nnoremap <Plug>VimpleMRU :echo vimple#undolist#print_mru() . "\n"<cr>:buffer<space> |
||||||
|
if !hasmapto('<Plug>VimpleMRU') |
||||||
|
nmap <leader>gu <Plug>VimpleMRU |
||||||
|
endif |
||||||
|
|
||||||
|
function! vimple#undolist#normalise_time(t, now) |
||||||
|
let t = a:t |
||||||
|
let now = a:now |
||||||
|
if t =~? '^\d\+ ' |
||||||
|
let now -= matchstr(t, '^\d*') |
||||||
|
let time = strftime('%Y/%m/%d %H:%M:%S', now) |
||||||
|
elseif t !~ '\/' |
||||||
|
let time = strftime('%Y/%m/%d ', now) . t |
||||||
|
elseif t !~ '\/.*\/' |
||||||
|
let time = strftime('%Y/', now) . t |
||||||
|
else |
||||||
|
let time = t |
||||||
|
endif |
||||||
|
return time |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! vimple#undolist#julian_date(t) |
||||||
|
let [year, mon, day] = matchlist(a:t, '^\(\d\{4}\)/\(\d\d\)/\(\d\d\)')[1:3] |
||||||
|
let y = year + 4800 - (mon <= 2) |
||||||
|
let m = mon + (mon <= 2 ? 9 : -3) |
||||||
|
let jul = day + (153 * m + 2) / 5 + (1461 * y / 4) - 32083 |
||||||
|
return jul - (y / 100) + (y / 400) + 38 |
||||||
|
endfunction |
||||||
|
|
||||||
|
" in UTC |
||||||
|
function! vimple#undolist#time_to_seconds(t, now) |
||||||
|
let t = vimple#undolist#normalise_time(a:t, a:now) |
||||||
|
let jd = vimple#undolist#julian_date(t) |
||||||
|
let jd_linux = vimple#undolist#julian_date('1970/01/01 00:00:00') |
||||||
|
let [hour, min, sec] = matchlist(t, ' \(\d\d\):\(\d\d\):\(\d\d\)')[1:3] |
||||||
|
return (jd - jd_linux) * 86400 + hour * 3600 + min * 60 + sec |
||||||
|
endfunction |
||||||
|
. |
||||||
|
function! vimple#undolist#new() |
||||||
|
let m = {} |
||||||
|
let m.__data = {} |
||||||
|
let m.__filter = '' |
||||||
|
|
||||||
|
func m.update() dict abort |
||||||
|
let now = localtime() |
||||||
|
let self.__data = vimple#associate(vimple#redir('undolist')[1:-1], |
||||||
|
\ [ |
||||||
|
\ ['^\s*', '', ''], |
||||||
|
\ ['\s\s\+', '__', 'g'] |
||||||
|
\ ], |
||||||
|
\ ['split(v:val, "__")', |
||||||
|
\ '{"number" : v:val[0], |
||||||
|
\ "changes" : v:val[1], |
||||||
|
\ "when" : vimple#undolist#normalise_time(v:val[2], ' .now. '), |
||||||
|
\ "age" : vimple#undolist#time_to_seconds(v:val[2], ' .now. '), |
||||||
|
\ "saved" : len(v:val) == 4 ? v:val[3] : 0 |
||||||
|
\ }']) |
||||||
|
|
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.to_s(...) dict |
||||||
|
let default = "%4n %4h %4s %w\n" |
||||||
|
let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
let data = a:0 > 1 ? a:2.__data : self.__data |
||||||
|
let str = '' |
||||||
|
for i in range(0, len(data) - 1) |
||||||
|
let str .= vimple#format( |
||||||
|
\ format, |
||||||
|
\ { 'n': ['d', data[i]['number']], |
||||||
|
\ 'h': ['d', data[i]['changes']], |
||||||
|
\ 'w': ['s', data[i]['when']], |
||||||
|
\ 'a': ['d', data[i]['age']], |
||||||
|
\ 's': ['d', data[i]['saved']]}, |
||||||
|
\ default |
||||||
|
\ ) |
||||||
|
endfor |
||||||
|
return str |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.agely(a, b) dict |
||||||
|
return a:a['age'] - a:b['age'] |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.sort_by_age() dict |
||||||
|
let Fn_age = self.agely |
||||||
|
call sort(self.__data, Fn_age, self) |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
func m.to_l() dict |
||||||
|
return self.__data |
||||||
|
endfunc |
||||||
|
|
||||||
|
"TODO: This looks like a candidate for moving into the parent class... no? |
||||||
|
func m.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__data, a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
call m.update() |
||||||
|
return m |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
@ -0,0 +1,115 @@ |
|||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
" Vimple wrapper for :version builtin |
||||||
|
" Maintainers: Barry Arthur <barry.arthur@gmail.com> |
||||||
|
" Israel Chauca F. <israelchauca@gmail.com> |
||||||
|
" Description: Vimple object for Vim's builtin :version command. |
||||||
|
" Last Change: 2012-04-08 |
||||||
|
" License: Vim License (see :help license) |
||||||
|
" Location: autoload/vimple/version.vim |
||||||
|
" Website: https://github.com/dahu/vimple |
||||||
|
" |
||||||
|
" See vimple#version.txt for help. This can be accessed by doing: |
||||||
|
" |
||||||
|
" :helptags ~/.vim/doc |
||||||
|
" :help vimple#version |
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
||||||
|
|
||||||
|
" Vimscript Setup: {{{1 |
||||||
|
" Allow use of line continuation. |
||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" load guard |
||||||
|
" uncomment after plugin development |
||||||
|
"if exists("g:loaded_lib_vimple") |
||||||
|
" \ || v:version < 700 |
||||||
|
" \ || v:version == 703 && !has('patch338') |
||||||
|
" \ || &compatible |
||||||
|
" let &cpo = s:save_cpo |
||||||
|
" finish |
||||||
|
"endif |
||||||
|
"let g:loaded_lib_vimple = 1 |
||||||
|
|
||||||
|
function! vimple#version#new() |
||||||
|
let vn = {} |
||||||
|
let vn.__info = {} |
||||||
|
let vn.__filter = '' |
||||||
|
|
||||||
|
" update {{{2 |
||||||
|
func vn.update() dict abort |
||||||
|
let i = self.__info |
||||||
|
let info = vimple#associate(vimple#redir('version'), [], []) |
||||||
|
|
||||||
|
let [i['version'], i['major'], i['minor'], i['build_name'], i['compiled']] = |
||||||
|
\ split( |
||||||
|
\ substitute(info[0] |
||||||
|
\ , '^N\?VIM.\{-}\(\(\d\+\)\.\(\d\+\)\).\{-}' |
||||||
|
\ . '(\(.\{-}\)\%(,\s\+\S\+\s\+\(.\{-}\)\)\?)' |
||||||
|
\ , '\1\n\2\n\3\n\4\n\5', '') |
||||||
|
\ , "\n", 1) |
||||||
|
let i['patches'] = substitute(info[1], '^.*:\s\+\(.*\)', '\1', '') |
||||||
|
let i['compiled_by'] = info[2] |
||||||
|
let i['build_version'] = substitute(info[3], '^\(.\{-}\)\..*', '\1', '') |
||||||
|
let i['features'] = {} |
||||||
|
for line in range(4, len(info)) |
||||||
|
if (info[line] =~ '^\s*$') || (info[line] =~ '^\s\+.*:\s') |
||||||
|
break |
||||||
|
endif |
||||||
|
call map(split(info[line], '\s\+'), |
||||||
|
\ 'extend(i["features"], {strpart(v:val, 1) : (v:val =~ "^+" ? 1 : 0)})') |
||||||
|
endfor |
||||||
|
return self |
||||||
|
endfunc |
||||||
|
|
||||||
|
" to_l {{{2 |
||||||
|
func vn.to_l(...) dict |
||||||
|
return self.__info |
||||||
|
endfunc |
||||||
|
|
||||||
|
" " to_s {{{2 |
||||||
|
" func vn.to_s(...) dict |
||||||
|
" let default = "%3n %s\n" |
||||||
|
" "let format = default |
||||||
|
" let format = a:0 && a:1 != '' ? a:1 : default |
||||||
|
" let scripts = a:0 > 1 ? a:2.__info : self.__info |
||||||
|
" let str = '' |
||||||
|
" for i in range(0, len(scripts) - 1) |
||||||
|
" let str .= vimple#format( |
||||||
|
" \ format, |
||||||
|
" \ { 'n': ['d', scripts[i]['number']], |
||||||
|
" \ 's': ['s', scripts[i]['script']]}, |
||||||
|
" \ default |
||||||
|
" \ ) |
||||||
|
" endfor |
||||||
|
" return str |
||||||
|
" endfunc |
||||||
|
|
||||||
|
" " print {{{2 |
||||||
|
" " only able to colour print the default to_s() output at this stage |
||||||
|
" " Note: This is a LOT of dancing just to get coloured numbers ;) |
||||||
|
" func vn.print() dict |
||||||
|
" call self.update() |
||||||
|
" call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') |
||||||
|
" endfunc |
||||||
|
|
||||||
|
" filter {{{2 |
||||||
|
func vn.filter(filter) dict abort |
||||||
|
let dict = deepcopy(self) |
||||||
|
call filter(dict.__info["features"], a:filter) |
||||||
|
let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter |
||||||
|
return dict |
||||||
|
endfunc |
||||||
|
|
||||||
|
" filter_by_name {{{2 |
||||||
|
func vn.filter_by_name(name) dict abort |
||||||
|
return self.filter('v:key =~ "' . escape(a:name, '"') . '"') |
||||||
|
endfunc |
||||||
|
|
||||||
|
call vn.update() |
||||||
|
return vn |
||||||
|
endfunction |
||||||
|
|
||||||
|
" Teardown:{{{1 |
||||||
|
"reset &cpo back to users setting |
||||||
|
let &cpo = s:save_cpo |
||||||
|
" vim: set sw=2 sts=2 et fdm=marker: |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue