mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 03:53:52 -05:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e69f9f91d9 | ||
|
|
c37e16fbbd | ||
|
|
d7873996b4 | ||
|
|
73cbf0269e | ||
|
|
0077bd5a31 | ||
|
|
e8c16931f9 | ||
|
|
752a647be1 | ||
|
|
97a0bdcef6 | ||
|
|
58f119c57f | ||
|
|
0ac0389039 | ||
|
|
4bf3f6c300 | ||
|
|
4a80e945ad | ||
|
|
27f22774b1 | ||
|
|
f6be1d3d13 | ||
|
|
77f091c8c7 | ||
|
|
17149b4657 | ||
|
|
271c88a356 | ||
|
|
b86a0cd422 | ||
|
|
06c80c676e | ||
|
|
b061a2d995 | ||
|
|
e59b949def | ||
|
|
f0d869aea7 | ||
|
|
96e9c416ae | ||
|
|
d888bc4422 | ||
|
|
b4425d2c39 | ||
|
|
1ef902d053 |
8
.travis.yml
Normal file
8
.travis.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
language: ruby
|
||||||
|
rvm:
|
||||||
|
- 1.9.3
|
||||||
|
before_install: sudo apt-get install vim-gtk
|
||||||
|
before_script:
|
||||||
|
- "export DISPLAY=:99.0"
|
||||||
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
|
script: bundle exec rspec
|
||||||
4
Gemfile
Normal file
4
Gemfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'vimrunner'
|
||||||
|
gem 'rspec'
|
||||||
20
Gemfile.lock
Normal file
20
Gemfile.lock
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
diff-lcs (1.1.3)
|
||||||
|
rspec (2.12.0)
|
||||||
|
rspec-core (~> 2.12.0)
|
||||||
|
rspec-expectations (~> 2.12.0)
|
||||||
|
rspec-mocks (~> 2.12.0)
|
||||||
|
rspec-core (2.12.2)
|
||||||
|
rspec-expectations (2.12.1)
|
||||||
|
diff-lcs (~> 1.1.3)
|
||||||
|
rspec-mocks (2.12.0)
|
||||||
|
vimrunner (0.3.0)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rspec
|
||||||
|
vimrunner
|
||||||
99
README.md
99
README.md
@@ -1,14 +1,20 @@
|
|||||||
# vim-polyglot
|
# vim-polyglot [![Build Status][travis-img-url]][travis-url]
|
||||||
|
|
||||||
|
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.png
|
||||||
|
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
||||||
|
|
||||||
A collection of language packs for Vim.
|
A collection of language packs for Vim.
|
||||||
|
|
||||||
One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||||
|
|
||||||
- It **won't affect your startup time**, as all files are loaded only on demand.
|
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||||
- It **installs 40x faster** (unparallelized), as language packs are not submoduled, but merged.
|
- It **installs 40x faster** (unparallelized), as language packs are not submoduled, but merged.
|
||||||
- It clones even faster as all unnecessary files are ignored (like enormous documentation from php support).
|
- It clones even faster as all unnecessary files are ignored (like enormous documentation from php support).
|
||||||
- Best syntax and indentation support. If someone releases better language pack, it will be replaced here.
|
- Best syntax and indentation support. If someone releases better language pack, it will be replaced here.
|
||||||
- No support for esoteric languages (vim-polyglot supports modern ones like `slim` though).
|
- No support for esoteric languages (vim-polyglot supports modern ones like `slim` though).
|
||||||
|
- Each build is tested by automated Travis CI setup using vimrunner gem. Spee `spec` directory.
|
||||||
|
|
||||||
|
\*To be completely honest, concatenated `ftdetect` script takes around `3ms` to load.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -19,48 +25,49 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
|
|
||||||
## Language packs
|
## Language packs
|
||||||
|
|
||||||
- [arduino](https://github.com/sudar/vim-arduino-syntax)
|
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, ftdetect)
|
||||||
- [bundler](https://github.com/tpope/vim-bundler)
|
- [bundler](https://github.com/tpope/vim-bundler) (compiler)
|
||||||
- [c/c++](https://github.com/vim-jp/cpp-vim)
|
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight)
|
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
||||||
- [clojure](https://github.com/guns/vim-clojure-static)
|
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script)
|
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [csv](https://github.com/chrisbra/csv.vim)
|
- [css-color](https://github.com/ap/vim-css-color) (syntax)
|
||||||
- [css colors](https://github.com/ap/vim-css-color)
|
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [cucumber](https://github.com/tpope/vim-cucumber)
|
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [erlang](https://github.com/jimenezrick/vimerl)
|
- [erlang](https://github.com/jimenezrick/vimerl) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [git](https://github.com/tpope/vim-git)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [haml](https://github.com/tpope/vim-haml)
|
- [go](https://github.com/jnwhiteh/vim-golang) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||||
- [handlebars](https://github.com/nono/vim-handlebars)
|
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [hasksyn](https://github.com/travitch/hasksyn)
|
- [handlebars](https://github.com/nono/vim-handlebars) (syntax, ftplugin, ftdetect)
|
||||||
- [html5](https://github.com/othree/html5.vim)
|
- [haskell](https://github.com/travitch/hasksyn) (syntax, indent, ftplugin)
|
||||||
- [javascript](https://github.com/pangloss/vim-javascript)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload)
|
||||||
- [json](https://github.com/leshill/vim-json)
|
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [jst](https://github.com/briancollins/vim-jst)
|
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftdetect)
|
||||||
- [latex](https://github.com/jcf/vim-latex)
|
- [json](https://github.com/leshill/vim-json) (syntax, ftdetect)
|
||||||
- [less](https://github.com/groenewege/vim-less)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||||
- [markdown](https://github.com/tpope/vim-markdown)
|
- [latex](https://github.com/jcf/vim-latex) (indent, compiler, ftplugin)
|
||||||
- [nginx](https://github.com/mutewinter/nginx.vim)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [ocaml](https://github.com/jrk/vim-ocaml)
|
- [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect)
|
||||||
- [octave](https://github.com/vim-scripts/octave.vim--)
|
- [nginx](https://github.com/mutewinter/nginx.vim) (syntax, ftdetect)
|
||||||
- [php](https://github.com/spf13/PIV)
|
- [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin)
|
||||||
- [puppet](https://github.com/ajf/puppet-vim)
|
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
||||||
- [python](https://github.com/vim-scripts/python.vim--Vasiliev)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [rspec](https://github.com/skwp/vim-rspec)
|
- [puppet](https://github.com/ajf/puppet-vim) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [ruby](https://github.com/vim-ruby/vim-ruby)
|
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
||||||
- [sbt](https://github.com/derekwyatt/vim-sbt)
|
- [python](https://github.com/vim-scripts/python.vim--Vasiliev) (syntax)
|
||||||
- [scala](https://github.com/derekwyatt/vim-scala)
|
- [rspec](https://github.com/skwp/vim-rspec) (syntax)
|
||||||
- [scss-syntax](https://github.com/cakebaker/scss-syntax.vim)
|
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [slim](https://github.com/slim-template/vim-slim)
|
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
|
||||||
- [stylus](https://github.com/wavded/vim-stylus)
|
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [textile](https://github.com/timcharper/textile.vim)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
|
||||||
- [tmux](https://github.com/acustodioo/vim-tmux)
|
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [tomdoc](https://github.com/mutewinter/tomdoc.vim)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [twig](https://github.com/beyondwords/vim-twig)
|
- [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect)
|
||||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim)
|
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
||||||
- [vim-golang](https://github.com/jnwhiteh/vim-golang)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
- [xls](https://github.com/vim-scripts/XSLT-syntax)
|
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
||||||
|
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -71,3 +78,7 @@ Feel free to add your language, and send pull-request.
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
See linked repositories for detailed license information.
|
See linked repositories for detailed license information.
|
||||||
|
|
||||||
|
|
||||||
|
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
if !exists("g:DisableAutoPHPFolding")
|
|
||||||
let g:DisableAutoPHPFolding = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !g:DisableAutoPHPFolding
|
|
||||||
" Don't use the PHP syntax folding
|
|
||||||
setlocal foldmethod=manual
|
|
||||||
" Turn on PHP fast folds
|
|
||||||
EnableFastPHPFolds
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Fix matchpairs for PHP (for matchit.vim plugin)
|
|
||||||
if exists("loaded_matchit")
|
|
||||||
let b:match_skip = 's:comment\|string'
|
|
||||||
let b:match_words = '<?\(php\)\?:?>,\<switch\>:\<endswitch\>,' .
|
|
||||||
\ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
|
|
||||||
\ '\<while\>:\<endwhile\>,\<do\>:\<while\>,' .
|
|
||||||
\ '\<for\>:\<endfor\>,\<foreach\>:\<endforeach\>' .
|
|
||||||
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
|
|
||||||
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
|
|
||||||
\ '<\@<=\([^/?][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
|
|
||||||
\ '<:>,(:),{:},[:]'
|
|
||||||
endif
|
|
||||||
@@ -5,8 +5,7 @@
|
|||||||
"
|
"
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=coffeeComment contained
|
syn keyword tomdocKeywords Returns containedin=coffeeComment contained
|
||||||
syn keyword tomdocKeywords Yields containedin=coffeeComment contained
|
syn keyword tomdocKeywords Throws containedin=coffeeComment contained
|
||||||
syn keyword tomdocKeywords Raises containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=coffeeComment contained
|
syn keyword tomdocKeywords Examples containedin=coffeeComment contained
|
||||||
syn keyword tomdocKeywords Signature containedin=coffeeComment contained
|
syn keyword tomdocKeywords Signature containedin=coffeeComment contained
|
||||||
|
|
||||||
@@ -16,6 +15,6 @@ syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=coffeeComment contai
|
|||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=coffeeComment contained
|
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=coffeeComment contained
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=coffeeComment contained
|
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=coffeeComment contained
|
||||||
|
|
||||||
hi default link tomdocDescriptions TODO
|
hi default link tomdocDescriptions String
|
||||||
hi default link tomdocKeywords TODO
|
hi default link tomdocKeywords String
|
||||||
hi default link tomdocArguments HELP
|
hi default link tomdocArguments HELP
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=rubyComment containe
|
|||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=rubyComment contained
|
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=rubyComment contained
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=rubyComment contained
|
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=rubyComment contained
|
||||||
|
|
||||||
hi default link tomdocDescriptions TODO
|
hi default link tomdocDescriptions String
|
||||||
hi default link tomdocKeywords TODO
|
hi default link tomdocKeywords String
|
||||||
hi default link tomdocArguments HELP
|
hi default link tomdocArguments HELP
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
146
build
146
build
@@ -1,94 +1,114 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -E
|
set -E
|
||||||
|
|
||||||
DIRS="
|
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
||||||
syntax indent ftplugin ftdetect autoload compiler
|
|
||||||
after/syntax after/indent after/ftplugin after/ftdetect
|
|
||||||
"
|
|
||||||
|
|
||||||
copy_dir() {
|
|
||||||
if [ -d "$1/$2" ]; then
|
|
||||||
for file in $(find "$1/$2" -name '*.vim'); do
|
|
||||||
file_path="$(dirname "${file##$1/}")"
|
|
||||||
mkdir -p "$file_path"
|
|
||||||
cp $file $file_path/
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Fetches syntax files from given Github repo
|
# Fetches syntax files from given Github repo
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
for pack in $1; do
|
for pack in $1; do
|
||||||
dir="tmp/$(echo "$pack" | cut -d '/' -f 2)"
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
echo "- [$pack](https://github.com/$pack)"
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
git clone -q --recursive "https://github.com/$pack.git" "$dir" &
|
(git clone -q --recursive "https://github.com/$path.git" "$dir" && printf '.') &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
extract() {
|
extract() {
|
||||||
|
printf "\n"
|
||||||
for pack in $1; do
|
for pack in $1; do
|
||||||
dir="tmp/$(echo "$pack" | cut -d '/' -f 2)"
|
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||||
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
|
printf -- "- [$name](https://github.com/$path) ("
|
||||||
|
|
||||||
# which tree > /dev/null && tree tmp
|
# which tree > /dev/null && tree tmp
|
||||||
|
subdirs=""
|
||||||
for subdir in $DIRS; do
|
for subdir in $DIRS; do
|
||||||
|
if [ -d "$dir/$subdir" ]; then
|
||||||
|
base="$(basename "$subdir")"
|
||||||
|
if [[ "$subdirs" != *"$base"* ]]; then
|
||||||
|
subdirs="$subdirs, $base"
|
||||||
|
fi
|
||||||
|
|
||||||
copy_dir "$dir" "$subdir"
|
copy_dir "$dir" "$subdir"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
printf "${subdirs##, })\n"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy_dir() {
|
||||||
|
for file in $(find "$1/$2" -name '*.vim'); do
|
||||||
|
file_path="$(dirname "${file##$1/}")"
|
||||||
|
mkdir -p "$file_path"
|
||||||
|
cp $file $file_path/
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
concat_ftdetect() {
|
||||||
|
cat ftdetect/* | grep -E '^[^"]' > tmp/polyglot.vim
|
||||||
|
rm -f ftdetect/*
|
||||||
|
mv tmp/polyglot.vim ftdetect/
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKS="
|
||||||
|
arduino:sudar/vim-arduino-syntax
|
||||||
|
bundler:tpope/vim-bundler
|
||||||
|
c++11:octol/vim-cpp-enhanced-highlight
|
||||||
|
c/c++:vim-jp/cpp-vim
|
||||||
|
clojure:guns/vim-clojure-static
|
||||||
|
coffee-script:kchmck/vim-coffee-script
|
||||||
|
css-color:ap/vim-css-color
|
||||||
|
csv:chrisbra/csv.vim
|
||||||
|
cucumber:tpope/vim-cucumber
|
||||||
|
elixir:elixir-lang/vim-elixir
|
||||||
|
erlang:jimenezrick/vimerl
|
||||||
|
git:tpope/vim-git
|
||||||
|
go:jnwhiteh/vim-golang
|
||||||
|
haml:tpope/vim-haml
|
||||||
|
handlebars:nono/vim-handlebars
|
||||||
|
haskell:travitch/hasksyn
|
||||||
|
html5:othree/html5.vim
|
||||||
|
jade:digitaltoad/vim-jade
|
||||||
|
javascript:pangloss/vim-javascript
|
||||||
|
json:leshill/vim-json
|
||||||
|
jst:briancollins/vim-jst
|
||||||
|
latex:jcf/vim-latex
|
||||||
|
less:groenewege/vim-less
|
||||||
|
markdown:tpope/vim-markdown
|
||||||
|
nginx:mutewinter/nginx.vim
|
||||||
|
ocaml:jrk/vim-ocaml
|
||||||
|
octave:vim-scripts/octave.vim--
|
||||||
|
php:StanAngeloff/php.vim
|
||||||
|
puppet:ajf/puppet-vim
|
||||||
|
protobuf:uarun/vim-protobuf
|
||||||
|
python:vim-scripts/python.vim--Vasiliev
|
||||||
|
rspec:skwp/vim-rspec
|
||||||
|
ruby:vim-ruby/vim-ruby
|
||||||
|
sbt:derekwyatt/vim-sbt
|
||||||
|
scala:derekwyatt/vim-scala
|
||||||
|
slim:slim-template/vim-slim
|
||||||
|
stylus:wavded/vim-stylus
|
||||||
|
textile:timcharper/textile.vim
|
||||||
|
tmux:acustodioo/vim-tmux
|
||||||
|
tomdoc:duwanis/tomdoc.vim
|
||||||
|
vbnet:vim-scripts/vbnet.vim
|
||||||
|
twig:beyondwords/vim-twig
|
||||||
|
xls:vim-scripts/XSLT-syntax
|
||||||
|
"
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
rm -rf $DIRS
|
rm -rf $DIRS
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
|
|
||||||
PACKS="
|
printf "Downloading packs..."
|
||||||
vim-ruby/vim-ruby
|
|
||||||
kchmck/vim-coffee-script
|
|
||||||
tpope/vim-haml
|
|
||||||
tpope/vim-bundler
|
|
||||||
pangloss/vim-javascript
|
|
||||||
leshill/vim-json
|
|
||||||
mutewinter/tomdoc.vim
|
|
||||||
mutewinter/nginx.vim
|
|
||||||
timcharper/textile.vim
|
|
||||||
tpope/vim-markdown
|
|
||||||
nono/vim-handlebars
|
|
||||||
acustodioo/vim-tmux
|
|
||||||
groenewege/vim-less
|
|
||||||
wavded/vim-stylus
|
|
||||||
tpope/vim-cucumber
|
|
||||||
jrk/vim-ocaml
|
|
||||||
slim-template/vim-slim
|
|
||||||
vim-scripts/XSLT-syntax
|
|
||||||
vim-scripts/python.vim--Vasiliev
|
|
||||||
vim-scripts/octave.vim--
|
|
||||||
jnwhiteh/vim-golang
|
|
||||||
spf13/PIV
|
|
||||||
briancollins/vim-jst
|
|
||||||
derekwyatt/vim-scala
|
|
||||||
derekwyatt/vim-sbt
|
|
||||||
travitch/hasksyn
|
|
||||||
ajf/puppet-vim
|
|
||||||
beyondwords/vim-twig
|
|
||||||
sudar/vim-arduino-syntax
|
|
||||||
guns/vim-clojure-static
|
|
||||||
chrisbra/csv.vim
|
|
||||||
elixir-lang/vim-elixir
|
|
||||||
jimenezrick/vimerl
|
|
||||||
tpope/vim-git
|
|
||||||
skwp/vim-rspec
|
|
||||||
vim-scripts/vbnet.vim
|
|
||||||
jcf/vim-latex
|
|
||||||
othree/html5.vim
|
|
||||||
ap/vim-css-color
|
|
||||||
vim-jp/cpp-vim
|
|
||||||
octol/vim-cpp-enhanced-highlight
|
|
||||||
"
|
|
||||||
|
|
||||||
download "$PACKS"
|
download "$PACKS"
|
||||||
extract "$PACKS"
|
extract "$PACKS"
|
||||||
|
concat_ftdetect
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
au BufNewFile,BufRead *.clj,*.cljs,*.edn setf clojure
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
" Language: CoffeeScript
|
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
|
||||||
" License: WTFPL
|
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
|
||||||
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
|
||||||
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
|
||||||
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
|
||||||
|
|
||||||
function! s:DetectCoffee()
|
|
||||||
if getline(1) =~ '^#!.*\<coffee\>'
|
|
||||||
set filetype=coffee
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Install Filetype detection for CSV files
|
|
||||||
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Cucumber
|
|
||||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
|
||||||
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
" Git
|
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,MERGE_}MSG set ft=gitcommit
|
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
|
||||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
|
||||||
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
|
||||||
autocmd BufNewFile,BufRead .msg.[0-9]*
|
|
||||||
\ if getline(1) =~ '^From.*# This line is ignored.$' |
|
|
||||||
\ set ft=gitsendemail |
|
|
||||||
\ endif
|
|
||||||
autocmd BufNewFile,BufRead *.git/**
|
|
||||||
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
|
||||||
\ set ft=git |
|
|
||||||
\ endif
|
|
||||||
|
|
||||||
" This logic really belongs in scripts.vim
|
|
||||||
autocmd BufNewFile,BufRead,StdinReadPost *
|
|
||||||
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
|
||||||
\ set ft=git |
|
|
||||||
\ endif
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
" We take care to preserve the user's fileencodings and fileformats,
|
|
||||||
" because those settings are global (not buffer local), yet we want
|
|
||||||
" to override them for loading Go files, which are defined to be UTF-8.
|
|
||||||
let s:current_fileformats = ''
|
|
||||||
let s:current_fileencodings = ''
|
|
||||||
|
|
||||||
" define fileencodings to open as utf-8 encoding even if it's ascii.
|
|
||||||
function! s:gofiletype_pre()
|
|
||||||
let s:current_fileformats = &g:fileformats
|
|
||||||
let s:current_fileencodings = &g:fileencodings
|
|
||||||
set fileencodings=utf-8 fileformats=unix
|
|
||||||
setlocal filetype=go
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" restore fileencodings as others
|
|
||||||
function! s:gofiletype_post()
|
|
||||||
let &g:fileformats = s:current_fileformats
|
|
||||||
let &g:fileencodings = s:current_fileencodings
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
|
||||||
au BufRead *.go call s:gofiletype_pre()
|
|
||||||
au BufReadPost *.go call s:gofiletype_post()
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars setf haml
|
|
||||||
autocmd BufNewFile,BufRead *.sass setf sass
|
|
||||||
autocmd BufNewFile,BufRead *.scss setf scss
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
if has("autocmd")
|
|
||||||
au BufNewFile,BufRead *.{handlebars,hb,hbs,hbt}{,.erb} set ft=html syntax=handlebars | runtime! ftplugin/handlebars.vim ftplugin/handlebars*.vim ftplugin/handlebars/*.vim
|
|
||||||
endif
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
au BufNewFile,BufRead *.js setf javascript
|
|
||||||
au BufNewFile,BufRead *.jsm setf javascript
|
|
||||||
au BufNewFile,BufRead *.json setf javascript
|
|
||||||
au BufNewFile,BufRead Jakefile setf javascript
|
|
||||||
|
|
||||||
fun! s:SelectJavascript()
|
|
||||||
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
|
|
||||||
set ft=javascript
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
au BufNewFile,BufRead * call s:SelectJavascript()
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
|
||||||
|
|
||||||
augroup json_autocmd
|
|
||||||
autocmd!
|
|
||||||
autocmd FileType json setlocal autoindent
|
|
||||||
autocmd FileType json setlocal formatoptions=tcq2l
|
|
||||||
autocmd FileType json setlocal foldmethod=syntax
|
|
||||||
augroup END
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
au BufNewFile,BufRead *.ejs set filetype=jst
|
|
||||||
au BufNewFile,BufRead *.jst set filetype=jst
|
|
||||||
au BufNewFile,BufRead *.hamljs set filetype=jst
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead *.less setf less
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
|
|
||||||
\ if &ft =~# '^\%(conf\|modula2\)$' |
|
|
||||||
\ set ft=markdown |
|
|
||||||
\ else |
|
|
||||||
\ setf markdown |
|
|
||||||
\ endif
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
|
|
||||||
121
ftdetect/polyglot.vim
Normal file
121
ftdetect/polyglot.vim
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||||
|
au BufNewFile,BufRead *.clj,*.cljs,*.edn setf clojure
|
||||||
|
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
||||||
|
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
||||||
|
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
||||||
|
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
||||||
|
function! s:DetectCoffee()
|
||||||
|
if getline(1) =~ '^#!.*\<coffee\>'
|
||||||
|
set filetype=coffee
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||||
|
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
||||||
|
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||||
|
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
||||||
|
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||||
|
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,MERGE_}MSG set ft=gitcommit
|
||||||
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
||||||
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||||
|
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
||||||
|
autocmd BufNewFile,BufRead .msg.[0-9]*
|
||||||
|
\ if getline(1) =~ '^From.*# This line is ignored.$' |
|
||||||
|
\ set ft=gitsendemail |
|
||||||
|
\ endif
|
||||||
|
autocmd BufNewFile,BufRead *.git/**
|
||||||
|
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
||||||
|
\ set ft=git |
|
||||||
|
\ endif
|
||||||
|
autocmd BufNewFile,BufRead,StdinReadPost *
|
||||||
|
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
||||||
|
\ set ft=git |
|
||||||
|
\ endif
|
||||||
|
let s:current_fileformats = ''
|
||||||
|
let s:current_fileencodings = ''
|
||||||
|
function! s:gofiletype_pre()
|
||||||
|
let s:current_fileformats = &g:fileformats
|
||||||
|
let s:current_fileencodings = &g:fileencodings
|
||||||
|
set fileencodings=utf-8 fileformats=unix
|
||||||
|
setlocal filetype=go
|
||||||
|
endfunction
|
||||||
|
function! s:gofiletype_post()
|
||||||
|
let &g:fileformats = s:current_fileformats
|
||||||
|
let &g:fileencodings = s:current_fileencodings
|
||||||
|
endfunction
|
||||||
|
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
||||||
|
au BufRead *.go call s:gofiletype_pre()
|
||||||
|
au BufReadPost *.go call s:gofiletype_post()
|
||||||
|
autocmd BufNewFile,BufRead *.haml,*.hamlbars setf haml
|
||||||
|
autocmd BufNewFile,BufRead *.sass setf sass
|
||||||
|
autocmd BufNewFile,BufRead *.scss setf scss
|
||||||
|
if has("autocmd")
|
||||||
|
au BufNewFile,BufRead *.{handlebars,hb,hbs,hbt}{,.erb} set ft=html syntax=handlebars | runtime! ftplugin/handlebars.vim ftplugin/handlebars*.vim ftplugin/handlebars/*.vim
|
||||||
|
endif
|
||||||
|
autocmd BufNewFile,BufReadPost *.jade set filetype=jade
|
||||||
|
au BufNewFile,BufRead *.js setf javascript
|
||||||
|
au BufNewFile,BufRead *.jsm setf javascript
|
||||||
|
au BufNewFile,BufRead *.json setf javascript
|
||||||
|
au BufNewFile,BufRead Jakefile setf javascript
|
||||||
|
fun! s:SelectJavascript()
|
||||||
|
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
|
||||||
|
set ft=javascript
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
au BufNewFile,BufRead * call s:SelectJavascript()
|
||||||
|
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||||
|
augroup json_autocmd
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType json setlocal autoindent
|
||||||
|
autocmd FileType json setlocal formatoptions=tcq2l
|
||||||
|
autocmd FileType json setlocal foldmethod=syntax
|
||||||
|
augroup END
|
||||||
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
||||||
|
au BufNewFile,BufRead *.jst set filetype=jst
|
||||||
|
au BufNewFile,BufRead *.hamljs set filetype=jst
|
||||||
|
autocmd BufNewFile,BufRead *.less setf less
|
||||||
|
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
|
||||||
|
\ if &ft =~# '^\%(conf\|modula2\)$' |
|
||||||
|
\ set ft=markdown |
|
||||||
|
\ else |
|
||||||
|
\ setf markdown |
|
||||||
|
\ endif
|
||||||
|
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
|
||||||
|
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||||
|
au BufRead,BufNewFile *.pp set filetype=puppet
|
||||||
|
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec set filetype=ruby
|
||||||
|
au BufNewFile,BufRead *.builder,*.rxml,*.rjs set filetype=ruby
|
||||||
|
au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby
|
||||||
|
au BufNewFile,BufRead [rR]antfile,*.rant set filetype=ruby
|
||||||
|
au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby
|
||||||
|
au BufNewFile,BufRead .pryrc set filetype=ruby
|
||||||
|
au BufNewFile,BufRead *.ru set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Capfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Gemfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Guardfile,.Guardfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Cheffile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Berksfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead [vV]agrantfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead .autotest set filetype=ruby
|
||||||
|
au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby
|
||||||
|
au BufNewFile,BufRead [tT]horfile,*.thor set filetype=ruby
|
||||||
|
au BufNewFile,BufRead *.rabl set filetype=ruby
|
||||||
|
au BufNewFile,BufRead *.jbuilder set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Puppetfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead [Bb]uildfile set filetype=ruby
|
||||||
|
au BufNewFile,BufRead Appraisals set filetype=ruby
|
||||||
|
au BufRead,BufNewFile *.sbt set filetype=sbt
|
||||||
|
fun! s:DetectScala()
|
||||||
|
if getline(1) == '#!/usr/bin/env scala'
|
||||||
|
set filetype=scala
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
|
||||||
|
au BufRead,BufNewFile * call s:DetectScala()
|
||||||
|
autocmd BufNewFile,BufRead *.slim setf slim
|
||||||
|
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
||||||
|
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||||
|
au BufRead,BufNewFile *.textile set filetype=textile
|
||||||
|
autocmd BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
||||||
|
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
||||||
|
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" detect puppet filetype
|
|
||||||
au BufRead,BufNewFile *.pp set filetype=puppet
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
" Ruby
|
|
||||||
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec set filetype=ruby
|
|
||||||
|
|
||||||
" Ruby on Rails
|
|
||||||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs set filetype=ruby
|
|
||||||
|
|
||||||
" Rakefile
|
|
||||||
au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby
|
|
||||||
|
|
||||||
" Rantfile
|
|
||||||
au BufNewFile,BufRead [rR]antfile,*.rant set filetype=ruby
|
|
||||||
|
|
||||||
" IRB config
|
|
||||||
au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby
|
|
||||||
|
|
||||||
" Pry config
|
|
||||||
au BufNewFile,BufRead .pryrc set filetype=ruby
|
|
||||||
|
|
||||||
" Rackup
|
|
||||||
au BufNewFile,BufRead *.ru set filetype=ruby
|
|
||||||
|
|
||||||
" Capistrano
|
|
||||||
au BufNewFile,BufRead Capfile set filetype=ruby
|
|
||||||
|
|
||||||
" Bundler
|
|
||||||
au BufNewFile,BufRead Gemfile set filetype=ruby
|
|
||||||
|
|
||||||
" Guard
|
|
||||||
au BufNewFile,BufRead Guardfile,.Guardfile set filetype=ruby
|
|
||||||
|
|
||||||
" Chef
|
|
||||||
au BufNewFile,BufRead Cheffile set filetype=ruby
|
|
||||||
au BufNewFile,BufRead Berksfile set filetype=ruby
|
|
||||||
|
|
||||||
" Vagrant
|
|
||||||
au BufNewFile,BufRead [vV]agrantfile set filetype=ruby
|
|
||||||
|
|
||||||
" Autotest
|
|
||||||
au BufNewFile,BufRead .autotest set filetype=ruby
|
|
||||||
|
|
||||||
" eRuby
|
|
||||||
au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby
|
|
||||||
|
|
||||||
" Thor
|
|
||||||
au BufNewFile,BufRead [tT]horfile,*.thor set filetype=ruby
|
|
||||||
|
|
||||||
" Rabl
|
|
||||||
au BufNewFile,BufRead *.rabl set filetype=ruby
|
|
||||||
|
|
||||||
" Jbuilder
|
|
||||||
au BufNewFile,BufRead *.jbuilder set filetype=ruby
|
|
||||||
|
|
||||||
" Puppet librarian
|
|
||||||
au BufNewFile,BufRead Puppetfile set filetype=ruby
|
|
||||||
"
|
|
||||||
" Buildr Buildfile
|
|
||||||
au BufNewFile,BufRead [Bb]uildfile set filetype=ruby
|
|
||||||
|
|
||||||
" Appraisal
|
|
||||||
au BufNewFile,BufRead Appraisals set filetype=ruby
|
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
" Vim detect file
|
|
||||||
" Language: sbt
|
|
||||||
" Maintainer: Derek Wyatt <derek@{myfirstname}{mylastname}.org>
|
|
||||||
" Last Change: 2012 Jan 19
|
|
||||||
|
|
||||||
au BufRead,BufNewFile *.sbt set filetype=sbt
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
fun! s:DetectScala()
|
|
||||||
if getline(1) == '#!/usr/bin/env scala'
|
|
||||||
set filetype=scala
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
|
|
||||||
au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
|
|
||||||
au BufRead,BufNewFile * call s:DetectScala()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead *.slim setf slim
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Stylus
|
|
||||||
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
|
||||||
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
" textile.vim
|
|
||||||
"
|
|
||||||
" Tim Harper (tim.theenchanter.com)
|
|
||||||
|
|
||||||
" Force filetype to be textile even if already set
|
|
||||||
" This will override the system ftplugin/changelog
|
|
||||||
" set on some distros
|
|
||||||
au BufRead,BufNewFile *.textile set filetype=textile
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
autocmd BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
" Twig
|
|
||||||
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
|
||||||
|
|
||||||
" HTML Twig
|
|
||||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
|
||||||
53
ftplugin/jade.vim
Normal file
53
ftplugin/jade.vim
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
" Vim filetype plugin
|
||||||
|
" Language: Jade
|
||||||
|
" Maintainer: Joshua Borton
|
||||||
|
" Credits: Tim Pope
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
" Define some defaults in case the included ftplugins don't set them.
|
||||||
|
let s:undo_ftplugin = ""
|
||||||
|
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
||||||
|
let s:match_words = ""
|
||||||
|
|
||||||
|
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
||||||
|
unlet! b:did_ftplugin
|
||||||
|
|
||||||
|
" Override our defaults if these were set by an included ftplugin.
|
||||||
|
if exists("b:undo_ftplugin")
|
||||||
|
let s:undo_ftplugin = b:undo_ftplugin
|
||||||
|
unlet b:undo_ftplugin
|
||||||
|
endif
|
||||||
|
if exists("b:browsefilter")
|
||||||
|
let s:browsefilter = b:browsefilter
|
||||||
|
unlet b:browsefilter
|
||||||
|
endif
|
||||||
|
if exists("b:match_words")
|
||||||
|
let s:match_words = b:match_words
|
||||||
|
unlet b:match_words
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Change the browse dialog on Win32 to show mainly Haml-related files
|
||||||
|
if has("gui_win32")
|
||||||
|
let b:browsefilter="Jade Files (*.jade)\t*.jade\n" . s:browsefilter
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Load the combined list of match_words for matchit.vim
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_words = s:match_words
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal comments=://-,:// commentstring=//\ %s
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< com< "
|
||||||
|
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
|
||||||
|
" vim:set sw=2:
|
||||||
202
ftplugin/php.vim
202
ftplugin/php.vim
@@ -1,202 +0,0 @@
|
|||||||
" File: php.vim
|
|
||||||
" Description: PHP Integration for VIM plugin
|
|
||||||
" This file is a considerable fork of the original
|
|
||||||
" PDV written by Tobias Schlitt <toby@php.net>.
|
|
||||||
" Maintainer: Steve Francia <piv@spf13.com> <http://spf13.com>
|
|
||||||
" Version: 0.9
|
|
||||||
" Last Change: 7th January 2012
|
|
||||||
"
|
|
||||||
"
|
|
||||||
" Section: script init stuff {{{1
|
|
||||||
if exists("loaded_piv")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let loaded_piv = 1
|
|
||||||
|
|
||||||
"
|
|
||||||
" Function: s:InitVariable() function {{{2
|
|
||||||
" This function is used to initialise a given variable to a given value. The
|
|
||||||
" variable is only initialised if it does not exist prior
|
|
||||||
"
|
|
||||||
" Args:
|
|
||||||
" -var: the name of the var to be initialised
|
|
||||||
" -value: the value to initialise var to
|
|
||||||
"
|
|
||||||
" Returns:
|
|
||||||
" 1 if the var is set, 0 otherwise
|
|
||||||
function s:InitVariable(var, value)
|
|
||||||
if !exists(a:var)
|
|
||||||
exec 'let ' . a:var . ' = ' . "'" . a:value . "'"
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
return 0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
" {{{ Settings
|
|
||||||
" First the global PHP configuration
|
|
||||||
let php_sql_query=1 " to highlight SQL syntax in strings
|
|
||||||
let php_htmlInStrings=1 " to highlight HTML in string
|
|
||||||
let php_noShortTags = 1 " to disable short tags
|
|
||||||
let php_folding = 1 "to enable folding for classes and functions
|
|
||||||
let PHP_autoformatcomment = 1
|
|
||||||
let php_sync_method = -1
|
|
||||||
|
|
||||||
" Section: variable init calls {{{2
|
|
||||||
call s:InitVariable("g:load_doxygen_syntax", 1)
|
|
||||||
call s:InitVariable("g:syntax_extra_php", 'doxygen')
|
|
||||||
call s:InitVariable("g:syntax_extra_inc", 'doxygen')
|
|
||||||
call s:InitVariable("g:PIVCreateDefaultMappings", 1)
|
|
||||||
call s:InitVariable("g:PIVPearStyle", 0)
|
|
||||||
call s:InitVariable("g:PIVAutoClose", 0)
|
|
||||||
|
|
||||||
" Auto expand tabs to spaces
|
|
||||||
setlocal expandtab
|
|
||||||
setlocal autoindent " Auto indent after a {
|
|
||||||
setlocal smartindent
|
|
||||||
|
|
||||||
" Linewidth to 79, because of the formatoptions this is only valid for
|
|
||||||
" comments
|
|
||||||
setlocal textwidth=79
|
|
||||||
|
|
||||||
setlocal nowrap " Do not wrap lines automatically
|
|
||||||
|
|
||||||
" Correct indentation after opening a phpdocblock and automatic * on every
|
|
||||||
" line
|
|
||||||
setlocal formatoptions=qroct
|
|
||||||
|
|
||||||
" Use php syntax check when doing :make
|
|
||||||
setlocal makeprg=php\ -l\ %
|
|
||||||
|
|
||||||
" Use errorformat for parsing PHP error output
|
|
||||||
setlocal errorformat=%m\ in\ %f\ on\ line\ %l
|
|
||||||
|
|
||||||
" Switch syntax highlighting on, if it was not
|
|
||||||
if !exists("g:syntax_on") | syntax on | endif
|
|
||||||
|
|
||||||
"setlocal keywordprg=pman " Use pman for manual pages
|
|
||||||
|
|
||||||
" }}} Settings
|
|
||||||
|
|
||||||
" {{{ Command mappings
|
|
||||||
nnoremap <silent> <plug>PIVphpDocSingle :call PhpDocSingle()<CR>
|
|
||||||
vnoremap <silent> <plug>PIVphpDocRange :call PhpDocRange()<CR>
|
|
||||||
vnoremap <silent> <plug>PIVphpAlign :call PhpAlign()<CR>
|
|
||||||
"inoremap <buffer> <leader>d :call PhpDocSingle()<CR>i
|
|
||||||
|
|
||||||
" Map ; to "add ; to the end of the line, when missing"
|
|
||||||
"noremap <buffer> ; :s/\([^;]\)$/\1;/<cr>
|
|
||||||
|
|
||||||
" Map <ctrl>+p to single line mode documentation (in insert and command mode)
|
|
||||||
"inoremap <buffer> <leader>d :call PhpDocSingle()<CR>i
|
|
||||||
"nnoremap <buffer> <leader>d :call PhpDocSingle()<CR>
|
|
||||||
" Map <ctrl>+p to multi line mode documentation (in visual mode)
|
|
||||||
"vnoremap <buffer> <leader>d :call PhpDocRange()<CR>
|
|
||||||
|
|
||||||
" Map <CTRL>-H to search phpm for the function name currently under the cursor (insert mode only)
|
|
||||||
inoremap <buffer> <C-H> <ESC>:!phpm <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" {{{ Automatic close char mapping
|
|
||||||
if g:PIVAutoClose
|
|
||||||
if g:PIVPearStyle
|
|
||||||
inoremap <buffer> { {<CR>}<C-O>O
|
|
||||||
inoremap <buffer> ( ( )<LEFT><LEFT>
|
|
||||||
else
|
|
||||||
inoremap { {<CR>}<C-O>O
|
|
||||||
inoremap ( ()<LEFT>
|
|
||||||
endif
|
|
||||||
|
|
||||||
inoremap <buffer> [ []<LEFT>
|
|
||||||
inoremap <buffer> " ""<LEFT>
|
|
||||||
inoremap <buffer> ' ''<LEFT>
|
|
||||||
endif
|
|
||||||
" }}} Automatic close char mapping
|
|
||||||
|
|
||||||
|
|
||||||
" {{{ Wrap visual selections with chars
|
|
||||||
|
|
||||||
vnoremap <buffer> ( "zdi(<C-R>z)<ESC>
|
|
||||||
vnoremap <buffer> { "zdi{<C-R>z}<ESC>
|
|
||||||
vnoremap <buffer> [ "zdi[<C-R>z]<ESC>
|
|
||||||
vnoremap <buffer> ' "zdi'<C-R>z'<ESC>
|
|
||||||
" Removed in favor of register addressing
|
|
||||||
" :vnoremap " "zdi"<C-R>z"<ESC>
|
|
||||||
|
|
||||||
" }}} Wrap visual selections with chars
|
|
||||||
|
|
||||||
" {{{ Dictionary completion
|
|
||||||
setlocal dictionary-=$VIMRUNTIME/bundle/PIV/misc/funclist.txt dictionary+=$VIMRUNTIME/bundle/PIV/misc/funclist.txt
|
|
||||||
|
|
||||||
" Use the dictionary completion
|
|
||||||
setlocal complete-=k complete+=k
|
|
||||||
|
|
||||||
" }}} Dictionary completion
|
|
||||||
|
|
||||||
" {{{ Alignment
|
|
||||||
|
|
||||||
func! PhpAlign() range
|
|
||||||
let l:paste = &g:paste
|
|
||||||
let &g:paste = 0
|
|
||||||
|
|
||||||
let l:line = a:firstline
|
|
||||||
let l:endline = a:lastline
|
|
||||||
let l:maxlength = 0
|
|
||||||
while l:line <= l:endline
|
|
||||||
" Skip comment lines
|
|
||||||
if getline (l:line) =~ '^\s*\/\/.*$'
|
|
||||||
let l:line = l:line + 1
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
" \{-\} matches ungreed *
|
|
||||||
let l:index = substitute (getline (l:line), '^\s*\(.\{-\}\)\s*\S\{0,1}=\S\{0,1\}\s.*$', '\1', "")
|
|
||||||
let l:indexlength = strlen (l:index)
|
|
||||||
let l:maxlength = l:indexlength > l:maxlength ? l:indexlength : l:maxlength
|
|
||||||
let l:line = l:line + 1
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
let l:line = a:firstline
|
|
||||||
let l:format = "%s%-" . l:maxlength . "s %s %s"
|
|
||||||
|
|
||||||
while l:line <= l:endline
|
|
||||||
if getline (l:line) =~ '^\s*\/\/.*$'
|
|
||||||
let l:line = l:line + 1
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
let l:linestart = substitute (getline (l:line), '^\(\s*\).*', '\1', "")
|
|
||||||
let l:linekey = substitute (getline (l:line), '^\s*\(.\{-\}\)\s*\(\S\{0,1}=\S\{0,1\}\)\s\(.*\)$', '\1', "")
|
|
||||||
let l:linesep = substitute (getline (l:line), '^\s*\(.\{-\}\)\s*\(\S\{0,1}=\S\{0,1\}\)\s\(.*\)$', '\2', "")
|
|
||||||
let l:linevalue = substitute (getline (l:line), '^\s*\(.\{-\}\)\s*\(\S\{0,1}=\S\{0,1\}\)\s\(.*\)$', '\3', "")
|
|
||||||
|
|
||||||
let l:newline = printf (l:format, l:linestart, l:linekey, l:linesep, l:linevalue)
|
|
||||||
call setline (l:line, l:newline)
|
|
||||||
let l:line = l:line + 1
|
|
||||||
endwhile
|
|
||||||
let &g:paste = l:paste
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
function! s:CreateNMap(target, combo)
|
|
||||||
if !hasmapto(a:target, 'n')
|
|
||||||
exec 'nmap ' . a:combo . ' ' . a:target
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:CreateVMap(target, combo)
|
|
||||||
if !hasmapto(a:target, 'v')
|
|
||||||
exec 'vmap ' . a:combo . ' ' . a:target
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:CreateMaps(target, combo)
|
|
||||||
call s:CreateNMap(a:target,a:combo)
|
|
||||||
call s:CreateVMap(a:target,a:combo)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if g:PIVCreateDefaultMappings
|
|
||||||
call s:CreateNMap('<plug>PIVphpDocSingle', ',pd')
|
|
||||||
call s:CreateVMap('<plug>PIVphpDocRange', ',pd')
|
|
||||||
call s:CreateMaps('<plug>PIVphpAlign ', ',pa')
|
|
||||||
endif
|
|
||||||
@@ -1,547 +0,0 @@
|
|||||||
" PDV (phpDocumentor for Vim)
|
|
||||||
" ===========================
|
|
||||||
"
|
|
||||||
" Version: 1.1.3
|
|
||||||
"
|
|
||||||
" Copyright 2005 by Tobias Schlitt <toby@php.net>
|
|
||||||
" Inspired by phpDoc script for Vim by Vidyut Luther (http://www.phpcult.com/).
|
|
||||||
"
|
|
||||||
|
|
||||||
" modified by kevin olson (acidjazz@gmail.com) - 03/19/2009
|
|
||||||
" - added folding support
|
|
||||||
"
|
|
||||||
" Provided under the GPL (http://www.gnu.org/copyleft/gpl.html).
|
|
||||||
"
|
|
||||||
" This script provides functions to generate phpDocumentor conform
|
|
||||||
" documentation blocks for your PHP code. The script currently
|
|
||||||
" documents:
|
|
||||||
"
|
|
||||||
" - Classes
|
|
||||||
" - Methods/Functions
|
|
||||||
" - Attributes
|
|
||||||
"
|
|
||||||
" All of those supporting all PHP 4 and 5 syntax elements.
|
|
||||||
"
|
|
||||||
" Beside that it allows you to define default values for phpDocumentor tags
|
|
||||||
" like @version (I use $id$ here), @author, @license and so on.
|
|
||||||
"
|
|
||||||
" For function/method parameters and attributes, the script tries to guess the
|
|
||||||
" type as good as possible from PHP5 type hints or default values (array, bool,
|
|
||||||
" int, string...).
|
|
||||||
"
|
|
||||||
" You can use this script by mapping the function PhpDoc() to any
|
|
||||||
" key combination. Hit this on the line where the element to document
|
|
||||||
" resides and the doc block will be created directly above that line.
|
|
||||||
"
|
|
||||||
" Installation
|
|
||||||
" ============
|
|
||||||
"
|
|
||||||
" For example include into your .vimrc:
|
|
||||||
"
|
|
||||||
" source ~/.vim/php-doc.vim
|
|
||||||
" imap <C-o> :set paste<CR>:call PhpDoc()<CR>:set nopaste<CR>i
|
|
||||||
"
|
|
||||||
" This includes the script and maps the combination <ctrl>+o (only in
|
|
||||||
" insert mode) to the doc function.
|
|
||||||
"
|
|
||||||
" Changelog
|
|
||||||
" =========
|
|
||||||
"
|
|
||||||
" Version 1.0.0
|
|
||||||
" -------------
|
|
||||||
"
|
|
||||||
" * Created the initial version of this script while playing around with VIM
|
|
||||||
" scripting the first time and trying to fix Vidyut's solution, which
|
|
||||||
" resulted in a complete rewrite.
|
|
||||||
"
|
|
||||||
" Version 1.0.1
|
|
||||||
" -------------
|
|
||||||
" * Fixed issues when using tabs instead of spaces.
|
|
||||||
" * Fixed some parsing bugs when using a different coding style.
|
|
||||||
" * Fixed bug with call-by-reference parameters.
|
|
||||||
" * ATTENTION: This version already has code for the next version 1.1.0,
|
|
||||||
" which is propably not working!
|
|
||||||
"
|
|
||||||
" Version 1.1.0 (preview)
|
|
||||||
" -------------
|
|
||||||
" * Added foldmarker generation.
|
|
||||||
"
|
|
||||||
|
|
||||||
" Version 1.1.2
|
|
||||||
" -------------
|
|
||||||
" * Completed foldmarker commenting for functions
|
|
||||||
"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if has ("user_commands")
|
|
||||||
|
|
||||||
" {{{ Globals
|
|
||||||
|
|
||||||
" After phpDoc standard
|
|
||||||
let g:pdv_cfg_CommentHead = "/**"
|
|
||||||
let g:pdv_cfg_Comment1 = " * "
|
|
||||||
let g:pdv_cfg_Commentn = " * "
|
|
||||||
let g:pdv_cfg_CommentTail = " */"
|
|
||||||
let g:pdv_cfg_CommentEnd = "/* }}} */"
|
|
||||||
let g:pdv_cfg_CommentSingle = "//"
|
|
||||||
|
|
||||||
" Default values
|
|
||||||
let g:pdv_cfg_Type = "mixed"
|
|
||||||
" let g:pdv_cfg_Package = "Framework"
|
|
||||||
let g:pdv_cfg_Package = "Webdav"
|
|
||||||
let g:pdv_cfg_Version = "//autogen//"
|
|
||||||
let g:pdv_cfg_Author = ""
|
|
||||||
let g:pdv_cfg_Copyright = "Copyright (c) 2010 All rights reserved."
|
|
||||||
let g:pdv_cfg_License = "PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}"
|
|
||||||
|
|
||||||
let g:pdv_cfg_ReturnVal = "void"
|
|
||||||
|
|
||||||
" Whether to create @uses tags for implementation of interfaces and inheritance
|
|
||||||
let g:pdv_cfg_Uses = 1
|
|
||||||
|
|
||||||
" Options
|
|
||||||
" :set paste before documenting (1|0)? Recommended.
|
|
||||||
let g:pdv_cfg_paste = 1
|
|
||||||
|
|
||||||
" Whether for PHP5 code PHP4 tags should be set, like @access,... (1|0)?
|
|
||||||
let g:pdv_cfg_php4always = 1
|
|
||||||
|
|
||||||
" Whether to guess scopes after PEAR coding standards:
|
|
||||||
" $_foo/_bar() == <private|protected> (1|0)?
|
|
||||||
let g:pdv_cfg_php4guess = 1
|
|
||||||
|
|
||||||
" If you selected 1 for the last value, this scope identifier will be used for
|
|
||||||
" the identifiers having an _ in the first place.
|
|
||||||
let g:pdv_cfg_php4guessval = "protected"
|
|
||||||
|
|
||||||
"
|
|
||||||
" Regular expressions
|
|
||||||
"
|
|
||||||
|
|
||||||
let g:pdv_re_comment = ' *\*/ *'
|
|
||||||
|
|
||||||
" (private|protected|public)
|
|
||||||
let g:pdv_re_scope = '\(private\|protected\|public\)'
|
|
||||||
" (static)
|
|
||||||
let g:pdv_re_static = '\(static\)'
|
|
||||||
" (abstract)
|
|
||||||
let g:pdv_re_abstract = '\(abstract\)'
|
|
||||||
" (final)
|
|
||||||
let g:pdv_re_final = '\(final\)'
|
|
||||||
|
|
||||||
" [:space:]*(private|protected|public|static|abstract)*[:space:]+[:identifier:]+\([:params:]\)
|
|
||||||
let g:pdv_re_func = '^\s*\([a-zA-Z ]*\)function\s\+\([^ (]\+\)\s*(\s*\(.*\)\s*)\s*[{;]\?$'
|
|
||||||
let g:pdv_re_funcend = '^\s*}$'
|
|
||||||
" [:typehint:]*[:space:]*$[:identifier]\([:space:]*=[:space:]*[:value:]\)?
|
|
||||||
let g:pdv_re_param = ' *\([^ &]*\) *&\?\$\([A-Za-z_][A-Za-z0-9_]*\) *=\? *\(.*\)\?$'
|
|
||||||
|
|
||||||
" [:space:]*(private|protected|public\)[:space:]*$[:identifier:]+\([:space:]*=[:space:]*[:value:]+\)*;
|
|
||||||
let g:pdv_re_attribute = '^\s*\(\(private\|public\|protected\|var\|static\)\+\)\s*\$\([^ ;=]\+\)[ =]*\(.*\);\?$'
|
|
||||||
|
|
||||||
" [:spacce:]*(abstract|final|)[:space:]*(class|interface)+[:space:]+\(extends ([:identifier:])\)?[:space:]*\(implements ([:identifier:][, ]*)+\)?
|
|
||||||
let g:pdv_re_class = '^\s*\([a-zA-Z]*\)\s*\(interface\|class\)\s*\([^ ]\+\)\s*\(extends\)\?\s*\([a-zA-Z0-9]*\)\?\s*\(implements*\)\? *\([a-zA-Z0-9_ ,]*\)\?.*$'
|
|
||||||
|
|
||||||
let g:pdv_re_array = "^array *(.*"
|
|
||||||
let g:pdv_re_float = '^[0-9.]\+'
|
|
||||||
let g:pdv_re_int = '^[0-9]\+$'
|
|
||||||
let g:pdv_re_string = "['\"].*"
|
|
||||||
let g:pdv_re_bool = "[true false]"
|
|
||||||
|
|
||||||
let g:pdv_re_indent = '^\s*'
|
|
||||||
|
|
||||||
" Shortcuts for editing the text:
|
|
||||||
let g:pdv_cfg_BOL = "norm! o"
|
|
||||||
let g:pdv_cfg_EOL = ""
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" {{{ PhpDocSingle()
|
|
||||||
" Document a single line of code ( does not check if doc block already exists )
|
|
||||||
|
|
||||||
func! PhpDocSingle()
|
|
||||||
let l:endline = line(".") + 1
|
|
||||||
call PhpDoc()
|
|
||||||
exe "norm! " . l:endline . "G$"
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocRange()
|
|
||||||
" Documents a whole range of code lines ( does not add defualt doc block to
|
|
||||||
" unknown types of lines ). Skips elements where a docblock is already
|
|
||||||
" present.
|
|
||||||
func! PhpDocRange() range
|
|
||||||
let l:line = a:firstline
|
|
||||||
let l:endLine = a:lastline
|
|
||||||
let l:elementName = ""
|
|
||||||
while l:line <= l:endLine
|
|
||||||
" TODO: Replace regex check for existing doc with check more lines
|
|
||||||
" above...
|
|
||||||
if (getline(l:line) =~ g:pdv_re_func || getline(l:line) =~ g:pdv_re_attribute || getline(l:line) =~ g:pdv_re_class) && getline(l:line - 1) !~ g:pdv_re_comment
|
|
||||||
let l:docLines = 0
|
|
||||||
" Ensure we are on the correct line to run PhpDoc()
|
|
||||||
exe "norm! " . l:line . "G$"
|
|
||||||
" No matter what, this returns the element name
|
|
||||||
let l:elementName = PhpDoc()
|
|
||||||
let l:endLine = l:endLine + (line(".") - l:line) + 1
|
|
||||||
let l:line = line(".") + 1
|
|
||||||
endif
|
|
||||||
let l:line = l:line + 1
|
|
||||||
endwhile
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocFold()
|
|
||||||
|
|
||||||
" func! PhpDocFold(name)
|
|
||||||
" let l:startline = line(".")
|
|
||||||
" let l:currentLine = l:startLine
|
|
||||||
" let l:commentHead = escape(g:pdv_cfg_CommentHead, "*.");
|
|
||||||
" let l:txtBOL = g:pdv_cfg_BOL . matchstr(l:name, '^\s*')
|
|
||||||
" " Search above for comment start
|
|
||||||
" while (l:currentLine > 1)
|
|
||||||
" if (matchstr(l:commentHead, getline(l:currentLine)))
|
|
||||||
" break;
|
|
||||||
" endif
|
|
||||||
" let l:currentLine = l:currentLine + 1
|
|
||||||
" endwhile
|
|
||||||
" " Goto 1 line above and open a newline
|
|
||||||
" exe "norm! " . (l:currentLine - 1) . "Go\<ESC>"
|
|
||||||
" " Write the fold comment
|
|
||||||
" exe l:txtBOL . g:pdv_cfg_CommentSingle . " {"."{{ " . a:name . g:pdv_cfg_EOL
|
|
||||||
" " Add another newline below that
|
|
||||||
" exe "norm! o\<ESC>"
|
|
||||||
" " Search for our comment line
|
|
||||||
" let l:currentLine = line(".")
|
|
||||||
" while (l:currentLine <= line("$"))
|
|
||||||
" " HERE!!!!
|
|
||||||
" endwhile
|
|
||||||
"
|
|
||||||
"
|
|
||||||
" endfunc
|
|
||||||
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" {{{ PhpDoc()
|
|
||||||
|
|
||||||
func! PhpDoc()
|
|
||||||
" Needed for my .vimrc: Switch off all other enhancements while generating docs
|
|
||||||
let l:paste = &g:paste
|
|
||||||
let &g:paste = g:pdv_cfg_paste == 1 ? 1 : &g:paste
|
|
||||||
|
|
||||||
let l:line = getline(".")
|
|
||||||
let l:result = ""
|
|
||||||
|
|
||||||
if l:line =~ g:pdv_re_func
|
|
||||||
let l:result = PhpDocFunc()
|
|
||||||
|
|
||||||
elseif l:line =~ g:pdv_re_funcend
|
|
||||||
let l:result = PhpDocFuncEnd()
|
|
||||||
|
|
||||||
elseif l:line =~ g:pdv_re_attribute
|
|
||||||
let l:result = PhpDocVar()
|
|
||||||
|
|
||||||
elseif l:line =~ g:pdv_re_class
|
|
||||||
let l:result = PhpDocClass()
|
|
||||||
|
|
||||||
else
|
|
||||||
let l:result = PhpDocDefault()
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
" if g:pdv_cfg_folds == 1
|
|
||||||
" PhpDocFolds(l:result)
|
|
||||||
" endif
|
|
||||||
|
|
||||||
let &g:paste = l:paste
|
|
||||||
|
|
||||||
return l:result
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" {{{ PhpDocFuncEnd()
|
|
||||||
func! PhpDocFuncEnd()
|
|
||||||
|
|
||||||
call append(line('.'), matchstr(getline('.'), '^\s*') . g:pdv_cfg_CommentEnd)
|
|
||||||
endfunc
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocFuncEndAuto()
|
|
||||||
func! PhpDocFuncEndAuto()
|
|
||||||
|
|
||||||
|
|
||||||
call search('{')
|
|
||||||
call searchpair('{', '', '}')
|
|
||||||
call append(line('.'), matchstr(getline('.'), '^\s*') . g:pdv_cfg_CommentEnd)
|
|
||||||
|
|
||||||
endfunc
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" {{{ PhpDocFunc()
|
|
||||||
|
|
||||||
func! PhpDocFunc()
|
|
||||||
" Line for the comment to begin
|
|
||||||
let commentline = line (".") - 1
|
|
||||||
|
|
||||||
let l:name = substitute (getline ("."), '^\(.*\)\/\/.*$', '\1', "")
|
|
||||||
|
|
||||||
"exe g:pdv_cfg_BOL . "DEBUG:" . name. g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
" First some things to make it more easy for us:
|
|
||||||
" tab -> space && space+ -> space
|
|
||||||
" let l:name = substitute (l:name, '\t', ' ', "")
|
|
||||||
" Orphan. We're now using \s everywhere...
|
|
||||||
|
|
||||||
" Now we have to split DECL in three parts:
|
|
||||||
" \[(skopemodifier\)]\(funcname\)\(parameters\)
|
|
||||||
let l:indent = matchstr(l:name, g:pdv_re_indent)
|
|
||||||
|
|
||||||
let l:modifier = substitute (l:name, g:pdv_re_func, '\1', "g")
|
|
||||||
let l:funcname = substitute (l:name, g:pdv_re_func, '\2', "g")
|
|
||||||
let l:parameters = substitute (l:name, g:pdv_re_func, '\3', "g") . ","
|
|
||||||
let l:params = substitute (l:name, g:pdv_re_func, '\3', "g")
|
|
||||||
let l:sparams = substitute (l:params, '[$ ]', '', "g")
|
|
||||||
let l:scope = PhpDocScope(l:modifier, l:funcname)
|
|
||||||
let l:static = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_static) : ""
|
|
||||||
let l:abstract = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_abstract) : ""
|
|
||||||
let l:final = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_final) : ""
|
|
||||||
|
|
||||||
exe "norm! " . commentline . "G$"
|
|
||||||
|
|
||||||
" Local indent
|
|
||||||
let l:txtBOL = g:pdv_cfg_BOL . l:indent
|
|
||||||
|
|
||||||
exec l:txtBOL . "/* " . l:scope ." ". funcname . "(" . l:params . ") {{" . "{ */ " . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL
|
|
||||||
" added folding
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Comment1 . funcname . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
while (l:parameters != ",") && (l:parameters != "")
|
|
||||||
" Save 1st parameter
|
|
||||||
let _p = substitute (l:parameters, '\([^,]*\) *, *\(.*\)', '\1', "")
|
|
||||||
" Remove this one from list
|
|
||||||
let l:parameters = substitute (l:parameters, '\([^,]*\) *, *\(.*\)', '\2', "")
|
|
||||||
" PHP5 type hint?
|
|
||||||
let l:paramtype = substitute (_p, g:pdv_re_param, '\1', "")
|
|
||||||
" Parameter name
|
|
||||||
let l:paramname = substitute (_p, g:pdv_re_param, '\2', "")
|
|
||||||
" Parameter default
|
|
||||||
let l:paramdefault = substitute (_p, g:pdv_re_param, '\3', "")
|
|
||||||
|
|
||||||
if l:paramtype == ""
|
|
||||||
let l:paramtype = PhpDocType(l:paramdefault)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:paramtype != ""
|
|
||||||
let l:paramtype = " " . l:paramtype
|
|
||||||
endif
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@param" . l:paramtype . " $" . l:paramname . " " . g:pdv_cfg_EOL
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
if l:static != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@static" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
if l:abstract != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@abstract" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
if l:final != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@final" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
if l:scope != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@access " . l:scope . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@return " . g:pdv_cfg_ReturnVal . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
" Close the comment block.
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentTail . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
return l:modifier ." ". l:funcname . PhpDocFuncEndAuto()
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocVar()
|
|
||||||
|
|
||||||
func! PhpDocVar()
|
|
||||||
" Line for the comment to begin
|
|
||||||
let commentline = line (".") - 1
|
|
||||||
|
|
||||||
let l:name = substitute (getline ("."), '^\(.*\)\/\/.*$', '\1', "")
|
|
||||||
|
|
||||||
" Now we have to split DECL in three parts:
|
|
||||||
" \[(skopemodifier\)]\(funcname\)\(parameters\)
|
|
||||||
" let l:name = substitute (l:name, '\t', ' ', "")
|
|
||||||
" Orphan. We're now using \s everywhere...
|
|
||||||
|
|
||||||
let l:indent = matchstr(l:name, g:pdv_re_indent)
|
|
||||||
|
|
||||||
let l:modifier = substitute (l:name, g:pdv_re_attribute, '\1', "g")
|
|
||||||
let l:varname = substitute (l:name, g:pdv_re_attribute, '\3', "g")
|
|
||||||
let l:default = substitute (l:name, g:pdv_re_attribute, '\4', "g")
|
|
||||||
let l:scope = PhpDocScope(l:modifier, l:varname)
|
|
||||||
|
|
||||||
let l:static = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_static) : ""
|
|
||||||
|
|
||||||
let l:type = PhpDocType(l:default)
|
|
||||||
|
|
||||||
exe "norm! " . commentline . "G$"
|
|
||||||
|
|
||||||
" Local indent
|
|
||||||
let l:txtBOL = g:pdv_cfg_BOL . l:indent
|
|
||||||
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Comment1 . l:varname . " " . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . g:pdv_cfg_EOL
|
|
||||||
if l:static != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@static" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@var " . l:type . g:pdv_cfg_EOL
|
|
||||||
if l:scope != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@access " . l:scope . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Close the comment block.
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentTail . g:pdv_cfg_EOL
|
|
||||||
return l:modifier ." ". l:varname
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocClass()
|
|
||||||
|
|
||||||
func! PhpDocClass()
|
|
||||||
" Line for the comment to begin
|
|
||||||
let commentline = line (".") - 1
|
|
||||||
|
|
||||||
let l:name = substitute (getline ("."), '^\(.*\)\/\/.*$', '\1', "")
|
|
||||||
|
|
||||||
"exe g:pdv_cfg_BOL . "DEBUG:" . name. g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
" First some things to make it more easy for us:
|
|
||||||
" tab -> space && space+ -> space
|
|
||||||
" let l:name = substitute (l:name, '\t', ' ', "")
|
|
||||||
" Orphan. We're now using \s everywhere...
|
|
||||||
|
|
||||||
" Now we have to split DECL in three parts:
|
|
||||||
" \[(skopemodifier\)]\(classname\)\(parameters\)
|
|
||||||
let l:indent = matchstr(l:name, g:pdv_re_indent)
|
|
||||||
|
|
||||||
let l:modifier = substitute (l:name, g:pdv_re_class, '\1', "g")
|
|
||||||
let l:classname = substitute (l:name, g:pdv_re_class, '\3', "g")
|
|
||||||
let l:extends = g:pdv_cfg_Uses == 1 ? substitute (l:name, g:pdv_re_class, '\5', "g") : ""
|
|
||||||
let l:interfaces = g:pdv_cfg_Uses == 1 ? substitute (l:name, g:pdv_re_class, '\7', "g") . "," : ""
|
|
||||||
|
|
||||||
let l:abstract = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_abstract) : ""
|
|
||||||
let l:final = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_final) : ""
|
|
||||||
|
|
||||||
exe "norm! " . commentline . "G$"
|
|
||||||
|
|
||||||
" Local indent
|
|
||||||
let l:txtBOL = g:pdv_cfg_BOL . l:indent
|
|
||||||
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Comment1 . l:classname . " " . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . g:pdv_cfg_EOL
|
|
||||||
if l:extends != "" && l:extends != "implements"
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@uses " . l:extends . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
|
|
||||||
while (l:interfaces != ",") && (l:interfaces != "")
|
|
||||||
" Save 1st parameter
|
|
||||||
let interface = substitute (l:interfaces, '\([^, ]*\) *, *\(.*\)', '\1', "")
|
|
||||||
" Remove this one from list
|
|
||||||
let l:interfaces = substitute (l:interfaces, '\([^, ]*\) *, *\(.*\)', '\2', "")
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@uses " . l:interface . g:pdv_cfg_EOL
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
if l:abstract != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@abstract" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
if l:final != ""
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@final" . g:pdv_cfg_EOL
|
|
||||||
endif
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@package " . g:pdv_cfg_Package . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@version " . g:pdv_cfg_Version . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@copyright " . g:pdv_cfg_Copyright . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@author " . g:pdv_cfg_Author g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . "@license " . g:pdv_cfg_License . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
" Close the comment block.
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentTail . g:pdv_cfg_EOL
|
|
||||||
return l:modifier ." ". l:classname
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocScope()
|
|
||||||
|
|
||||||
func! PhpDocScope(modifiers, identifier)
|
|
||||||
" exe g:pdv_cfg_BOL . DEBUG: . a:modifiers . g:pdv_cfg_EOL
|
|
||||||
let l:scope = ""
|
|
||||||
if matchstr (a:modifiers, g:pdv_re_scope) != ""
|
|
||||||
if g:pdv_cfg_php4always == 1
|
|
||||||
let l:scope = matchstr (a:modifiers, g:pdv_re_scope)
|
|
||||||
else
|
|
||||||
let l:scope = "x"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if l:scope =~ "^\s*$" && g:pdv_cfg_php4guess
|
|
||||||
if a:identifier[0] == "_"
|
|
||||||
let l:scope = g:pdv_cfg_php4guessval
|
|
||||||
else
|
|
||||||
let l:scope = "public"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return l:scope != "x" ? l:scope : ""
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocType()
|
|
||||||
|
|
||||||
func! PhpDocType(typeString)
|
|
||||||
let l:type = ""
|
|
||||||
if a:typeString =~ g:pdv_re_array
|
|
||||||
let l:type = "array"
|
|
||||||
endif
|
|
||||||
if a:typeString =~ g:pdv_re_float
|
|
||||||
let l:type = "float"
|
|
||||||
endif
|
|
||||||
if a:typeString =~ g:pdv_re_int
|
|
||||||
let l:type = "int"
|
|
||||||
endif
|
|
||||||
if a:typeString =~ g:pdv_re_string
|
|
||||||
let l:type = "string"
|
|
||||||
endif
|
|
||||||
if a:typeString =~ g:pdv_re_bool
|
|
||||||
let l:type = "bool"
|
|
||||||
endif
|
|
||||||
if l:type == ""
|
|
||||||
let l:type = g:pdv_cfg_Type
|
|
||||||
endif
|
|
||||||
return l:type
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
" {{{ PhpDocDefault()
|
|
||||||
|
|
||||||
func! PhpDocDefault()
|
|
||||||
" Line for the comment to begin
|
|
||||||
let commentline = line (".") - 1
|
|
||||||
|
|
||||||
let l:indent = matchstr(getline("."), '^\ *')
|
|
||||||
|
|
||||||
exe "norm! " . commentline . "G$"
|
|
||||||
|
|
||||||
" Local indent
|
|
||||||
let l:txtBOL = g:pdv_cfg_BOL . indent
|
|
||||||
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL
|
|
||||||
exe l:txtBOL . g:pdv_cfg_Commentn . " " . g:pdv_cfg_EOL
|
|
||||||
|
|
||||||
" Close the comment block.
|
|
||||||
exe l:txtBOL . g:pdv_cfg_CommentTail . g:pdv_cfg_EOL
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
endif " user_commands
|
|
||||||
@@ -45,6 +45,8 @@ endif
|
|||||||
|
|
||||||
setlocal comments= commentstring=//\ %s
|
setlocal comments= commentstring=//\ %s
|
||||||
|
|
||||||
|
setlocal suffixesadd=.styl
|
||||||
|
|
||||||
" Add '-' and '#' to the what makes up a keyword.
|
" Add '-' and '#' to the what makes up a keyword.
|
||||||
" This means that 'e' and 'w' work properly now, for properties
|
" This means that 'e' and 'w' work properly now, for properties
|
||||||
" and valid variable names.
|
" and valid variable names.
|
||||||
|
|||||||
70
indent/jade.vim
Normal file
70
indent/jade.vim
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: Jade
|
||||||
|
" Maintainer: Joshua Borton
|
||||||
|
" Credits: Tim Pope (vim-jade)
|
||||||
|
" Last Change: 2010 Sep 22
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
unlet! b:did_indent
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal autoindent
|
||||||
|
setlocal indentexpr=GetJadeIndent()
|
||||||
|
setlocal indentkeys=o,O,*<Return>,},],0),!^F
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetJadeIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:attributes = '\%((.\{-\})\)'
|
||||||
|
let s:tag = '\([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*'
|
||||||
|
|
||||||
|
if !exists('g:jade_self_closing_tags')
|
||||||
|
let g:jade_self_closing_tags = 'meta|link|img|hr|br|input'
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal formatoptions+=r
|
||||||
|
setlocal comments+=n:\|
|
||||||
|
|
||||||
|
function! GetJadeIndent()
|
||||||
|
let lnum = prevnonblank(v:lnum-1)
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
let line = substitute(getline(lnum),'\s\+$','','')
|
||||||
|
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
|
||||||
|
let lastcol = strlen(line)
|
||||||
|
let line = substitute(line,'^\s\+','','')
|
||||||
|
let indent = indent(lnum)
|
||||||
|
let cindent = indent(v:lnum)
|
||||||
|
let increase = indent + &sw
|
||||||
|
if indent == indent(lnum)
|
||||||
|
let indent = cindent <= indent ? -1 : increase
|
||||||
|
endif
|
||||||
|
|
||||||
|
let group = synIDattr(synID(lnum,lastcol,1),'name')
|
||||||
|
|
||||||
|
if line =~ '^!!!'
|
||||||
|
return indent
|
||||||
|
elseif line =~ '^/\%(\[[^]]*\]\)\=$'
|
||||||
|
return increase
|
||||||
|
elseif line =~ '^\%(if\|else\|unless\|for\|each\|block\|mixin\|append\|case\|when\)'
|
||||||
|
return increase
|
||||||
|
elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$'
|
||||||
|
return increase
|
||||||
|
elseif line == '-#'
|
||||||
|
return increase
|
||||||
|
elseif line =~? '^\v%('.g:jade_self_closing_tags.')>'
|
||||||
|
return indent
|
||||||
|
elseif group =~? '\v^%(jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName|jadeFilter)$'
|
||||||
|
return increase
|
||||||
|
else
|
||||||
|
return indent
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim:set sw=2:
|
||||||
1269
indent/php.vim
1269
indent/php.vim
File diff suppressed because it is too large
Load Diff
8
spec/build_spec.rb
Normal file
8
spec/build_spec.rb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
$plugin_path = File.expand_path('../..', __FILE__)
|
||||||
|
|
||||||
|
describe 'build script' do
|
||||||
|
it 'should run and return success code' do
|
||||||
|
Dir.chdir($plugin_path)
|
||||||
|
expect(system('bash ./build')).to be_true
|
||||||
|
end
|
||||||
|
end
|
||||||
14
spec/loading_spec.rb
Normal file
14
spec/loading_spec.rb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "My Vim plugin" do
|
||||||
|
languages = Dir["#{$plugin_path}/syntax/*.vim"].map { |f| f.split('/').last.gsub('.vim', '') }
|
||||||
|
|
||||||
|
languages.each do |lang|
|
||||||
|
it "should parse .#{lang} file" do
|
||||||
|
write_file "test.#{lang}", ""
|
||||||
|
vim.edit "test.#{lang}"
|
||||||
|
vim.insert "sample"
|
||||||
|
vim.write
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
22
spec/spec_helper.rb
Executable file
22
spec/spec_helper.rb
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
require 'vimrunner'
|
||||||
|
require 'vimrunner/rspec'
|
||||||
|
|
||||||
|
$plugin_path = File.expand_path('../..', __FILE__)
|
||||||
|
|
||||||
|
Vimrunner::RSpec.configure do |config|
|
||||||
|
# Use a single Vim instance for the test suite. Set to false to use an
|
||||||
|
# instance per test (slower, but can be easier to manage).
|
||||||
|
config.reuse_server = true
|
||||||
|
|
||||||
|
# Decide how to start a Vim instance. In this block, an instance should be
|
||||||
|
# spawned and set up with anything project-specific.
|
||||||
|
config.start_vim do
|
||||||
|
vim = Vimrunner.start
|
||||||
|
|
||||||
|
# Setup your plugin in the Vim instance
|
||||||
|
vim.add_plugin($plugin_path)
|
||||||
|
|
||||||
|
# The returned value is the Client available in the tests.
|
||||||
|
vim
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: Jinja HTML template
|
|
||||||
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
|
||||||
" Last Change: 2007 Apr 8
|
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("main_syntax")
|
|
||||||
let main_syntax = 'html'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if version < 600
|
|
||||||
so <sfile>:p:h/jinja.vim
|
|
||||||
so <sfile>:p:h/html.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/jinja.vim
|
|
||||||
runtime! syntax/html.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "htmljinja"
|
|
||||||
89
syntax/jade.vim
Normal file
89
syntax/jade.vim
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Jade
|
||||||
|
" Maintainer: Joshua Borton
|
||||||
|
" Credits: Tim Pope
|
||||||
|
" Filenames: *.jade
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
let main_syntax = 'jade'
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! syntax/html.vim
|
||||||
|
runtime! syntax/html/html5.vim
|
||||||
|
silent! syntax include @htmlCoffeescript syntax/coffee.vim
|
||||||
|
unlet! b:current_syntax
|
||||||
|
silent! syntax include @htmlStylus syntax/stylus.vim
|
||||||
|
unlet! b:current_syntax
|
||||||
|
silent! syntax include @htmlMarkdown syntax/markdown.vim
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
syn region javascriptParenthesisBlock start="(" end=")" contains=@htmlJavascript contained keepend
|
||||||
|
syn cluster htmlJavascript add=javascriptParenthesisBlock
|
||||||
|
|
||||||
|
syn region jadeJavascript matchgroup=jadeJavascriptOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
|
||||||
|
syn region jadeJavascript matchgroup=jadeJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
|
||||||
|
syn cluster jadeTop contains=jadeBegin,jadeComment,jadeHtmlComment,jadeJavascript
|
||||||
|
syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassChar,jadeIdChar,jadePlainChar,jadeJavascript,jadeScriptConditional,jadeScriptStatement
|
||||||
|
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
||||||
|
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript
|
||||||
|
syn match jadeComment '\s*\/\/.*$'
|
||||||
|
syn region jadeHtmlComment start="^\z(\s*\)/" end="^\%(\z1\s\|\s*$\)\@!"
|
||||||
|
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
||||||
|
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
||||||
|
syn match jadeBlockExpansionChar ":\s" contained nextgroup=jadeTag
|
||||||
|
syn match jadeIdChar "#{\@!" contained nextgroup=jadeId
|
||||||
|
syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
|
||||||
|
syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
|
||||||
|
syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$"
|
||||||
|
" Unless I'm mistaken, syntax/html.vim requires
|
||||||
|
" that the = sign be present for these matches.
|
||||||
|
" This adds the matches back for jade.
|
||||||
|
syn keyword jadeHtmlArg contained href title
|
||||||
|
|
||||||
|
syn match jadePlainChar "\\" contained
|
||||||
|
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript
|
||||||
|
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
||||||
|
|
||||||
|
syn region jadeJavascriptFilter matchgroup=jadeFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript
|
||||||
|
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript
|
||||||
|
syn region jadeMarkdownFilter matchgroup=jadeFilter start=/^\z(\s*\):markdown\s*$/ end=/^\%(\z1\s\|\s*$\)\@!/ contains=@htmlMarkdown
|
||||||
|
syn region jadeStylusFilter matchgroup=jadeFilter start="^\z(\s*\):stylus\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlStylus
|
||||||
|
syn region jadePlainFilter matchgroup=jadeFilter start="^\z(\s*\):\%(sass\|less\|cdata\)\s*$" end="^\%(\z1\s\|\s*$\)\@!"
|
||||||
|
|
||||||
|
syn match jadeScriptConditional "\<\%(if\|else\|unless\|while\|for\|until\|case\|when\|default\)\>[?!]\@!"
|
||||||
|
syn match jadeScriptStatement "\<\%(each\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
|
||||||
|
|
||||||
|
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend
|
||||||
|
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
|
||||||
|
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@jadeTop,@htmlCss keepend
|
||||||
|
|
||||||
|
syn match jadeError "\$" contained
|
||||||
|
|
||||||
|
hi def link jadePlainChar Special
|
||||||
|
hi def link jadeScriptConditional PreProc
|
||||||
|
hi def link jadeScriptStatement PreProc
|
||||||
|
hi def link jadeHtmlArg htmlArg
|
||||||
|
hi def link jadeAttributeString String
|
||||||
|
hi def link jadeAttributesDelimiter Identifier
|
||||||
|
hi def link jadeIdChar Special
|
||||||
|
hi def link jadeClassChar Special
|
||||||
|
hi def link jadeBlockExpansionChar Special
|
||||||
|
hi def link jadeId Identifier
|
||||||
|
hi def link jadeClass Type
|
||||||
|
hi def link jadeInterpolationDelimiter Delimiter
|
||||||
|
hi def link jadeFilter PreProc
|
||||||
|
hi def link jadeDocType PreProc
|
||||||
|
hi def link jadeComment Comment
|
||||||
|
hi def link jadeHtmlComment jadeComment
|
||||||
|
|
||||||
|
let b:current_syntax = "jade"
|
||||||
|
|
||||||
|
if main_syntax == "jade"
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
113
syntax/jinja.vim
113
syntax/jinja.vim
@@ -1,113 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: Jinja template
|
|
||||||
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
|
||||||
" Last Change: 2008 May 9
|
|
||||||
" Version: 1.1
|
|
||||||
"
|
|
||||||
" Known Bugs:
|
|
||||||
" because of odd limitations dicts and the modulo operator
|
|
||||||
" appear wrong in the template.
|
|
||||||
"
|
|
||||||
" Changes:
|
|
||||||
"
|
|
||||||
" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
|
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
syntax case match
|
|
||||||
|
|
||||||
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
|
|
||||||
" have special threatment)
|
|
||||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
|
|
||||||
|
|
||||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
|
|
||||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
|
|
||||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
|
|
||||||
|
|
||||||
" Variable Names
|
|
||||||
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
|
|
||||||
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none loop super caller varargs kwargs
|
|
||||||
|
|
||||||
" Filters
|
|
||||||
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained nextgroup=jinjaFilter
|
|
||||||
syn match jinjaFilter contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
|
|
||||||
syn match jinjaFunction contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
|
|
||||||
syn match jinjaBlockName contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
|
|
||||||
|
|
||||||
" Jinja template constants
|
|
||||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\\"/ end=/"/
|
|
||||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\\'/ end=/'/
|
|
||||||
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
|
|
||||||
|
|
||||||
" Operators
|
|
||||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
|
|
||||||
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
|
|
||||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
|
|
||||||
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
|
||||||
|
|
||||||
" Jinja template tag and variable blocks
|
|
||||||
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
|
||||||
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
|
||||||
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
|
||||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ skipwhite containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
|
||||||
|
|
||||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
|
||||||
|
|
||||||
" Jinja template 'raw' tag
|
|
||||||
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
|
|
||||||
|
|
||||||
" Jinja comments
|
|
||||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
|
|
||||||
|
|
||||||
" Block start keywords. A bit tricker. We only highlight at the start of a
|
|
||||||
" tag block and only if the name is not followed by a comma or equals sign
|
|
||||||
" which usually means that we have to deal with an assignment.
|
|
||||||
syn match jinjaStatement containedin=jinjaTagBlock contained skipwhite /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
|
|
||||||
|
|
||||||
" and context modifiers
|
|
||||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/ skipwhite
|
|
||||||
|
|
||||||
|
|
||||||
" 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_jinja_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_jinja_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink jinjaPunctuation jinjaOperator
|
|
||||||
HiLink jinjaAttribute jinjaVariable
|
|
||||||
HiLink jinjaFunction jinjaFilter
|
|
||||||
|
|
||||||
HiLink jinjaTagDelim jinjaTagBlock
|
|
||||||
HiLink jinjaVarDelim jinjaVarBlock
|
|
||||||
HiLink jinjaCommentDelim jinjaComment
|
|
||||||
HiLink jinjaRawDelim jinja
|
|
||||||
|
|
||||||
HiLink jinjaSpecial Special
|
|
||||||
HiLink jinjaOperator Normal
|
|
||||||
HiLink jinjaRaw Normal
|
|
||||||
HiLink jinjaTagBlock PreProc
|
|
||||||
HiLink jinjaVarBlock PreProc
|
|
||||||
HiLink jinjaStatement Statement
|
|
||||||
HiLink jinjaFilter Function
|
|
||||||
HiLink jinjaBlockName Function
|
|
||||||
HiLink jinjaVariable Identifier
|
|
||||||
HiLink jinjaString Constant
|
|
||||||
HiLink jinjaNumber Constant
|
|
||||||
HiLink jinjaComment Comment
|
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "jinja"
|
|
||||||
284
syntax/php.vim
284
syntax/php.vim
File diff suppressed because one or more lines are too long
106
syntax/proto.vim
Normal file
106
syntax/proto.vim
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
" Protocol Buffers - Google's data interchange format
|
||||||
|
" Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
" http://code.google.com/p/protobuf/
|
||||||
|
"
|
||||||
|
" Redistribution and use in source and binary forms, with or without
|
||||||
|
" modification, are permitted provided that the following conditions are
|
||||||
|
" met:
|
||||||
|
"
|
||||||
|
" * Redistributions of source code must retain the above copyright
|
||||||
|
" notice, this list of conditions and the following disclaimer.
|
||||||
|
" * Redistributions in binary form must reproduce the above
|
||||||
|
" copyright notice, this list of conditions and the following disclaimer
|
||||||
|
" in the documentation and/or other materials provided with the
|
||||||
|
" distribution.
|
||||||
|
" * Neither the name of Google Inc. nor the names of its
|
||||||
|
" contributors may be used to endorse or promote products derived from
|
||||||
|
" this software without specific prior written permission.
|
||||||
|
"
|
||||||
|
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
" This is the Vim syntax file for Google Protocol Buffers.
|
||||||
|
"
|
||||||
|
" Usage:
|
||||||
|
"
|
||||||
|
" 1. cp proto.vim ~/.vim/syntax/
|
||||||
|
" 2. Add the following to ~/.vimrc:
|
||||||
|
"
|
||||||
|
" augroup filetype
|
||||||
|
" au! BufRead,BufNewFile *.proto setfiletype proto
|
||||||
|
" augroup end
|
||||||
|
"
|
||||||
|
" Or just create a new file called ~/.vim/ftdetect/proto.vim with the
|
||||||
|
" previous lines on it.
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
syn keyword pbTodo contained TODO FIXME XXX
|
||||||
|
syn cluster pbCommentGrp contains=pbTodo
|
||||||
|
|
||||||
|
syn keyword pbSyntax syntax import option
|
||||||
|
syn keyword pbStructure package message group
|
||||||
|
syn keyword pbRepeat optional required repeated
|
||||||
|
syn keyword pbDefault default
|
||||||
|
syn keyword pbExtend extend extensions to max
|
||||||
|
syn keyword pbRPC service rpc returns
|
||||||
|
|
||||||
|
syn keyword pbType int32 int64 uint32 uint64 sint32 sint64
|
||||||
|
syn keyword pbType fixed32 fixed64 sfixed32 sfixed64
|
||||||
|
syn keyword pbType float double bool string bytes
|
||||||
|
syn keyword pbTypedef enum
|
||||||
|
syn keyword pbBool true false
|
||||||
|
|
||||||
|
syn match pbInt /-\?\<\d\+\>/
|
||||||
|
syn match pbInt /\<0[xX]\x+\>/
|
||||||
|
syn match pbFloat /\<-\?\d*\(\.\d*\)\?/
|
||||||
|
" TODO: .proto also supports C-style block comments;
|
||||||
|
" see /usr/share/vim/vim70/syntax/c.vim for how it's done.
|
||||||
|
syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp
|
||||||
|
syn region pbString start=/"/ skip=/\\"/ end=/"/
|
||||||
|
syn region pbString start=/'/ skip=/\\'/ end=/'/
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_proto_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_proto_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink pbTodo Todo
|
||||||
|
|
||||||
|
HiLink pbSyntax Include
|
||||||
|
HiLink pbStructure Structure
|
||||||
|
HiLink pbRepeat Repeat
|
||||||
|
HiLink pbDefault Keyword
|
||||||
|
HiLink pbExtend Keyword
|
||||||
|
HiLink pbRPC Keyword
|
||||||
|
HiLink pbType Type
|
||||||
|
HiLink pbTypedef Typedef
|
||||||
|
HiLink pbBool Boolean
|
||||||
|
|
||||||
|
HiLink pbInt Number
|
||||||
|
HiLink pbFloat Float
|
||||||
|
HiLink pbComment Comment
|
||||||
|
HiLink pbString String
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "proto"
|
||||||
Reference in New Issue
Block a user