mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fabb550c17 | ||
|
|
9d9ed14485 | ||
|
|
5005f1e27a | ||
|
|
571f76e6b6 | ||
|
|
e4f906d9a5 | ||
|
|
8b3a563bd0 | ||
|
|
0475f2b8d1 | ||
|
|
1d9a032a66 | ||
|
|
86721731c7 |
@@ -1,6 +1,6 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- 2.6
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
|
||||
@@ -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-->128<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 100+ times faster** than the <!--Package Count-->132<!--/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`).
|
||||
@@ -43,6 +43,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
## Language packs
|
||||
|
||||
<!--Language Packs-->
|
||||
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl) (syntax)
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin)
|
||||
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax)
|
||||
- [applescript](https://github.com/mityu/vim-applescript) (syntax, indent)
|
||||
@@ -57,10 +58,11 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin)
|
||||
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (syntax, indent)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, compiler, indent, autoload, ftplugin)
|
||||
- [cql](https://github.com/elubow/cql-vim) (syntax)
|
||||
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin)
|
||||
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin)
|
||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, autoload, ftplugin)
|
||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
|
||||
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax)
|
||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin)
|
||||
@@ -103,6 +105,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin)
|
||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||
@@ -148,6 +151,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin)
|
||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'coffee-script') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Mick Koch <mick@kochm.co>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
" License: WTFPL
|
||||
|
||||
" Load the coffee and html indent functions.
|
||||
silent! unlet b:did_indent
|
||||
runtime indent/coffee.vim
|
||||
let s:coffeeIndentExpr = &l:indentexpr
|
||||
|
||||
" Load html last so it can overwrite coffee settings.
|
||||
silent! unlet b:did_indent
|
||||
runtime indent/html.vim
|
||||
let s:htmlIndentExpr = &l:indentexpr
|
||||
|
||||
" Inject our wrapper indent function.
|
||||
setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum)
|
||||
|
||||
function! GetCoffeeHtmlIndent(curlinenum)
|
||||
" See if we're inside a coffeescript block.
|
||||
let scriptlnum = searchpair('<script [^>]*type=[''"]\?text/coffeescript[''"]\?[^>]*>', '',
|
||||
\ '</script>', 'bWn')
|
||||
let prevlnum = prevnonblank(a:curlinenum)
|
||||
|
||||
" If we're in the script block and the previous line isn't the script tag
|
||||
" itself, use coffee indenting.
|
||||
if scriptlnum && scriptlnum != prevlnum
|
||||
exec 'return ' s:coffeeIndentExpr
|
||||
endif
|
||||
|
||||
" Otherwise use html indenting.
|
||||
exec 'return ' s:htmlIndentExpr
|
||||
endfunction
|
||||
@@ -1,27 +0,0 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'coffee-script') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Sven Felix Oberquelle <Svelix.Github@gmail.com>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
" License: WTFPL
|
||||
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax_save = b:current_syntax
|
||||
endif
|
||||
|
||||
" Inherit coffee from html so coffeeComment isn't redefined and given higher
|
||||
" priority than hamlInterpolation.
|
||||
syn cluster hamlCoffeescript contains=@htmlCoffeeScript
|
||||
syn region hamlCoffeescriptFilter matchgroup=hamlFilter
|
||||
\ start="^\z(\s*\):coffee\z(script\)\?\s*$"
|
||||
\ end="^\%(\z1 \| *$\)\@!"
|
||||
\ contains=@hamlCoffeeScript,hamlInterpolation
|
||||
\ keepend
|
||||
|
||||
if exists('s:current_syntax_save')
|
||||
let b:current_syntax = s:current_syntax_save
|
||||
unlet s:current_syntax_save
|
||||
endif
|
||||
@@ -1,40 +1,3 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'coffee-script') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Mick Koch <mick@kochm.co>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
" License: WTFPL
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax_save = b:current_syntax
|
||||
endif
|
||||
|
||||
" Syntax highlighting for text/coffeescript script tags
|
||||
syn include @htmlCoffeeScript syntax/coffee.vim
|
||||
syn region coffeeScript start=#<script [^>]*type=['"]\?text/coffeescript['"]\?[^>]*>#
|
||||
\ end=#</script>#me=s-1 keepend
|
||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||
\ containedin=htmlHead
|
||||
|
||||
if exists('s:current_syntax_save')
|
||||
let b:current_syntax = s:current_syntax_save
|
||||
unlet s:current_syntax_save
|
||||
endif
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'glsl') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: OpenGL Shading Language
|
||||
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||
|
||||
syn include @GLSL syntax/glsl.vim
|
||||
syn region ShaderScript
|
||||
\ start="<script [^>]*type=\('\|\"\)x-shader/x-\(vertex\|fragment\)\('\|\"\)[^>]*>"
|
||||
\ keepend
|
||||
\ end="</script>"me=s-1
|
||||
\ contains=@GLSL,htmlScriptTag,@htmlPreproc
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
|
||||
finish
|
||||
endif
|
||||
@@ -51,33 +14,3 @@ endif
|
||||
" https://github.com/w3c/html/issues/694
|
||||
syntax region htmlComment start=+<!--+ end=+-->+ contains=@Spell
|
||||
syntax region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'less') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("g:less_html_style_tags")
|
||||
let g:less_html_style_tags = 1
|
||||
endif
|
||||
|
||||
if !g:less_html_style_tags
|
||||
finish
|
||||
endif
|
||||
|
||||
" Unset (but preserve) so that less will run.
|
||||
if exists("b:current_syntax")
|
||||
let s:pre_less_cur_syn = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
" Inspired by code from github.com/kchmck/vim-coffee-script
|
||||
" and the html syntax file included with vim 7.4.
|
||||
|
||||
syn include @htmlLess syntax/less.vim
|
||||
|
||||
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
|
||||
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
|
||||
|
||||
" Reset since 'less' isn't really the current_syntax.
|
||||
if exists("s:pre_less_cur_syn")
|
||||
let b:current_syntax = s:pre_less_cur_syn
|
||||
endif
|
||||
|
||||
3191
autoload/csv.vim
Normal file
3191
autoload/csv.vim
Normal file
File diff suppressed because it is too large
Load Diff
34
autoload/smt2.vim
Normal file
34
autoload/smt2.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Invokes the solver on current file
|
||||
function! smt2#RunSolver()
|
||||
silent !clear
|
||||
execute "!" . g:smt2_solver_command . " " . bufname("%")
|
||||
endfunction
|
||||
|
||||
" Puts the solver's output in new split (replaces old split)
|
||||
function! smt2#RunSolverAndShowResult()
|
||||
let output = system(g:smt2_solver_command . " " . bufname("%") . " 2>&1")
|
||||
|
||||
" Create split (or reuse existent)
|
||||
if exists("s:outputbufnr") && bufwinnr(s:outputbufnr) > 0
|
||||
execute bufwinnr(s:outputbufnr) . 'wincmd w'
|
||||
else
|
||||
silent! vnew
|
||||
let s:outputbufnr=bufnr('%')
|
||||
endif
|
||||
|
||||
" Clear & (re-)fill contents
|
||||
silent! normal! ggdG
|
||||
setlocal filetype=smt2 buftype=nofile nobuflisted noswapfile
|
||||
call append(0, split(output, '\v\n'))
|
||||
normal! gg
|
||||
endfunction
|
||||
|
||||
" Requests the solver's version
|
||||
function! smt2#PrintSolverVersion()
|
||||
silent !clear
|
||||
execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch
|
||||
endfunction
|
||||
12
build
12
build
@@ -9,6 +9,8 @@ DIRS_BASIC="syntax compiler indent after/syntax after/indent"
|
||||
DIRS_ALL="syntax indent compiler autoload ftplugin after"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_SYNTAX="syntax indent after/syntax after/indent"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_NOAFTER="syntax compiler indent autoload ftplugin"
|
||||
DIRS_JAVASCRIPT="${DIRS} extras"
|
||||
read -r -a DIRS_RM <<<"$DIRS_JAVASCRIPT"
|
||||
|
||||
@@ -151,6 +153,7 @@ update_readme() {
|
||||
}
|
||||
|
||||
PACKS="
|
||||
acpiasl:martinlroth/vim-acpi-asl
|
||||
ansible:pearofducks/ansible-vim
|
||||
apiblueprint:sheerun/apiblueprint.vim
|
||||
applescript:mityu/vim-applescript:_SYNTAX
|
||||
@@ -165,10 +168,11 @@ PACKS="
|
||||
cjsx:mtscout6/vim-cjsx
|
||||
clojure:guns/vim-clojure-static
|
||||
cmake:pboettch/vim-cmake-syntax
|
||||
coffee-script:kchmck/vim-coffee-script
|
||||
coffee-script:kchmck/vim-coffee-script:_NOAFTER
|
||||
cql:elubow/cql-vim
|
||||
cryptol:victoredwardocallaghan/cryptol.vim
|
||||
crystal:rhysd/vim-crystal
|
||||
csv:chrisbra/csv.vim
|
||||
cucumber:tpope/vim-cucumber
|
||||
cue:mgrabovsky/vim-cuesheet
|
||||
dart:dart-lang/dart-vim-plugin
|
||||
@@ -183,7 +187,7 @@ PACKS="
|
||||
flatbuffers:dcharbon/vim-flatbuffers
|
||||
fsharp:fsharp/vim-fsharp:_BASIC
|
||||
git:tpope/vim-git
|
||||
glsl:tikhomirov/vim-glsl
|
||||
glsl:tikhomirov/vim-glsl:_NOAFTER
|
||||
gmpl:maelvalais/gmpl.vim
|
||||
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
||||
go:fatih/vim-go:_BASIC
|
||||
@@ -210,8 +214,9 @@ PACKS="
|
||||
julia:JuliaEditorSupport/julia-vim
|
||||
kotlin:udalov/kotlin-vim
|
||||
latex:LaTeX-Box-Team/LaTeX-Box
|
||||
less:groenewege/vim-less
|
||||
less:groenewege/vim-less:_NOAFTER
|
||||
liquid:tpope/vim-liquid
|
||||
lilypond:anowlcalledjosh/vim-lilypond
|
||||
livescript:gkz/vim-ls
|
||||
lua:tbastos/vim-lua
|
||||
mako:sophacles/vim-bundle-mako
|
||||
@@ -256,6 +261,7 @@ PACKS="
|
||||
scss:cakebaker/scss-syntax.vim
|
||||
slim:slim-template/vim-slim
|
||||
slime:slime-lang/vim-slime-syntax
|
||||
smt2:bohlender/vim-smt2
|
||||
solidity:tomlion/vim-solidity
|
||||
stylus:wavded/vim-stylus
|
||||
swift:keith/swift.vim
|
||||
|
||||
23
compiler/lilypond.vim
Normal file
23
compiler/lilypond.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'lilypond') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" LilyPond compiler file
|
||||
" Language: LilyPond
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Last Change: 2004 Mar 01
|
||||
"
|
||||
" Installed As: vim/compiler/lilypond.vim
|
||||
"
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "lilypond"
|
||||
|
||||
" default make
|
||||
setlocal makeprg=lilypond\ $*
|
||||
" errorformat for lily (with columns) and gcc
|
||||
" (how to see multiple-line error messages?)
|
||||
setlocal errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
|
||||
"
|
||||
@@ -3,6 +3,14 @@ if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 0
|
||||
endif
|
||||
|
||||
" Make csv loading faster
|
||||
if !exists('g:csv_start')
|
||||
let g:csv_start = 1
|
||||
endif
|
||||
if !exists('g:csv_end')
|
||||
let g:csv_end = 2
|
||||
endif
|
||||
|
||||
" Disable json concealing by default
|
||||
if !exists('g:vim_json_syntax_conceal')
|
||||
let g:vim_json_syntax_conceal = 0
|
||||
|
||||
@@ -3,6 +3,14 @@ if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 0
|
||||
endif
|
||||
|
||||
" Make csv loading faster
|
||||
if !exists('g:csv_start')
|
||||
let g:csv_start = 1
|
||||
endif
|
||||
if !exists('g:csv_end')
|
||||
let g:csv_end = 2
|
||||
endif
|
||||
|
||||
" Disable json concealing by default
|
||||
if !exists('g:vim_json_syntax_conceal')
|
||||
let g:vim_json_syntax_conceal = 0
|
||||
@@ -80,6 +88,14 @@ augroup END
|
||||
if (!exists('g:graphql_javascript_tags'))
|
||||
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'acpiasl') == -1
|
||||
augroup filetypedetect
|
||||
" acpiasl, from asl.vim in martinlroth/vim-acpi-asl
|
||||
au BufRead,BufNewFile *.asl set filetype=asl
|
||||
au BufRead,BufNewFile *.dsl set filetype=asl
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
augroup filetypedetect
|
||||
" ansible, from ansible.vim in pearofducks/ansible-vim
|
||||
@@ -241,6 +257,14 @@ autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'csv') == -1
|
||||
augroup filetypedetect
|
||||
" csv, from csv.vim in chrisbra/csv.vim
|
||||
" Install Filetype detection for CSV files
|
||||
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
||||
augroup filetypedetect
|
||||
" cucumber, from cucumber.vim in tpope/vim-cucumber
|
||||
@@ -365,7 +389,7 @@ endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||
augroup filetypedetect
|
||||
" glsl, from glsl.vim in tikhomirov/vim-glsl
|
||||
" glsl, from glsl.vim in tikhomirov/vim-glsl:_NOAFTER
|
||||
" Language: OpenGL Shading Language
|
||||
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||
|
||||
@@ -640,7 +664,7 @@ endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||
augroup filetypedetect
|
||||
" less, from less.vim in groenewege/vim-less
|
||||
" less, from less.vim in groenewege/vim-less:_NOAFTER
|
||||
autocmd BufNewFile,BufRead *.less setf less
|
||||
augroup end
|
||||
endif
|
||||
@@ -667,6 +691,16 @@ au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liq
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'lilypond') == -1
|
||||
augroup filetypedetect
|
||||
" lilypond, from lilypond.vim in anowlcalledjosh/vim-lilypond
|
||||
"
|
||||
" Installed As: vim/ftdetect/lilypond.vim
|
||||
"
|
||||
au! BufNewFile,BufRead *.ly,*.ily set ft=lilypond
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||
augroup filetypedetect
|
||||
" livescript, from ls.vim in gkz/vim-ls
|
||||
@@ -1210,6 +1244,13 @@ autocmd BufNewFile,BufRead *.slime set filetype=slime
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'smt2') == -1
|
||||
augroup filetypedetect
|
||||
" smt2, from smt2.vim in bohlender/vim-smt2
|
||||
autocmd BufRead,BufNewFile *.smt,*.smt2 set filetype=smt2
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
|
||||
augroup filetypedetect
|
||||
" solidity, from solidity.vim in tomlion/vim-solidity
|
||||
|
||||
38
ftplugin/csv.vim
Normal file
38
ftplugin/csv.vim
Normal file
@@ -0,0 +1,38 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'csv') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Filetype plugin for editing CSV files. "{{{1
|
||||
" Author: Christian Brabandt <cb@256bit.org>
|
||||
" Version: 0.31
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=2830
|
||||
" License: VIM License
|
||||
" Last Change: Thu, 15 Jan 2015 21:05:10 +0100
|
||||
" Documentation: see :help ft-csv.txt
|
||||
" GetLatestVimScripts: 2830 30 :AutoInstall: csv.vim
|
||||
"
|
||||
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
|
||||
" though, implementation differs.
|
||||
|
||||
" Plugin folklore "{{{1
|
||||
if v:version < 700 || exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Initialize Plugin "{{{2
|
||||
" useful for configuring how many lines to analyze,
|
||||
" set if you notice a slowdown
|
||||
let b:csv_start = get(g:, 'csv_start', 1)
|
||||
let b:csv_end = get(g:, 'csv_end', line('$'))
|
||||
let b:csv_result = ''
|
||||
|
||||
call csv#Init(b:csv_start, b:csv_end)
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" Vim Modeline " {{{2
|
||||
" vim: set foldmethod=marker et sw=0 sts=-1 ts=4:
|
||||
61
ftplugin/lilypond.vim
Normal file
61
ftplugin/lilypond.vim
Normal file
@@ -0,0 +1,61 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'lilypond') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" LilyPond filetype plugin
|
||||
" Language: LilyPond (ft=ly)
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Last Change: 2010 Jul 26
|
||||
"
|
||||
" Installed As: vim/ftplugin/lilypond.vim
|
||||
" Uses Generated File: vim/syntax/lilypond-words.vim
|
||||
"
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal autoindent
|
||||
setlocal shiftwidth=2
|
||||
"
|
||||
" some handy key mappings
|
||||
"
|
||||
" <F4> save & make and play midi with timidity
|
||||
map <buffer> <F4> :w<Return>:se makeprg=lilypond\ \"%<\"<Return>:make<Return>:!timidity "%<.midi"<Return>
|
||||
"
|
||||
" <F5> save & make
|
||||
map <buffer> <F5> :w<Return>:se makeprg=lilypond\ \"%<\"<Return>:make<Return>
|
||||
"
|
||||
" <F6> view ps with ghostview
|
||||
map <buffer> <F6> :!gv --watch "%<.ps" &<Return>
|
||||
"
|
||||
" <F7> prev error
|
||||
map <buffer> <F7> :cp<Return>
|
||||
"
|
||||
" <F8> next error
|
||||
map <buffer> <F8> :cn<Return>
|
||||
"
|
||||
" <F9> make
|
||||
map <buffer> <F9> :w<Return>:se makeprg=make\ -k<Return>:make<Return>
|
||||
"
|
||||
" <F10> menu
|
||||
source $VIMRUNTIME/menu.vim
|
||||
setlocal wildmenu
|
||||
setlocal cpo-=<
|
||||
setlocal wcm=<C-Z>
|
||||
map <buffer> <F10> :emenu <C-Z>
|
||||
"
|
||||
" <F12> comment region
|
||||
map <buffer> <F12> :g!/%.*/normal 0i%<Return>
|
||||
"
|
||||
" <S-F12> remove comments in region
|
||||
map <buffer> <S-F12> :g/%.*/normal 0x<Return>
|
||||
"
|
||||
" Completions in Insert/Replace-mode with <Ctrl-N>
|
||||
setlocal dictionary-=$VIM/syntax/lilypond-words dictionary+=$VIM/syntax/lilypond-words
|
||||
setlocal complete-=k complete+=k
|
||||
"
|
||||
setlocal showmatch
|
||||
29
ftplugin/smt2.vim
Normal file
29
ftplugin/smt2.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal iskeyword+=-,:,#,',$
|
||||
|
||||
" If no command for invoking a solver is specified in ~/.vimrc, test if either
|
||||
" 'z3' or 'boolector' is accessible through $PATH (in that order)
|
||||
if !exists("g:smt2_solver_command")
|
||||
if executable("z3")
|
||||
let g:smt2_solver_command = "z3"
|
||||
elseif executable("boolector")
|
||||
let g:smt2_solver_command = "boolector"
|
||||
endif
|
||||
endif
|
||||
|
||||
" If no command line switch for printing the solver's version is specified in
|
||||
" ~/.vimrc, use '--version'
|
||||
if !exists("g:smt2_solver_version_switch")
|
||||
let g:smt2_solver_version_switch = "--version"
|
||||
endif
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> <buffer> <localleader>r :call smt2#RunSolver()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>R :call smt2#RunSolverAndShowResult()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>v :call smt2#PrintSolverVersion()<cr>
|
||||
|
||||
" Comment String
|
||||
setlocal commentstring=;%s
|
||||
64
indent/lilypond.vim
Normal file
64
indent/lilypond.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'lilypond') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" LilyPond indent file
|
||||
" Language: LilyPond
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Last Change: 2010 Jul 26
|
||||
"
|
||||
" Installed As: vim/indent/lilypond.vim
|
||||
"
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetLilyPondIndent()
|
||||
setlocal indentkeys=o,O,},>>,!^F
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetLilyPondIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetLilyPondIndent()
|
||||
if v:lnum == 1
|
||||
return 0
|
||||
endif
|
||||
|
||||
"Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
"Check if a block was started: '{' or '<<' is the last non-blank character of the previous line.
|
||||
if getline(lnum) =~ '^.*\({\|<<\)\s*$'
|
||||
let ind = indent(lnum) + &sw
|
||||
else
|
||||
let ind = indent(lnum)
|
||||
endif
|
||||
|
||||
"Check if a block was ended: '}' or '>>' is the first non-blank character of the current line.
|
||||
if getline(v:lnum) =~ '^\s*\(}\|>>\)'
|
||||
let ind = ind - &sw
|
||||
endif
|
||||
|
||||
" Check if the first character from the previous line is within
|
||||
" a `lilyScheme' region, and if so, use lisp-style indentation
|
||||
" for the current line.
|
||||
"
|
||||
" TODO:
|
||||
" - Only works in version 7.1.215 or later, though it should
|
||||
" silently fail in older versions.
|
||||
" - We should support `lilyScheme' regions that begin in the
|
||||
" middle of the line, too.
|
||||
for id in synstack(lnum, 1)
|
||||
if synIDattr(id, "name") == "lilyScheme"
|
||||
let ind = lispindent(v:lnum)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
"
|
||||
"
|
||||
"
|
||||
@@ -1,8 +0,0 @@
|
||||
$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
|
||||
@@ -10,12 +10,14 @@ describe "My Vim plugin" do
|
||||
extensions = extensions.split(/[\n,]/)
|
||||
|
||||
extensions.each do |ext|
|
||||
it "should parse #{ext} file" do
|
||||
Timeout::timeout(15) do
|
||||
write_file "#{ext}", ""
|
||||
vim.edit "#{ext}"
|
||||
vim.insert "sample"
|
||||
vim.write
|
||||
if ext.match?(/^[a-z\.]+$/i)
|
||||
it "should parse #{ext} file" do
|
||||
Timeout::timeout(20) do
|
||||
write_file "#{ext}", ""
|
||||
vim.edit "#{ext}"
|
||||
vim.insert "sample"
|
||||
vim.write
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,9 +4,7 @@ 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 = !ENV['REUSE_SERVER'].nil?
|
||||
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.
|
||||
|
||||
112
syntax/asl.vim
Normal file
112
syntax/asl.vim
Normal file
@@ -0,0 +1,112 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'acpiasl') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim syntax file
|
||||
" Language: ACPI ASL files
|
||||
" Maintainer: Martin L Roth <gaumless@gmail.com>
|
||||
" Version: 0.1
|
||||
|
||||
" Currently supporting ACPI 5.0 and IASL preprocessor
|
||||
" http://www.acpi.info/DOWNLOADS/ACPIspec50.pdf
|
||||
" https://acpica.org/sites/acpica/files/aslcompiler_8.pdf
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:current_syntax = "asl"
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn region aslBlock start="{" end="}" transparent fold
|
||||
|
||||
syn keyword aslTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
syn region aslComment display start="//" skip="\\$" end="$" keepend contains=aslTodo
|
||||
syn region aslComment start="/\*" end="\*\/" contains=aslTodo
|
||||
|
||||
syn region aslString start=/"/ skip=/\\"/ end=/"/
|
||||
|
||||
" Keywords
|
||||
syn keyword aslPrimaryKeyword AccessAs Acquire Add Alias And Arg0 Arg1 Arg2 Arg3 Arg4 Arg6 Arg6
|
||||
syn keyword aslPrimaryKeyword BankField BreakPoint Break Buffer
|
||||
syn keyword aslPrimaryKeyword Case ConcatenateResTemplate Concatenate Connection CondRefOf Continue CopyObject CreateBitField CreateByteField CreateDWordField CreateField CreateQWordField CreateWordField
|
||||
syn keyword aslPrimaryKeyword DataTableRegion Debug Decrement Default DefinitionBlock DerefOf Device Divide
|
||||
syn keyword aslPrimaryKeyword EISAID EisaId ElseIf Else Event External
|
||||
syn keyword aslPrimaryKeyword Fatal Field FindSetLeftBit FindSetRightBit FromBCD Function
|
||||
syn keyword aslPrimaryKeyword If Include Increment IndexField Index
|
||||
syn keyword aslPrimaryKeyword LAnd LEqual LGreaterEqual LGreater LLessEqual LLess LNotEqual LNot LoadTable Load Local0 Local1 Local2 Local3 Local4 Local5 Local6 Local7 LOr
|
||||
syn keyword aslPrimaryKeyword Match Method Mid Mod Multiply Mutex
|
||||
syn keyword aslPrimaryKeyword Name NAnd NoOp NOr Notify Not
|
||||
syn keyword aslPrimaryKeyword ObjectType Offset OperationRegion Or
|
||||
syn keyword aslPrimaryKeyword Package PowerResource Processor
|
||||
syn keyword aslPrimaryKeyword RawDataBuffer RefOf Release Reset ResourceTemplate Return
|
||||
syn keyword aslPrimaryKeyword Scope ShiftLeft ShiftRight Signal SizeOf Sleep Stall Store Subtract Switch
|
||||
syn keyword aslPrimaryKeyword ThermalZone Timer ToBCD ToBuffer ToDecimalString ToHexString ToInteger ToString ToUUID
|
||||
syn keyword aslPrimaryKeyword Unicode Unload
|
||||
syn keyword aslPrimaryKeyword Wait While
|
||||
syn keyword aslPrimaryKeyword XOr
|
||||
|
||||
syn keyword aslParameterKeyword ActiveBoth ActiveHigh ActiveHigh ActiveLow ActiveLow AddressingMode10Bit AddressingMode7Bit AddressRangeACPI AddressRangeMemory AddressRangeNVS AddressRangeReserved AnyAcc AttribBlock AttribBlockProcessCall AttribByte AttribBytes AttribBytes AttribProcessCall AttribQuick AttribRawBytes AttribRawBytes AttribRawProcessBytes AttribRawProcessBytes AttribSendReceive AttribWord
|
||||
syn keyword aslParameterKeyword BigEndianing BufferAcc BuffFieldObj BuffObj BusMaster ByteAcc
|
||||
syn keyword aslParameterKeyword Cacheable ClockPhaseFirst ClockPhaseSecond ClockPolarityHigh ClockPolarityLow Compatibility ControllerInitiated
|
||||
syn keyword aslParameterKeyword DataBitsEight DataBitsFive DataBitsNine DataBitsSeven DataBitsSix DDBHandleObj Decode10 Decode16 DenseTranslation DeviceInitiated DeviceObj DWordAcc
|
||||
syn keyword aslParameterKeyword Edge EmbeddedControl EntireRange EventObj Exclusive ExclusiveAndWake
|
||||
syn keyword aslParameterKeyword FFixedHW FieldUnitObj FlowControlHardware FlowControlNone FlowControlXon FourWireMode
|
||||
syn keyword aslParameterKeyword GeneralPurposeIO GenericSerialBus
|
||||
syn keyword aslParameterKeyword IntObj IoRestrictionInputOnly IoRestrictionNone IoRestrictionNoneAndPreserve IoRestrictionOutputOnly IPMI ISAOnlyRanges
|
||||
syn keyword aslParameterKeyword Level LittleEndian Lock
|
||||
syn keyword aslParameterKeyword MaxFixed MaxNotFixed MEQ MethodObj MGE MGT MinFixed MinNotFixed MLE MLT MTR MutexObj
|
||||
syn keyword aslParameterKeyword NoLock NonCacheable NonISAOnlyRanges NotBusMaster NotSerialized
|
||||
syn keyword aslParameterKeyword OpRegionObj
|
||||
syn keyword aslParameterKeyword ParityTypeEven ParityTypeMark ParityTypeNone ParityTypeOdd ParityTypeSpace PCC PciBarTarget PCI_Config PkgObj PolarityHigh PolarityLow PosDecode PowerResObj Prefetchable Preserve ProcessorObj PullDefault PullDown PullNone PullUp
|
||||
syn keyword aslParameterKeyword QWordAcc
|
||||
syn keyword aslParameterKeyword ReadOnly ReadWrite RegionSpaceKeyword ResourceConsumer ResourceProducer
|
||||
syn keyword aslParameterKeyword Serialized Shared SharedAndWake SMBus SparseTranslation StopBitsOne StopBitsOnePlusHalf StopBitsTwo StopBitsZero StrObj SubDecode SystemCMOS SystemIO SystemMemory
|
||||
syn keyword aslParameterKeyword ThermalZoneObj ThreeWireMode Transfer16 Transfer8 Transfer8_16 TypeA TypeB TypeF TypeStatic TypeTranslation
|
||||
syn keyword aslParameterKeyword UnknownObj UserDefRegionSpace
|
||||
syn keyword aslParameterKeyword Width128Bit Width16Bit Width256Bit Width32Bit Width64Bit Width8Bit WordAcc WriteAsOnes WriteAsZeros WriteCombining
|
||||
|
||||
syn keyword aslResourceKeyword DMA DWordIO DWordMemory DWordSpace
|
||||
syn keyword aslResourceKeyword EndDependentFn ExtendedIO ExtendedMemory ExtendedSpace
|
||||
syn keyword aslResourceKeyword FixedDMA FixedIO
|
||||
syn keyword aslResourceKeyword GpioInt GpioIO
|
||||
syn keyword aslResourceKeyword I2CSerialBus Interrupt IO IRQNoFlags IRQ
|
||||
syn keyword aslResourceKeyword Memory24 Memory32Fixed Memory32
|
||||
syn keyword aslResourceKeyword QWordIO QWordMemory QWordSpace
|
||||
syn keyword aslResourceKeyword RawDataBuffer Register
|
||||
syn keyword aslResourceKeyword SPISerialBus StartDependentFnNoPri StartDependentFn
|
||||
syn keyword aslResourceKeyword UARTSerialBus
|
||||
syn keyword aslResourceKeyword VendorLong VendorShort
|
||||
syn keyword aslResourceKeyword WordBusNumber WordIO WordSpace
|
||||
|
||||
" Pre-defined object names
|
||||
syn keyword aslObjects _AC0 _AC1 _AC2 _AC3 _AC4 _AC5 _AC6 _AC7 _AC8 _AC9 _ADR _ALC _ALI _ALN _APL _ALR _ALT _AL0 _AL1 _AL2 _AL3 _AL4 _AL5 _AL6 _AL7 _AL8 _AL9 _ART _ASI _ASZ _ATT _BAS _BBN _BCL _BCM _BCT _BDN _BFS _BIF _BIX _BLT _BM _BMA _BMC _BMD _MBS _BQC _BST _BTM _BTP _CBA _CDM _CID _CRS _CRT _CSD _CST _CWS _DBT _DCK _DCS _DDC _DDN _DEC _DGS _DIS _DLM _DMA _DOD _DOS _DPL _DRS _DSM _DSS _DSW _DTI _EC _EDL _EJD _END _EVT _FDE _FDI _FDM _FIF _FIX _FLC _FPS _FSL _FST _GAI _GCP _GHL _GL _GLK _GPD _GPE _GRA _GRT _GSB _GTF _GTM _GTS _GWS _HE _HID _HOT _HPP _HPX _HRV _IFT _INI _INT _IOR _IRC _LCK _LEN _LID _LIN _LL _MAF _MAT _MAX _MBM _MEM _MIF _MIN _MLS _MOD _MSG _MSM _MTP _NTT _OFF _ON _OS _OSC _OSI _OST _PAI _PAR _PCL _PCT _PDC _PDL _PHA _PIC _PIF _PIN _PLD _PMC _PMD _PMM _POL _PPC _PPE _PPI _PR _PR0 _PR1 _PR2 _PR3 _PRE _PRL _PRS _PRT _PRW _PS0 _PS1 _PS2 _PS3 _PSC _PSD _PSE _PSL _PSR _PSS _PSV _PSW _PTC _PTP _PTS _PUR _PXM _RBO _RBW _REG _REV _RMV _RNG _ROM _RT _RTV _RW _RXL _S0 _S1 _S2 _S3 _S4 _S4 _S1D _S2D _S3D _S4D _S0W _S1W _S2W _S3W _S4W _SB _SBS _SCP _SDD _SEG _SHL _SHR _SI _SIZ _SLI _SLV _SPD _SPE _SRS _SRT _SRV _SST _STA _STB _STM _STP _STR _STV _SUN _SWS _TC2 _TC2 _TDL _TIP _TIV _TMP _TPC _TPT _TRA _TRS _TRT _TSD _TSF _TSP _TSS _TST _TTP _TXL _TTS _TYP _TZ _TZD _TZM _TZP _UID _UPC _UPD _UPP _VPO _VEN _WAK
|
||||
|
||||
" IASL Preprocessor: #define #elif #else #endif #error #if #ifdef #ifndef #include #line #undef
|
||||
syn region aslPreProc start="^\s*\(%:\|#\)\s*\(include\)\>" skip="\\$" end="$" keepend
|
||||
syn region aslPreProc start="^\s*\(%:\|#\)\s*\(error\|line\|define\|undef\|if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=ALL
|
||||
syn match aslPreProcMatch display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
|
||||
" Numeric values and Zero / One keywords
|
||||
syn keyword aslZeroOne Zero One
|
||||
syn match aslNumber display "\<\d\+"
|
||||
syn match aslNumber display "0x\x\+"
|
||||
|
||||
" Set the default colors
|
||||
hi def link aslTodo Todo
|
||||
hi def link aslComment Comment
|
||||
hi def link aslString String
|
||||
hi def link aslPrimaryKeyword Keyword
|
||||
hi def link aslParameterKeyword Macro
|
||||
hi def link aslResourceKeyword Type
|
||||
hi def link aslObjects Identifier
|
||||
hi def link aslPreProc PreProc
|
||||
hi def link aslPreProcMatch PreProc
|
||||
hi def link aslZeroOne Number
|
||||
hi def link aslNumber Number
|
||||
|
||||
let b:current_syntax = "asl"
|
||||
syn sync minlines=200
|
||||
|
||||
173
syntax/csv.vim
Normal file
173
syntax/csv.vim
Normal file
@@ -0,0 +1,173 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'csv') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" A simple syntax highlighting, simply alternate colors between two
|
||||
" adjacent columns
|
||||
" Init {{{2
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
scriptencoding utf8
|
||||
if version < 600
|
||||
syn clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Helper functions "{{{2
|
||||
fu! <sid>Warning(msg) "{{{3
|
||||
" Don't redraw, so we are not overwriting messages from the ftplugin
|
||||
" script
|
||||
echohl WarningMsg
|
||||
echomsg "CSV Syntax:" . a:msg
|
||||
echohl Normal
|
||||
endfu
|
||||
|
||||
fu! <sid>Esc(val, char) "{{{3
|
||||
if empty(a:val)
|
||||
return a:val
|
||||
endif
|
||||
return '\V'.escape(a:val, '\\'.a:char).'\m'
|
||||
endfu
|
||||
|
||||
fu! <sid>CheckSaneSearchPattern() "{{{3
|
||||
let s:del_def = ','
|
||||
let s:col_def = '\%([^' . s:del_def . ']*' . s:del_def . '\|$\)'
|
||||
let s:col_def_end = '\%([^' . s:del_def . ']*' . s:del_def . '\)'
|
||||
|
||||
" First:
|
||||
" Check for filetype plugin. This syntax script relies on the filetype
|
||||
" plugin, else, it won't work properly.
|
||||
redir => s:a |sil filetype | redir end
|
||||
let s:a=split(s:a, "\n")[0]
|
||||
if match(s:a, '\cplugin:off') > 0
|
||||
call <sid>Warning("No filetype support, only simple highlighting using"
|
||||
\ . s:del_def . " as delimiter! See :h csv-installation")
|
||||
endif
|
||||
|
||||
" Check Comment setting
|
||||
if !exists("g:csv_comment")
|
||||
let b:csv_cmt = split(&cms, '%s')
|
||||
elseif match(g:csv_comment, '%s') >= 0
|
||||
let b:csv_cmt = split(g:csv_comment, '%s')
|
||||
else
|
||||
let b:csv_cmt = [g:csv_comment]
|
||||
endif
|
||||
|
||||
|
||||
" Second: Check for sane defaults for the column pattern
|
||||
" Not necessary to check for fixed width columns
|
||||
if exists("b:csv_fixed_width_cols")
|
||||
return
|
||||
endif
|
||||
|
||||
|
||||
" Try a simple highlighting, if the defaults from the ftplugin
|
||||
" don't exist
|
||||
let s:col = get(b:, 'col', s:col_def)
|
||||
let s:col_end = get(b:, 'col_end', s:col_def_end)
|
||||
let s:del = get(b:, 'delimiter', s:del_def)
|
||||
let s:cmts = b:csv_cmt[0]
|
||||
let s:cmte = len(b:csv_cmt) == 2 ? b:csv_cmt[1] : ''
|
||||
" Make the file start at the first actual CSV record (issue #71)
|
||||
if !exists("b:csv_headerline")
|
||||
let cmts = <sid>Esc(s:cmts, '')
|
||||
let pattern = '\%^\(\%('.cmts.'.*\n\)\|\%(\s*\n\)\)\+'
|
||||
let start = search(pattern, 'nWe', 10)
|
||||
" don't do it, on an empty file
|
||||
if start > 0 && !empty(getline(start))
|
||||
let b:csv_headerline = start+1
|
||||
endif
|
||||
endif
|
||||
" escape '/' for syn match command
|
||||
let s:cmts=<sid>Esc(s:cmts, '/')
|
||||
let s:cmte=<sid>Esc(s:cmte, '/')
|
||||
|
||||
if line('$') > 1 && (!exists("b:col") || empty(b:col))
|
||||
" check for invalid pattern, ftplugin hasn't been loaded yet
|
||||
call <sid>Warning("Invalid column pattern, using default pattern " . s:col_def)
|
||||
endif
|
||||
endfu
|
||||
|
||||
" Syntax rules {{{2
|
||||
fu! <sid>DoHighlight() "{{{3
|
||||
if has("conceal") && !exists("g:csv_no_conceal") &&
|
||||
\ !exists("b:csv_fixed_width_cols")
|
||||
exe "syn match CSVDelimiter /" . s:col_end .
|
||||
\ '/ms=e,me=e contained conceal cchar=' .
|
||||
\ (&enc == "utf-8" ? "│" : '|')
|
||||
hi def link CSVDelimiter Conceal
|
||||
elseif !exists("b:csv_fixed_width_cols")
|
||||
" The \%(.\)\@<= makes sure, the last char won't be concealed,
|
||||
" if it isn't a delimiter
|
||||
exe "syn match CSVDelimiter /" . s:col_end . '/ms=e,me=e contained'
|
||||
if has("conceal")
|
||||
hi def link CSVDelimiter Conceal
|
||||
else
|
||||
hi def link CSVDelimiter Ignore
|
||||
endif
|
||||
endif " There is no delimiter for csv fixed width columns
|
||||
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
exe 'syn match CSVColumnEven nextgroup=CSVColumnOdd /'
|
||||
\ . s:col . '/ contains=CSVDelimiter'
|
||||
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
||||
\ . s:col . '/ contains=CSVDelimiter'
|
||||
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||
\. s:col . '/ contains=CSVDelimiter'
|
||||
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||
\. s:col . '/ contains=CSVDelimiter'
|
||||
else
|
||||
for i in range(len(b:csv_fixed_width_cols))
|
||||
let pat = '/\%' . b:csv_fixed_width_cols[i] . 'v.*' .
|
||||
\ ((i == len(b:csv_fixed_width_cols)-1) ? '/' :
|
||||
\ '\%' . b:csv_fixed_width_cols[i+1] . 'v/')
|
||||
|
||||
let group = "CSVColumn" . (i%2 ? "Odd" : "Even" )
|
||||
let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" )
|
||||
exe "syn match " group pat " nextgroup=" . ngroup
|
||||
endfor
|
||||
endif
|
||||
" Comment regions
|
||||
exe 'syn match CSVComment /'. s:cmts. '.*'.
|
||||
\ (!empty(s:cmte) ? '\%('. s:cmte. '\)\?'
|
||||
\: ''). '/'
|
||||
hi def link CSVComment Comment
|
||||
endfun
|
||||
|
||||
fu! <sid>HiLink(name, target) "{{{3
|
||||
if !hlexists(a:name)
|
||||
exe "hi def link" a:name a:target
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! <sid>DoSyntaxDefinitions() "{{{3
|
||||
syn spell toplevel
|
||||
" Not really needed
|
||||
syn case ignore
|
||||
call <sid>HiLink("CSVColumnHeaderOdd", "WarningMsg")
|
||||
call <sid>HiLink("CSVColumnHeaderEven", "WarningMsg")
|
||||
if get(g:, 'csv_no_column_highlight', 0)
|
||||
call <sid>HiLink("CSVColumnOdd", "Normal")
|
||||
call <sid>HiLink("CSVColumnEven", "Normal")
|
||||
else
|
||||
call <sid>HiLink("CSVColumnOdd", "String")
|
||||
call <sid>HiLink("CSVColumnEven","Statement")
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Main: {{{2
|
||||
" Make sure, we are using a sane, valid pattern for syntax
|
||||
" highlighting
|
||||
call <sid>CheckSaneSearchPattern()
|
||||
" Define all necessary syntax groups
|
||||
call <sid>DoSyntaxDefinitions()
|
||||
" Highlight the file
|
||||
call <sid>DoHighlight()
|
||||
" Set the syntax variable {{{2
|
||||
let b:current_syntax="csv"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim: set foldmethod=marker et sw=0 sts=-1 ts=4:
|
||||
7
syntax/lilypond-words.vim
Normal file
7
syntax/lilypond-words.vim
Normal file
File diff suppressed because one or more lines are too long
91
syntax/lilypond.vim
Normal file
91
syntax/lilypond.vim
Normal file
@@ -0,0 +1,91 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'lilypond') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" LilyPond syntax file
|
||||
" Language: LilyPond
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Last Change: 2010 Jul 26
|
||||
"
|
||||
" Installed As: vim/syntax/lilypond.vim
|
||||
" Uses Generated File: vim/syntax/lilypond-words.vim
|
||||
"
|
||||
" 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
|
||||
|
||||
" Read the LilyPond syntax match groups:
|
||||
" lilyKeyword, lilyReservedWord, lilyNote
|
||||
if version < 600
|
||||
so <sfile>:p:h/lilypond-words.vim
|
||||
else
|
||||
runtime! syntax/lilypond-words.vim
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
endif
|
||||
|
||||
" Match also parethesis of angle type
|
||||
setlocal mps+=<:>
|
||||
|
||||
" Case matters
|
||||
syn case match
|
||||
|
||||
syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord,lilyScheme
|
||||
|
||||
syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" contains=@lilyMatchGroup fold
|
||||
syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold
|
||||
syn region lilyMatcher matchgroup=Delimiter start="<" skip="\\\\\|\\[{<>}]" end=">" contains=@lilyMatchGroup fold
|
||||
|
||||
syn region lilyString start=/"/ end=/"/ skip=/\\"/
|
||||
syn region lilyComment start="%{" skip="%$" end="%}"
|
||||
syn region lilyComment start="%\([^{]\|$\)" end="$"
|
||||
|
||||
syn match lilyNumber "[-_^.]\?\d\+[.]\?"
|
||||
syn match lilySlur "[(~)]"
|
||||
syn match lilySlur "\\[()]"
|
||||
syn match lilySpecial "\\[<!>\\]"
|
||||
" avoid highlighting the extra character in situations like
|
||||
" c--\mf c^^\mf c__\mf
|
||||
syn match lilyArticulation "[-_^][-_^+|>.]"
|
||||
|
||||
" Include Scheme syntax highlighting, where appropriate
|
||||
syn include @embeddedScheme syntax/scheme.vim
|
||||
unlet b:current_syntax
|
||||
syn region lilyScheme matchgroup=Delimiter start="#['`]\?(" matchgroup=Delimiter end=")" contains=@embeddedScheme
|
||||
|
||||
" Rest of syntax highlighting rules start here
|
||||
"
|
||||
" " 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_lily_syn_inits")
|
||||
if version < 508
|
||||
let did_lily_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink Delimiter Identifier
|
||||
|
||||
HiLink lilyString String
|
||||
HiLink lilyComment Comment
|
||||
|
||||
HiLink lilyNote Identifier
|
||||
HiLink lilyArticulation PreProc
|
||||
HiLink lilyKeyword Keyword
|
||||
HiLink lilyReservedWord Type
|
||||
|
||||
HiLink lilyNumber Constant
|
||||
HiLink lilySpecial Special
|
||||
HiLink lilySlur ModeMsg
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "lilypond"
|
||||
@@ -73,8 +73,8 @@ syn region pugPlainFilter matchgroup=pugFilter start="^\z(\s*\):\%(sass\|less\|
|
||||
|
||||
syn match pugScriptConditional "^\s*\<\%(if\|else\|else if\|elif\|unless\|while\|until\|case\|when\|default\)\>[?!]\@!"
|
||||
syn match pugScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
|
||||
syn region pugScriptLoopRegion start="^\s*\(for \)" end="$" contains=pugScriptLoopKeywords
|
||||
syn keyword pugScriptLoopKeywords for in
|
||||
syn region pugScriptLoopRegion start="^\s*\(for\|each\)" end="$" contains=pugScriptLoopKeywords
|
||||
syn keyword pugScriptLoopKeywords contained for each in
|
||||
|
||||
syn region pugJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,pugJavascriptTag,pugCoffeescriptFilter keepend
|
||||
syn region javascriptInterpolation start=/${/ end=/}/ contained
|
||||
|
||||
179
syntax/smt2.vim
Normal file
179
syntax/smt2.vim
Normal file
@@ -0,0 +1,179 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim syntax file
|
||||
" " Language: SMT-LIB2 with Z3's extensions
|
||||
" " Maintainer: Dimitri Bohlender <bohlender@embedded.rwth-aachen.de>
|
||||
|
||||
" Quit if a syntax file is already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = "smt2"
|
||||
|
||||
" Comments
|
||||
syntax match smt2Comment ";.*$"
|
||||
|
||||
" Keywords
|
||||
syntax keyword smt2Keyword
|
||||
\ apply
|
||||
\ as
|
||||
\ assert
|
||||
\ assert
|
||||
\ assert-soft
|
||||
\ check-sat
|
||||
\ check-sat-using
|
||||
\ declare-const
|
||||
\ declare-datatype
|
||||
\ declare-datatypes
|
||||
\ declare-fun
|
||||
\ declare-map
|
||||
\ declare-rel
|
||||
\ declare-sort
|
||||
\ declare-var
|
||||
\ define-const
|
||||
\ define-fun
|
||||
\ define-sort
|
||||
\ display
|
||||
\ echo
|
||||
\ elim-quantifiers
|
||||
\ eval
|
||||
\ exists
|
||||
\ exit
|
||||
\ forall
|
||||
\ get-assignment
|
||||
\ get-info
|
||||
\ get-model
|
||||
\ get-option
|
||||
\ get-proof
|
||||
\ get-unsat-core
|
||||
\ get-user-tactics
|
||||
\ get-value
|
||||
\ help
|
||||
\ let
|
||||
\ match
|
||||
\ maximize
|
||||
\ minimize
|
||||
\ pop
|
||||
\ push
|
||||
\ query
|
||||
\ reset
|
||||
\ rule
|
||||
\ set-info
|
||||
\ set-logic
|
||||
\ set-option
|
||||
\ simplify
|
||||
syntax match smt2Keyword "!"
|
||||
|
||||
" Operators
|
||||
syntax match smt2Operator "[=\|>\|<\|<=\|>=\|=>\|+\|\-\|*\|/]"
|
||||
|
||||
" Builtins
|
||||
syntax keyword smt2Builtin
|
||||
\ and
|
||||
\ bit0
|
||||
\ bit1
|
||||
\ bvadd
|
||||
\ bvand
|
||||
\ bvashr
|
||||
\ bvcomp
|
||||
\ bvlshr
|
||||
\ bvmul
|
||||
\ bvnand
|
||||
\ bvneg
|
||||
\ bvnor
|
||||
\ bvnot
|
||||
\ bvor
|
||||
\ bvredand
|
||||
\ bvredor
|
||||
\ bvsdiv
|
||||
\ bvsge
|
||||
\ bvsgt
|
||||
\ bvshl
|
||||
\ bvsle
|
||||
\ bvslt
|
||||
\ bvsmod
|
||||
\ bvsrem
|
||||
\ bvsub
|
||||
\ bvudiv
|
||||
\ bvuge
|
||||
\ bvugt
|
||||
\ bvule
|
||||
\ bvult
|
||||
\ bvurem
|
||||
\ bvxnor
|
||||
\ bvxor
|
||||
\ concat
|
||||
\ const
|
||||
\ distinct
|
||||
\ div
|
||||
\ extract
|
||||
\ false
|
||||
\ get-assertions
|
||||
\ if
|
||||
\ is_int
|
||||
\ ite
|
||||
\ map
|
||||
\ mod
|
||||
\ not
|
||||
\ or
|
||||
\ rem
|
||||
\ repeat
|
||||
\ root-obj
|
||||
\ rotate_left
|
||||
\ rotate_right
|
||||
\ sat
|
||||
\ sat
|
||||
\ select
|
||||
\ sign_extend
|
||||
\ store
|
||||
\ to_int
|
||||
\ to_real
|
||||
\ true
|
||||
\ unsat
|
||||
\ unsat
|
||||
\ xor
|
||||
\ zero_extend
|
||||
syntax match smt2Builtin "[\^\~]"
|
||||
|
||||
" Identifier
|
||||
syntax match smt2Identifier "\<[a-z_][a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Types
|
||||
syntax match smt2Type "\<[A-Z][a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Strings
|
||||
syntax region smt2String start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syntax match smt2Option "\<:[a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Constructors
|
||||
syntax match smt2Constructor "\<\$[a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Number
|
||||
syntax match smt2Int "\<[0-9]\+\>"
|
||||
syntax match smt2Hex "\<[0#][xX][0-9a-fA-F]\+\>"
|
||||
syntax match smt2Binary "\<#b[01]\+\>"
|
||||
syntax match smt2Float "\<[0-9]\+\.[0-9]\+\([eE][\-+]\=[0-9]\+\)\=\>"
|
||||
|
||||
" Delimiter
|
||||
syntax match smt2Delimiter "[()]"
|
||||
|
||||
" Error
|
||||
syntax keyword smt2Error error
|
||||
|
||||
highlight def link smt2Comment Comment
|
||||
highlight def link smt2Keyword Function
|
||||
highlight def link smt2Operator Operator
|
||||
highlight def link smt2Builtin Operator
|
||||
highlight def link smt2Identifier Normal
|
||||
highlight def link smt2Type Type
|
||||
highlight def link smt2String String
|
||||
highlight def link smt2Option PreProc
|
||||
highlight def link smt2Constructor Function
|
||||
highlight def link smt2Float Float
|
||||
highlight def link smt2Hex Number
|
||||
highlight def link smt2Binary Number
|
||||
highlight def link smt2Int Number
|
||||
highlight def link smt2Delimiter Delimiter
|
||||
highlight def link smt2Error Error
|
||||
Reference in New Issue
Block a user