summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-03-04 10:57:25 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2019-03-04 10:57:25 +0100
commit1ba88cc7d8abdd934bd67407d9127ba38568ccf6 (patch)
tree6379ee4d976433ab1fdc8b672ebcfd8dd9477dfa
parentca2fbfe03891afcad18477d8b7da25e1e139cd30 (diff)
downloadvim-polyglot-1ba88cc7d8abdd934bd67407d9127ba38568ccf6.tar.gz
vim-polyglot-1ba88cc7d8abdd934bd67407d9127ba38568ccf6.zip
Add gradle compiler support, closes #358
-rw-r--r--README.md3
-rwxr-xr-xbuild1
-rw-r--r--compiler/gradle.vim28
-rw-r--r--compiler/gradlew.vim28
-rw-r--r--ftdetect/polyglot.vim8
5 files changed, 67 insertions, 1 deletions
diff --git a/README.md b/README.md
index 07a5495d..2d30b105 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ 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.
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
-- It **installs and updates 100+ times faster** than the <!--Package Count-->126<!--/Package Count--> packages it consists of.
+- It **installs and updates 100+ times faster** than the <!--Package Count-->127<!--/Package Count--> packages it consists of.
- Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support).
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
@@ -79,6 +79,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent)
+- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, ftplugin)
- [groovy-indent](https://github.com/vim-scripts/groovyindent-unix) (indent)
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
diff --git a/build b/build
index 9b55a019..387dd2e3 100755
--- a/build
+++ b/build
@@ -187,6 +187,7 @@ PACKS="
gmpl:maelvalais/gmpl.vim
gnuplot:vim-scripts/gnuplot-syntax-highlighting
go:fatih/vim-go:_BASIC
+ gradle:tfnico/vim-gradle
graphql:jparise/vim-graphql
groovy:vim-scripts/groovy.vim
groovy-indent:vim-scripts/groovyindent-unix
diff --git a/compiler/gradle.vim b/compiler/gradle.vim
new file mode 100644
index 00000000..4d867c8a
--- /dev/null
+++ b/compiler/gradle.vim
@@ -0,0 +1,28 @@
+if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'gradle') != -1
+ finish
+endif
+
+" Vim Compiler File
+" Compiler: gradle
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "gradle"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=gradle
+
+CompilerSet errorformat=
+ \%E[ant:scalac]\ %f:%l:\ error:\ %m,
+ \%W[ant:scalac]\ %f:%l:\ warning:\ %m,
+ \%E%.%#:compile%\\w%#Java%f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,
+ \%W%.%#:compile%\\w%#Java%f:%l:\ warning:\ %m,%-Z%p^,%-C%.%#,
+ \%E%f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,
+ \%W%f:%l:\ warning:\ %m,%-Z%p^,%-C%.%#,
+ \%E%f:\ %\\d%\\+:\ %m\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
+ \%E%>%f:\ %\\d%\\+:\ %m,%C\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
+ \%-G%.%#
diff --git a/compiler/gradlew.vim b/compiler/gradlew.vim
new file mode 100644
index 00000000..aeb73eaa
--- /dev/null
+++ b/compiler/gradlew.vim
@@ -0,0 +1,28 @@
+if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'gradle') != -1
+ finish
+endif
+
+" Vim Compiler File
+" Compiler: gradlew
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "gradlew"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=./gradlew
+
+CompilerSet errorformat=
+ \%E[ant:scalac]\ %f:%l:\ error:\ %m,
+ \%W[ant:scalac]\ %f:%l:\ warning:\ %m,
+ \%E%.%#:compile%\\w%#Java%f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,
+ \%W%.%#:compile%\\w%#Java%f:%l:\ warning:\ %m,%-Z%p^,%-C%.%#,
+ \%E%f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,
+ \%W%f:%l:\ warning:\ %m,%-Z%p^,%-C%.%#,
+ \%E%f:\ %\\d%\\+:\ %m\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
+ \%E%>%f:\ %\\d%\\+:\ %m,%C\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
+ \%-G%.%#
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 5dc3b474..3316c3b7 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -427,6 +427,14 @@ unlet s:cpo_save
augroup end
endif
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gradle') == -1
+ augroup filetypedetect
+ " gradle, from gradle.vim in tfnico/vim-gradle
+" gradle syntax highlighting
+au BufNewFile,BufRead *.gradle set filetype=groovy
+ augroup end
+endif
+
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
augroup filetypedetect
" graphql, from graphql.vim in jparise/vim-graphql