Compare commits

...

102 Commits

Author SHA1 Message Date
Adam Stankiewicz
449bb88248 Make loading faster for ambiguous extensions without heuristics 2020-09-30 01:40:34 +02:00
Adam Stankiewicz
7036147860 Brag in readme about shortened ftdetect time 2020-09-30 01:23:41 +02:00
Adam Stankiewicz
a37e7e2939 Reduce startup time by avoiding calling slow au! 2020-09-30 01:22:44 +02:00
Adam Stankiewicz
c1aac2e279 Deduplicate polyglot files 2020-09-29 23:36:28 +02:00
Adam Stankiewicz
543e8c917b Modularize lazy loading of polyglot parts 2020-09-29 21:48:38 +02:00
Adam Stankiewicz
2f133372bc Make loading faster for ambiguous extensions 2020-09-29 19:51:43 +02:00
Adam Stankiewicz
539952f922 Prevent warning for ps1xml heuristics, #570 2020-09-29 19:38:49 +02:00
Adam Stankiewicz
b5cc8fc336 Remove ambiguity for terraform files, #570 2020-09-29 19:35:05 +02:00
Adam Stankiewicz
1872af2d5e Fix detection of conf files, closes #569 2020-09-29 19:11:11 +02:00
Adam Stankiewicz
46b09b0d5b Remove {{ }} from detecting htmldjango, #560 2020-09-29 16:26:03 +02:00
Adam Stankiewicz
63f43f3b01 Make ftdetect even shorter 2020-09-28 19:35:09 +02:00
Adam Stankiewicz
046a052f18 Make generated file bit shorter 2020-09-28 19:13:59 +02:00
Adam Stankiewicz
31409eaafb Fix all warning messages 2020-09-28 18:56:36 +02:00
Adam Stankiewicz
f431aee86e Change less provider, closes #567 2020-09-28 18:28:56 +02:00
Adam Stankiewicz
6a086b0c79 Fix many extensions detection 2020-09-28 03:00:01 +02:00
Adam Stankiewicz
692db4dc29 Fix more warnings 2020-09-28 02:30:26 +02:00
Adam Stankiewicz
417df69667 Fix zsh missing filenames 2020-09-28 02:19:06 +02:00
Adam Stankiewicz
ae778bdb17 Add missing filetypes for sql 2020-09-28 01:33:57 +02:00
Adam Stankiewicz
b7598ff0c5 Add missing filetypes for systemd 2020-09-28 01:23:00 +02:00
Adam Stankiewicz
312e95099d Show warnings only for DEV build 2020-09-28 00:43:36 +02:00
Adam Stankiewicz
63369f98ef Fix missing filetypes detection 2020-09-28 00:41:10 +02:00
Adam Stankiewicz
2116dd281b Fix some missing extensions warnings 2020-09-28 00:31:39 +02:00
Adam Stankiewicz
7ec499c19f Set indentation only locally, fixes #564 2020-09-27 12:05:29 +02:00
Adam Stankiewicz
33b86476b6 Fix neovim warning, closes #563 2020-09-26 01:25:12 +02:00
Adam Stankiewicz
4f36a63813 Update filenames for gitignore 2020-09-25 00:09:44 +02:00
Adam Stankiewicz
d6479bbf0b Change gitignore provider 2020-09-25 00:07:37 +02:00
Adam Stankiewicz
d53d2189b9 Add support for .gitignore highlighting 2020-09-24 23:24:42 +02:00
Adam Stankiewicz
a6a6aeab76 Improve django filetype detection, closes #560 2020-09-24 22:52:50 +02:00
Adam Stankiewicz
444e7f184d Change maintained badge 2020-09-24 19:00:06 +02:00
Adam Stankiewicz
4c028b37bf Add warning to generated files 2020-09-24 18:56:07 +02:00
Adam Stankiewicz
9ff714cb6c Extract non-generated code to polyglot.vim 2020-09-24 18:52:58 +02:00
Adam Stankiewicz
e2bbed8acc Fix django highlighting, fixes #553 2020-09-24 10:50:19 +02:00
Adam Stankiewicz
6b4da27538 Improve html heuristics 2020-09-24 09:24:13 +02:00
Adam Stankiewicz
c284af58fa Update readme 2020-09-23 23:55:28 +02:00
Adam Stankiewicz
50aa05bd72 Allow to disable only syntax highlighting, #556 2020-09-23 23:49:57 +02:00
Adam Stankiewicz
7e2d060f88 Fix detecting jinja templates, #553 2020-09-23 23:25:01 +02:00
Adam Stankiewicz
3a298c9759 Add more advanced cpp syntax, #557 2020-09-23 22:04:29 +02:00
Adam Stankiewicz
d9ec600545 Allow to use ruby 2.5.5, closes #558 2020-09-23 20:18:38 +02:00
Adam Stankiewicz
33f0964d53 Update test script to ruby 2020-09-23 19:37:58 +02:00
Adam Stankiewicz
92cb76e33a Fix polyglot_disabled docs, closes #555 2020-09-23 09:43:36 +02:00
Adam Stankiewicz
378dcb3878 Update tests location 2020-09-22 21:47:21 +02:00
Adam Stankiewicz
6f0c50457f Build 2020-09-22 17:16:27 +02:00
Adam Stankiewicz
06548fe617 Get rid of s:Setf helper 2020-09-16 17:43:03 +02:00
Adam Stankiewicz
0118088e0a Make config more vim-independent 2020-09-16 17:24:10 +02:00
Adam Stankiewicz
17c2b630e1 Write heuristics for perl, closes #550 2020-09-16 15:50:39 +02:00
Adam Stankiewicz
271679272c Fix eruby filetype detect, closes #547 2020-09-15 11:19:56 +02:00
Adam Stankiewicz
d43d269bed Update 2020-09-15 10:45:50 +02:00
Adam Stankiewicz
4314841aa4 Fix build, closes #548 2020-09-13 09:14:21 +02:00
Adam Stankiewicz
5308fab3e9 Fix build, closes #548 2020-09-13 09:13:11 +02:00
Adam Stankiewicz
c842cbcb59 Update 2020-09-12 14:54:55 +02:00
Adam Stankiewicz
314621a395 Make warning more clear, #546 2020-09-11 13:56:24 +02:00
Adam Stankiewicz
ca8818e8ed Improve issue template 2020-09-10 16:46:31 +02:00
Adam Stankiewicz
947e6853aa Improve issue template 2020-09-10 16:44:51 +02:00
Adam Stankiewicz
05ff14bfda Add odin support, closes #544 2020-09-10 16:38:32 +02:00
Adam Stankiewicz
9243367ba3 Automatically detect script filetype when typing 2020-09-10 15:40:27 +02:00
Adam Stankiewicz
1eed30b2af Fix filetype detection and docini filetypes 2020-09-10 14:07:02 +02:00
Adam Stankiewicz
be092d6f43 Fix jsx indentation, closes #543 2020-09-10 12:18:29 +02:00
Adam Stankiewicz
fb7cf8a9ab Update 2020-09-10 10:30:32 +02:00
Adam Stankiewicz
19a69cf77d Remove debugging code... 2020-09-09 19:22:27 +02:00
Adam Stankiewicz
4f7a4036eb Finally fix issues with tab detection, #541 2020-09-09 19:08:17 +02:00
Adam Stankiewicz
0ff5d451b0 Fix b:sleuth_culprit for tabs 2020-09-09 18:31:30 +02:00
Adam Stankiewicz
49840b1893 Show full path in b:sleuth_culprit 2020-09-09 18:28:28 +02:00
Adam Stankiewicz
2dc954d6fa Last fixes to b:sleuth_culprit 2020-09-09 18:07:03 +02:00
Adam Stankiewicz
2369cd5d22 Make b:sleuth_culprit more readable 2020-09-09 18:02:38 +02:00
Adam Stankiewicz
46affb6153 Show warning if g:polyglot_disabled is not at the top of .vimrc 2020-09-09 17:50:40 +02:00
Adam Stankiewicz
a4cc3f64f9 Make it easier to debug indentation issues, #542 2020-09-09 17:39:27 +02:00
Adam Stankiewicz
2fe310256e Transcompile ..= operator to support old vims, fixes #542 2020-09-09 17:08:29 +02:00
Adam Stankiewicz
2e1a980632 Add missing functions from Sleuth, #541 2020-09-09 16:48:49 +02:00
Adam Stankiewicz
cecfb5dd10 Fix disabling autoindent, #541 2020-09-09 16:45:51 +02:00
Adam Stankiewicz
a4a9481d37 Fix disabling autoindent, closes #541 2020-09-09 11:58:24 +02:00
Adam Stankiewicz
5e5d127eb8 Add expect (fix tests) 2020-09-08 22:41:51 +02:00
Adam Stankiewicz
002573265a Fix some ftdetect issues from tests 2020-09-08 21:17:24 +02:00
Adam Stankiewicz
a4b91124a8 Fix auto-detecting indent, closes #540 2020-09-08 16:15:45 +02:00
Adam Stankiewicz
46040f3ffd Add heuristics for .h extension 2020-09-06 23:37:24 +02:00
Adam Stankiewicz
48254ec7ad Add more apache filetypes 2020-09-06 21:07:04 +02:00
Adam Stankiewicz
cd2fded0e0 Add support for Visual Basic and Basic 2020-09-06 20:51:38 +02:00
Adam Stankiewicz
255345bf95 Remove stephpy/vim-yaml syntax
It causes issues:
- https://github.com/dracula/vim/pull/163
- https://github.com/stephpy/vim-yaml/issues/22
2020-09-06 19:25:34 +02:00
Adam Stankiewicz
3169f80169 Remove empty blocks 2020-09-06 19:23:23 +02:00
Adam Stankiewicz
e9b3bcd5e1 Ensure duplicate tags do not happen in the future, #538 2020-09-06 19:20:23 +02:00
Adam Stankiewicz
d9ee362537 Fix weird indentation issue of yaml 2020-09-06 15:08:20 +02:00
Adam Stankiewicz
57badea2dc Ignore idris2 doc, fixes #538 2020-09-06 02:34:46 +02:00
CodingCellist
3baafd5c33 Add support for Idris2, closes #534 (#535) 2020-09-05 21:37:11 +02:00
Adam Stankiewicz
b0124dc880 Ignore files from homedir and root for indent
https://github.com/tpope/vim-sleuth/pull/57
2020-09-04 19:45:47 +02:00
Adam Stankiewicz
99166bd51f Do not set indent on by default
https://github.com/tpope/vim-sleuth/issues/21
2020-09-04 19:21:08 +02:00
Adam Stankiewicz
48b4f233c5 Fix detecting indentation in some CSS
This is done by ignoring lines that don't have any
alphanumeric characters, e.g. following would be detected
as 4-spaces indentation instead of 2-spaces

.android {
    height: 404px; width: 334px;
    margin: 100px auto;
  }

https://github.com/tpope/vim-sleuth/issues/22
2020-09-04 19:02:39 +02:00
Adam Stankiewicz
556ba05cee Ignore heredoc when detecting indent 2020-09-04 18:55:51 +02:00
Adam Stankiewicz
262960fa22 Synchronize shiftwidth with tabstop by default 2020-09-04 18:29:53 +02:00
Adam Stankiewicz
b2640b5b76 Fix detection of indentation, #537 2020-09-04 17:31:22 +02:00
Adam Stankiewicz
c30ba66d22 Let user select tabstop, by not changing it 2020-09-04 14:23:18 +02:00
Adam Stankiewicz
4df00e6574 Allow to disable autoindent with g:polyglot_disabled 2020-09-04 14:18:37 +02:00
Adam Stankiewicz
48f59577c8 Switch to neovim version of help filetype, fixes #536 2020-09-04 12:11:55 +02:00
Adam Stankiewicz
96179c95ba Update contribution info 2020-09-03 17:16:08 +02:00
Adam Stankiewicz
520389bbfd Add test for terraform 2020-09-03 05:38:07 +02:00
Adam Stankiewicz
7123e97498 Disable native autocommands when appropriate, fixes #533 2020-09-03 05:36:55 +02:00
Adam Stankiewicz
63119f09d1 Automatically detect indentation, closes #529 2020-09-01 23:38:17 +02:00
Adam Stankiewicz
f2ef4cedec Fix reason filetype detection, closes #532 2020-09-01 23:02:36 +02:00
Adam Stankiewicz
45c1923f43 Add sql support for javascript 2020-09-01 16:02:38 +02:00
Adam Stankiewicz
8dd0474feb Remove vim-sql-syntax, #528 2020-09-01 15:55:43 +02:00
Adam Stankiewicz
e166f741ef Some major updates including heuristics
- Allow to define heuristics in heuristics.yaml
- Migrate all filetypes from vim beginning with "a"
- Remove enhanced cpp syntax (it was too slow to load)
- Use setf instead of set ft for setting filetype (faster)
- Override native hauristics with au!
- Add globbing of files for packages
- Replace predefined dirs with extra_dirs and ignored_dirs
- Allow to define proper order of packages with topological sort
- Fix powershell detection
- Lint and fix many packages.yaml issues
- etc etd
2020-09-01 08:33:15 +02:00
Tim Bedard
d4fcef1aa8 add missing period to fix mako detection (#530) 2020-08-29 12:17:29 +02:00
Adam Stankiewicz
7972e8eea1 Build 2020-08-27 15:02:54 +02:00
Adam Stankiewicz
6ed481e463 Make sure all extensions are covered 2020-08-27 15:01:44 +02:00
183 changed files with 17953 additions and 5574 deletions

View File

@@ -2,17 +2,23 @@
name: Add language name: Add language
about: Add support for new language about: Add support for new language
title: '' title: ''
labels: '' labels: 'enhancement'
assignees: '' assignees: ''
--- ---
<!--- vim-polyglot accepts only lightweight, maintained github-hosted vim plugins --> **What is the name of this language in Linguist?**
<!-- https://github.com/github/linguist/blob/master/lib/linguist/languages.yml -->
**Link to GitHub repository of Vim plugin**
**GitHub repository url**
**Is this plugin well maintained?** **Is this plugin well maintained?**
**Is this plugin lightweight? (no advanced functionality, just indent and syntax support)** **Is this plugin lightweight? (no advanced functionality, just indent and syntax support)**

View File

@@ -1,20 +0,0 @@
---
name: Add support for language
about: ''
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -14,7 +14,7 @@ jobs:
run: | run: |
sudo add-apt-repository ppa:jonathonf/vim -y sudo add-apt-repository ppa:jonathonf/vim -y
sudo apt-get update -q sudo apt-get update -q
sudo apt-get install -y vim sudo apt-get install -y vim expect
vim --version vim --version
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Run Tests - name: Run Tests

View File

@@ -1,7 +1,10 @@
.PHONY: all .PHONY: build test dev
all: build:
@ scripts/build @ scripts/build
test: test:
@ scripts/test @ scripts/test
dev:
@ find scripts . -type f -depth 1 | DEV=1 entr bash -c 'make && make test'

388
README.md
View File

@@ -1,20 +1,20 @@
![vim-polyglot](https://i.imgur.com/9RxQK6k.png) ![vim-polyglot](https://i.imgur.com/9RxQK6k.png)
![build](https://github.com/sheerun/vim-polyglot/workflows/Vim%20Polyglot%20CI/badge.svg) [![Maintenance](https://img.shields.io/maintenance/yes/2020.svg?maxAge=2592000)]() ![build](https://github.com/sheerun/vim-polyglot/workflows/Vim%20Polyglot%20CI/badge.svg) [![Maintenance](https://img.shields.io/badge/maintained%20since-2013-yes)]()
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 scripts are loaded only on demand\*. - It **won't affect your startup time**, as scripts are loaded only on demand\*.
- It **installs and updates 120+ times faster** than the <!--Package Count-->155<!--/Package Count--> packages it consists of. - It **installs and updates 120+ times faster** than the <!--Package Count-->203<!--/Package Count--> packages it consists of.
- It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect). - It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect).
- Solid syntax and indentation support (other features skipped). Only the best language packs. - Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support). - All unnecessary files are ignored (like enormous documentation from php support).
- No support for esoteric languages, only most popular ones (modern too, like `slim`). - Automatically detect indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth))
- Each build is tested by automated vimrunner script on CI. See `spec` directory. - Each build is tested by automated vimrunner script on CI. See `spec` directory.
\*To be completely honest, optimized `ftdetect` script takes around `19ms` to load. \*To be completely honest, optimized `ftdetect` script takes around `10ms` to load.
## Installation ## Installation
@@ -43,161 +43,209 @@ If you need full functionality of any plugin, please use it directly with your p
## Language packs ## Language packs
<!--Language Packs--> <!--Language Packs-->
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl) (syntax) - [8th](https://github.com/vim/vim/tree/master/runtime)
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin) - [a2ps](https://github.com/vim/vim/tree/master/runtime)
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax, ctags) - [a65](https://github.com/vim/vim/tree/master/runtime)
- [applescript](https://github.com/mityu/vim-applescript) (syntax, indent) - [aap](https://github.com/vim/vim/tree/master/runtime)
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent) - [abap](https://github.com/vim/vim/tree/master/runtime)
- [asciidoc](https://github.com/asciidoc/vim-asciidoc) (syntax) - [abaqus](https://github.com/vim/vim/tree/master/runtime)
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey) (indent) - [abc](https://github.com/vim/vim/tree/master/runtime)
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin) - [abel](https://github.com/vim/vim/tree/master/runtime)
- [brewfile](https://github.com/bfontaine/Brewfile.vim) (syntax) - [acedb](https://github.com/vim/vim/tree/master/runtime)
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax) - [acpiasl](https://github.com/martinlroth/vim-acpi-asl)
- [c/c++](https://github.com/vim-jp/vim-cpp) (syntax) - [ada](https://github.com/vim/vim/tree/master/runtime)
- [caddyfile](https://github.com/isobit/vim-caddyfile) (syntax, indent, ftplugin) - [ahdl](https://github.com/vim/vim/tree/master/runtime)
- [carp](https://github.com/hellerve/carp-vim) (syntax) - [aidl](https://github.com/vim/vim/tree/master/runtime)
- [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin) - [alsaconf](https://github.com/vim/vim/tree/master/runtime)
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, doc, autoload, ftplugin) - [aml](https://github.com/vim/vim/tree/master/runtime)
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (syntax, indent) - [ampl](https://github.com/vim/vim/tree/master/runtime)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, doc, compiler, autoload, ftplugin) - [ansible](https://github.com/pearofducks/ansible-vim)
- [cql](https://github.com/elubow/cql-vim) (syntax) - [ant](https://github.com/vim/vim/tree/master/runtime)
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, doc, compiler, ftplugin) - [apache](https://github.com/vim/vim/tree/master/runtime)
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin) - [apiblueprint](https://github.com/kylef/apiblueprint.vim)
- [csv](https://github.com/chrisbra/csv.vim) (syntax, doc, autoload, ftplugin) - [applescript](https://github.com/mityu/vim-applescript)
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin) - [aptconf](https://github.com/vim/vim/tree/master/runtime)
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax) - [arch](https://github.com/vim/vim/tree/master/runtime)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, doc, autoload, ftplugin) - [arduino](https://github.com/sudar/vim-arduino-syntax)
- [dhall](https://github.com/vmchale/dhall-vim) (syntax, doc, ftplugin) - [art](https://github.com/vim/vim/tree/master/runtime)
- [dlang](https://github.com/JesseKPhillips/d.vim) (syntax, indent) - [asciidoc](https://github.com/asciidoc/vim-asciidoc)
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin) - [asn](https://github.com/vim/vim/tree/master/runtime)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, doc, compiler, autoload, ftplugin) - [aspperl](https://github.com/vim/vim/tree/master/runtime)
- [elm](https://github.com/andys8/vim-elm-syntax) (syntax, indent) - [aspvbs](https://github.com/vim/vim/tree/master/runtime)
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin) - [atlas](https://github.com/vim/vim/tree/master/runtime)
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin) - [autohotkey](https://github.com/hnamikaw/vim-autohotkey)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent) - [autoit](https://github.com/vim/vim/tree/master/runtime)
- [fennel](https://github.com/bakpakin/fennel.vim) (syntax, indent, ftplugin) - [automake](https://github.com/vim/vim/tree/master/runtime)
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax) - [ave](https://github.com/vim/vim/tree/master/runtime)
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin) - [awk](https://github.com/vim/vim/tree/master/runtime)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax) - [basic](https://github.com/vim/vim/tree/master/runtime)
- [fsharp](https://github.com/ionide/Ionide-vim) (syntax, indent, doc, autoload) - [blade](https://github.com/jwalton512/vim-blade)
- [gdscript](https://github.com/calviken/vim-gdscript3) (syntax, indent) - [brewfile](https://github.com/bfontaine/Brewfile.vim)
- [git](https://github.com/tpope/vim-git) (syntax, indent, doc, ftplugin) - [bzl](https://github.com/vim/vim/tree/master/runtime)
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent) - [c/c++](https://github.com/vim-jp/vim-cpp)
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax) - [caddyfile](https://github.com/isobit/vim-caddyfile)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax) - [carp](https://github.com/hellerve/carp-vim)
- [go](https://github.com/fatih/vim-go) (syntax, indent, doc, compiler) - [cjsx](https://github.com/mtscout6/vim-cjsx)
- [gradle](https://github.com/tfnico/vim-gradle) (compiler) - [clojure](https://github.com/guns/vim-clojure-static)
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after, doc) - [cmake](https://github.com/pboettch/vim-cmake-syntax)
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin) - [coffee-script](https://github.com/kchmck/vim-coffee-script)
- [handlebars](https://github.com/sheerun/vim-mustache-handlebars) (syntax, indent, ftplugin) - [conf](https://github.com/vim/vim/tree/master/runtime)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax) - [cpp-modern](https://github.com/bfrg/vim-cpp-modern)
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, doc, ftplugin) - [cql](https://github.com/elubow/cql-vim)
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax) - [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim)
- [hcl](https://github.com/b4b4r07/vim-hcl) (syntax, indent, ftplugin) - [crystal](https://github.com/rhysd/vim-crystal)
- [helm](https://github.com/towolf/vim-helm) (syntax) - [csv](https://github.com/chrisbra/csv.vim)
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin) - [cucumber](https://github.com/tpope/vim-cucumber)
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin) - [cue](https://github.com/mgrabovsky/vim-cuesheet)
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin) - [dart](https://github.com/dart-lang/dart-vim-plugin)
- [icalendar](https://github.com/chutzpah/icalendar.vim) (syntax) - [dhall](https://github.com/vmchale/dhall-vim)
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, doc, ftplugin) - [dlang](https://github.com/JesseKPhillips/d.vim)
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin) - [dockerfile](https://github.com/ekalinin/Dockerfile.vim)
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftplugin, extras) - [dosini](https://github.com/vim/vim/tree/master/runtime)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent) - [elf](https://github.com/vim/vim/tree/master/runtime)
- [jinja](https://github.com/lepture/vim-jinja) (syntax, indent) - [elixir](https://github.com/elixir-lang/vim-elixir)
- [jq](https://github.com/vito-c/jq.vim) (syntax, ftplugin) - [elm](https://github.com/andys8/vim-elm-syntax)
- [json5](https://github.com/GutenYe/json5.vim) (syntax) - [emberscript](https://github.com/yalesov/vim-ember-script)
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin) - [emblem](https://github.com/yalesov/vim-emblem)
- [jsonnet](https://github.com/google/vim-jsonnet) (syntax, doc, autoload, ftplugin) - [erlang](https://github.com/vim-erlang/vim-erlang-runtime)
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent) - [fennel](https://github.com/bakpakin/fennel.vim)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after, doc) - [ferm](https://github.com/vim-scripts/ferm.vim)
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, doc, autoload, ftplugin) - [fish](https://github.com/georgewitteman/vim-fish)
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin) - [flatbuffers](https://github.com/dcharbon/vim-flatbuffers)
- [ledger](https://github.com/ledger/vim-ledger) (syntax, indent, doc, compiler, autoload) - [forth](https://github.com/vim/vim/tree/master/runtime)
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin) - [fsharp](https://github.com/ionide/Ionide-vim)
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin) - [gdscript](https://github.com/calviken/vim-gdscript3)
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin) - [git](https://github.com/tpope/vim-git)
- [llvm](https://github.com/rhysd/vim-llvm) (syntax, indent, ftplugin) - [gitignore](https://github.com/fszymanski/fzf-gitignore)
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax, doc) - [glsl](https://github.com/tikhomirov/vim-glsl)
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent) - [gmpl](https://github.com/maelvalais/gmpl.vim)
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin) - [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting)
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent, doc, ftplugin) - [go](https://github.com/fatih/vim-go)
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin) - [gradle](https://github.com/tfnico/vim-gradle)
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax) - [graphql](https://github.com/jparise/vim-graphql)
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin) - [groovy](https://github.com/vim/vim/tree/master/runtime)
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin) - [grub](https://github.com/vim/vim/tree/master/runtime)
- [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin) - [haml](https://github.com/tpope/vim-haml)
- [nim](https://github.com/zah/nim.vim) (syntax, indent, compiler, autoload) - [handlebars](https://github.com/mustache/vim-mustache-handlebars)
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin) - [haproxy](https://github.com/CH-DanReif/haproxy.vim)
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent) - [haskell](https://github.com/neovimhaskell/haskell-vim)
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (syntax, indent, doc, compiler, ftplugin) - [haxe](https://github.com/yaymukund/vim-haxe)
- [octave](https://github.com/McSinyx/vim-octave) (syntax, indent) - [hcl](https://github.com/b4b4r07/vim-hcl)
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin) - [helm](https://github.com/towolf/vim-helm)
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin) - [help](https://github.com/neovim/neovim/tree/master/runtime)
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent, doc) - [hive](https://github.com/zebradil/hive.vim)
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [html5](https://github.com/othree/html5.vim)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin) - [htmldjango](https://github.com/vim/vim/tree/master/runtime)
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin) - [i3](https://github.com/mboughaba/i3config.vim)
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, doc, compiler, ftplugin) - [icalendar](https://github.com/chutzpah/icalendar.vim)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent) - [idris2](https://github.com/edwinb/idris2-vim)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin) - [idris](https://github.com/idris-hackers/idris-vim)
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, autoload, ftplugin, ctags) - [ion](https://github.com/vmchale/ion-vim)
- [purescript](https://github.com/purescript-contrib/purescript-vim) (syntax, indent, ftplugin) - [javascript-sql](https://github.com/statico/vim-javascript-sql)
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload) - [javascript](https://github.com/pangloss/vim-javascript)
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent) (indent) - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)
- [python](https://github.com/vim-python/python-syntax) (syntax, doc) - [jq](https://github.com/vito-c/jq.vim)
- [qmake](https://github.com/artoj/qmake-syntax-vim) (syntax) - [json5](https://github.com/GutenYe/json5.vim)
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin) - [json](https://github.com/elzr/vim-json)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax) - [jsonnet](https://github.com/google/vim-jsonnet)
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, ftplugin) - [jst](https://github.com/briancollins/vim-jst)
- [ragel](https://github.com/jneen/ragel.vim) (syntax) - [jsx](https://github.com/MaxMEllon/vim-jsx-pretty)
- [raku](https://github.com/Raku/vim-raku) (syntax, indent, ftplugin) - [julia](https://github.com/JuliaEditorSupport/julia-vim)
- [raml](https://github.com/IN3D/vim-raml) (syntax, doc, ftplugin) - [kotlin](https://github.com/udalov/kotlin-vim)
- [razor](https://github.com/adamclerk/vim-razor) (syntax, indent, ftplugin) - [ledger](https://github.com/ledger/vim-ledger)
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent, doc) - [less](https://github.com/vim/vim/tree/master/runtime)
- [requirements](https://github.com/raimon49/requirements.txt.vim) (syntax, autoload) - [lilypond](https://github.com/anowlcalledjosh/vim-lilypond)
- [rspec](https://github.com/keith/rspec.vim) (syntax) - [livescript](https://github.com/gkz/vim-ls)
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin) - [llvm](https://github.com/rhysd/vim-llvm)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, doc, compiler, autoload, ftplugin) - [log](https://github.com/MTDL9/vim-log-highlighting)
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, doc, compiler, autoload, ftplugin, ctags) - [lua](https://github.com/tbastos/vim-lua)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax) - [m4](https://github.com/vim/vim/tree/master/runtime)
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, doc, compiler, ftplugin, ctags) - [mako](https://github.com/sophacles/vim-bundle-mako)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin) - [markdown](https://github.com/plasticboy/vim-markdown)
- [sh](https://github.com/arzg/vim-sh) (syntax) - [mathematica](https://github.com/voldikss/vim-mma)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin) - [mdx](https://github.com/jxnblk/vim-mdx-js)
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent) - [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim)
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin) - [moonscript](https://github.com/leafo/moonscript-vim)
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin) - [murphi](https://github.com/vim/vim/tree/master/runtime)
- [sql](https://github.com/shmup/vim-sql-syntax) (syntax) - [nginx](https://github.com/chr4/nginx.vim)
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin) - [nim](https://github.com/zah/nim.vim)
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent, ftplugin) - [nix](https://github.com/LnL7/vim-nix)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent) - [objc](https://github.com/b4winckler/vim-objc)
- [svg](https://github.com/vim-scripts/svg.vim) (syntax) - [ocaml](https://github.com/rgrinberg/vim-ocaml)
- [swift](https://github.com/keith/swift.vim) (syntax, indent, compiler, ftplugin, ctags) - [octave](https://github.com/McSinyx/vim-octave)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax) - [odin](https://github.com/Tetralux/odin.vim)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax, ftplugin) - [opencl](https://github.com/petRUShka/vim-opencl)
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, doc, autoload, ftplugin) - [perl](https://github.com/vim-perl/vim-perl)
- [textile](https://github.com/timcharper/textile.vim) (syntax, doc, ftplugin) - [pgsql](https://github.com/lifepillar/pgsql.vim)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim)
- [tmux](https://github.com/ericpruitt/tmux.vim) (syntax, ftplugin) - [plantuml](https://github.com/aklt/plantuml-syntax)
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin) - [pony](https://github.com/jakwings/vim-pony)
- [tptp](https://github.com/c-cube/vim-tptp) (syntax) - [powershell](https://github.com/PProvost/vim-ps1)
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin) - [prolog](https://github.com/vim/vim/tree/master/runtime)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin, ctags) - [protobuf](https://github.com/uarun/vim-protobuf)
- [unison](https://github.com/unisonweb/unison) (syntax) - [pug](https://github.com/digitaltoad/vim-pug)
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin) - [puppet](https://github.com/rodjek/vim-puppet)
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin) - [purescript](https://github.com/purescript-contrib/purescript-vim)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax) - [python-compiler](https://github.com/aliev/vim-compiler-python)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax) - [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
- [velocity](https://github.com/lepture/vim-velocity) (syntax, indent) - [python](https://github.com/vim-python/python-syntax)
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin) - [qmake](https://github.com/artoj/qmake-syntax-vim)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (syntax) - [qml](https://github.com/peterhoeg/vim-qml)
- [xml](https://github.com/amadeus/vim-xml) (syntax) - [r-lang](https://github.com/vim-scripts/R.vim)
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (syntax) - [racket](https://github.com/wlangstroth/vim-racket)
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin) - [ragel](https://github.com/jneen/ragel.vim)
- [yard](https://github.com/sheerun/vim-yardoc) (syntax) - [raku](https://github.com/Raku/vim-raku)
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax) - [raml](https://github.com/IN3D/vim-raml)
- [zig](https://github.com/ziglang/zig.vim) (syntax, indent, autoload, ftplugin) - [razor](https://github.com/adamclerk/vim-razor)
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) (syntax) - [reason](https://github.com/reasonml-editor/vim-reason-plus)
- [requirements](https://github.com/raimon49/requirements.txt.vim)
- [rspec](https://github.com/keith/rspec.vim)
- [rst](https://github.com/marshallward/vim-restructuredtext)
- [ruby](https://github.com/vim-ruby/vim-ruby)
- [rust](https://github.com/rust-lang/rust.vim)
- [sbt](https://github.com/derekwyatt/vim-sbt)
- [scala](https://github.com/derekwyatt/vim-scala)
- [scss](https://github.com/cakebaker/scss-syntax.vim)
- [sh](https://github.com/arzg/vim-sh)
- [slim](https://github.com/slim-template/vim-slim)
- [slime](https://github.com/slime-lang/vim-slime-syntax)
- [smt2](https://github.com/bohlender/vim-smt2)
- [solidity](https://github.com/tomlion/vim-solidity)
- [sql](https://github.com/vim/vim/tree/master/runtime)
- [stylus](https://github.com/wavded/vim-stylus)
- [svelte](https://github.com/evanleck/vim-svelte/tree/main)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent)
- [svg](https://github.com/vim-scripts/svg.vim)
- [swift](https://github.com/keith/swift.vim)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax)
- [tads](https://github.com/vim/vim/tree/master/runtime)
- [terraform](https://github.com/hashivim/vim-terraform)
- [textile](https://github.com/timcharper/textile.vim)
- [thrift](https://github.com/solarnz/thrift.vim)
- [tmux](https://github.com/ericpruitt/tmux.vim/tree/master/vim)
- [toml](https://github.com/cespare/vim-toml)
- [tptp](https://github.com/c-cube/vim-tptp)
- [trasys](https://github.com/vim/vim/tree/master/runtime)
- [twig](https://github.com/lumiliet/vim-twig)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim)
- [v](https://github.com/ollykel/v-vim)
- [vala](https://github.com/arrufat/vala.vim)
- [vbnet](https://github.com/vim-scripts/vbnet.vim)
- [vcl](https://github.com/smerrill/vcl-vim-plugin)
- [velocity](https://github.com/lepture/vim-velocity)
- [visual-basic](https://github.com/vim/vim/tree/master/runtime)
- [vmasm](https://github.com/vim/vim/tree/master/runtime)
- [vue](https://github.com/posva/vim-vue)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax)
- [xml](https://github.com/amadeus/vim-xml)
- [xsl](https://github.com/vim-scripts/XSLT-syntax)
- [yaml](https://github.com/vim/vim/tree/df44a27b53586fccfc6a3aedc89061fdd9a515ff/runtime)
- [yard](https://github.com/noprompt/vim-yardoc)
- [zephir](https://github.com/xwsoul/vim-zephir)
- [zig](https://github.com/ziglang/zig.vim)
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax)
<!--/Language Packs--> <!--/Language Packs-->
## Updating ## Updating
@@ -210,19 +258,33 @@ Please make sure you have `syntax on` in your `.vimrc` (or use something like [s
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows: Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
```viml ```vim
let g:polyglot_disabled = ['css'] let g:polyglot_disabled = ['markdown']
``` ```
The list of available languages to disable is shown above.
*Please declare this variable before polyglot is loaded (at the top of .vimrc)* *Please declare this variable before polyglot is loaded (at the top of .vimrc)*
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are loaded lazily, on demand. If you wish to use filetype detection by Vim Polyglot but you'd like to use your own syntax-highlighting plugin, you can append `.plugin` to disabled entry, like below. Disabling Vim Polyglot filetype plugin won't disable native Vim filetype plugin.
```vim
let g:polyglot_disabled = ['markdown.plugin']
```
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are lazily loaded only when they are really needed.
Vim Polyglot tries to automatically detect indentation settings (just like vim-sleuth). If this feature is not working for you for some reason, please file an issue and disable it temporarily with:
```vim
let g:polyglot_disabled = ['autoindent']
```
## Contributing ## Contributing
Language packs are periodically updated using automated `scripts/build` script. Language packs are periodically updated using automated `scripts/build` script.
Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `make` and include that in your PR, send just changes to `packages.yaml` and build scripts if really necessary. You can run `make test` to run rough tests. Feel free to add your language to `packages.yaml` + `heuristics.yaml`, and send pull-request. You can run `make test` to run rough tests. And `make dev` for easy development.
## License ## License

View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
setlocal iskeyword+='
endif

View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" Vim filetype plugin file
" Language: JavaScript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
setlocal iskeyword+=$ suffixesadd+=.js
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
endif

View File

@@ -0,0 +1,9 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
if get(g:, 'vim_jsx_pretty_disable_js', 0)
finish
endif
source <sfile>:h/jsx.vim
endif

View File

@@ -1,51 +1,3 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 " Polyglot metafile
source <sfile>:h/javascript-1.vim
" Vim filetype plugin file source <sfile>:h/javascript-2.vim
" Language: JavaScript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
setlocal iskeyword+=$ suffixesadd+=.js
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
endif
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftplugin file
"
" Language: javascript.jsx
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:jsx_pretty_old_cms = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
augroup end
setlocal suffixesadd+=.jsx
endif

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim source <sfile>:h/jsx.vim
endif endif

35
after/ftplugin/jsx.vim Normal file
View File

@@ -0,0 +1,35 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftplugin file
"
" Language: javascript.jsx
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:jsx_pretty_old_cms = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
augroup end
setlocal suffixesadd+=.jsx
endif

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
" modified from html.vim " modified from html.vim
" For matchit plugin " For matchit plugin

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/tsx.vim source <sfile>:h/tsx.vim

View File

@@ -1,11 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
" Vim indent file
" Language: Yaml
" Author: Henrique Barcelos
" Date: 2014-10-08
" URL: https://github.com/hjpbarcelos
setlocal autoindent sw=2 ts=2 expandtab
" vim:set sw=2:
endif

View File

@@ -1,33 +1,9 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" if get(g:, 'vim_jsx_pretty_disable_js', 0)
" Vim indent file finish
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif endif
let s:keepcpo = &cpo source <sfile>:h/jsx.vim
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
endif endif

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim source <sfile>:h/jsx.vim
endif endif

33
after/indent/jsx.vim Normal file
View File

@@ -0,0 +1,33 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif
let s:keepcpo = &cpo
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
endif

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file " Vim indent file

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/tsx.vim source <sfile>:h/tsx.vim

View File

@@ -1,321 +1,74 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') == -1
" ==============================================================================
" Vim syntax file " Vim syntax file
" Language: C Additions " Language: C Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com> " Original Author: Mikhail Wolfson <mywolfson@gmail.com>
" Contributor: Mikhail Wolfson <mywolfson@gmail.com> " http://www.vim.org/scripts/script.php?script_id=3064
" URL: http://www.haeggblad.com " Maintainer: bfrg <bfrg@users.noreply.github.com>
" Last Change: 6 Sep 2014 " Website: https://github.com/bfrg/vim-cpp-modern
" Version: 0.3 " Last Change: Mar 14, 2020
" Changelog:
" 0.3 - integration of aftersyntaxc.vim
" 0.2 - Cleanup
" 0.1 - initial version.
" "
" Syntax highlighting for functions in C. " Extended C syntax highlighting including highlighting of user-defined
" functions.
" "
" Based on: " This syntax file is based on:
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim " https://github.com/octol/vim-cpp-enhanced-highlight
" ==============================================================================
" -----------------------------------------------------------------------------
" Highlight function names. " Highlight some additional keywords in the comments
" ----------------------------------------------------------------------------- syn keyword cTodo contained BUG NOTE
if !exists('g:cpp_no_function_highlight')
syn match cCustomParen transparent "(" contains=cParen contains=cCppParen
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen " Highlight function names
hi def link cCustomFunc Function if !get(g:, 'cpp_no_function_highlight', 0)
syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cParen,cCppParen
hi def link cUserFunction Function
endif endif
" -----------------------------------------------------------------------------
" Highlight member variable names.
" -----------------------------------------------------------------------------
if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
syn match cCustomDot "\." contained
syn match cCustomPtr "->" contained
syn match cCustomMemVar "\(\.\|->\)\h\w*" contains=cCustomDot,cCustomPtr
hi def link cCustomMemVar Function
endif
" -----------------------------------------------------------------------------
" Highlight POSIX functions.
" -----------------------------------------------------------------------------
if exists('g:cpp_posix_standard') && g:cpp_posix_standard
syn keyword cPOSIXFunction socket accept bind connect getsockname
syn keyword cPOSIXFunction listen recv recvfrom recvmsg
syn keyword cPOSIXFunction send sendto sendmsg setsockopt socketpair
syn keyword cPOSIXFunction htonl htons ntohl ntohs
syn keyword cPOSIXFunction inet_ntop inet_pton getaddrinfo
syn keyword cPOSIXFunction poll select pselect
hi def link cPOSIXFunction Function
endif
" -----------------------------------------------------------------------------
" Source: aftersyntaxc.vim
" -----------------------------------------------------------------------------
" Common ANSI-standard functions
syn keyword cAnsiFunction MULU_ DIVU_ MODU_ MUL_ DIV_ MOD_
syn keyword cAnsiFunction main typeof
syn keyword cAnsiFunction open close read write lseek dup dup2
syn keyword cAnsiFunction fcntl ioctl
syn keyword cAnsiFunction wctrans towctrans towupper
syn keyword cAnsiFunction towlower wctype iswctype
syn keyword cAnsiFunction iswxdigit iswupper iswspace
syn keyword cAnsiFunction iswpunct iswprint iswlower
syn keyword cAnsiFunction iswgraph iswdigit iswcntrl
syn keyword cAnsiFunction iswalpha iswalnum wcsrtombs
syn keyword cAnsiFunction mbsrtowcs wcrtomb mbrtowc
syn keyword cAnsiFunction mbrlen mbsinit wctob
syn keyword cAnsiFunction btowc wcsfxtime wcsftime
syn keyword cAnsiFunction wmemset wmemmove wmemcpy
syn keyword cAnsiFunction wmemcmp wmemchr wcstok
syn keyword cAnsiFunction wcsstr wcsspn wcsrchr
syn keyword cAnsiFunction wcspbrk wcslen wcscspn
syn keyword cAnsiFunction wcschr wcsxfrm wcsncmp
syn keyword cAnsiFunction wcscoll wcscmp wcsncat
syn keyword cAnsiFunction wcscat wcsncpy wcscpy
syn keyword cAnsiFunction wcstoull wcstoul wcstoll
syn keyword cAnsiFunction wcstol wcstold wcstof
syn keyword cAnsiFunction wcstod ungetwc putwchar
syn keyword cAnsiFunction putwc getwchar getwc
syn keyword cAnsiFunction fwide fputws fputwc
syn keyword cAnsiFunction fgetws fgetwc wscanf
syn keyword cAnsiFunction wprintf vwscanf vwprintf
syn keyword cAnsiFunction vswscanf vswprintf vfwscanf
syn keyword cAnsiFunction vfwprintf swscanf swprintf
syn keyword cAnsiFunction fwscanf fwprintf zonetime
syn keyword cAnsiFunction strfxtime strftime localtime
syn keyword cAnsiFunction gmtime ctime asctime
syn keyword cAnsiFunction time mkxtime mktime
syn keyword cAnsiFunction difftime clock strlen
syn keyword cAnsiFunction strerror memset strtok
syn keyword cAnsiFunction strstr strspn strrchr
syn keyword cAnsiFunction strpbrk strcspn strchr
syn keyword cAnsiFunction memchr strxfrm strncmp
syn keyword cAnsiFunction strcoll strcmp memcmp
syn keyword cAnsiFunction strncat strcat strncpy
syn keyword cAnsiFunction strcpy memmove memcpy
syn keyword cAnsiFunction wcstombs mbstowcs wctomb
syn keyword cAnsiFunction mbtowc mblen lldiv
syn keyword cAnsiFunction ldiv div llabs
syn keyword cAnsiFunction labs abs qsort
"syn keyword cAnsiFunction bsearch system getenv
syn keyword cAnsiFunction bsearch getenv
syn keyword cAnsiFunction exit atexit abort
syn keyword cAnsiFunction realloc malloc free
syn keyword cAnsiFunction calloc srand rand
syn keyword cAnsiFunction strtoull strtoul strtoll
syn keyword cAnsiFunction strtol strtold strtof
syn keyword cAnsiFunction strtod atoll atol
syn keyword cAnsiFunction atoi atof perror
syn keyword cAnsiFunction ferror feof clearerr
syn keyword cAnsiFunction rewind ftell fsetpos
syn keyword cAnsiFunction fseek fgetpos fwrite
syn keyword cAnsiFunction fread ungetc puts
syn keyword cAnsiFunction putchar putc gets
syn keyword cAnsiFunction getchar getc fputs
syn keyword cAnsiFunction fputc fgets fgetc
syn keyword cAnsiFunction vsscanf vsprintf vsnprintf
syn keyword cAnsiFunction vscanf vprintf vfscanf
syn keyword cAnsiFunction vfprintf sscanf sprintf
syn keyword cAnsiFunction snprintf scanf printf
syn keyword cAnsiFunction fscanf fprintf setvbuf
syn keyword cAnsiFunction setbuf freopen fopen
syn keyword cAnsiFunction fflush fclose tmpnam
syn keyword cAnsiFunction tmpfile rename remove
syn keyword cAnsiFunction offsetof va_start va_end
syn keyword cAnsiFunction va_copy va_arg raise signal
syn keyword cAnsiFunction longjmp setjmp isunordered
syn keyword cAnsiFunction islessgreater islessequal isless
syn keyword cAnsiFunction isgreaterequal isgreater fmal
syn keyword cAnsiFunction fmaf fma fminl
syn keyword cAnsiFunction fminf fmin fmaxl
syn keyword cAnsiFunction fmaxf fmax fdiml
syn keyword cAnsiFunction fdimf fdim nextafterxl
syn keyword cAnsiFunction nextafterxf nextafterx nextafterl
syn keyword cAnsiFunction nextafterf nextafter nanl
syn keyword cAnsiFunction nanf nan copysignl
syn keyword cAnsiFunction copysignf copysign remquol
syn keyword cAnsiFunction remquof remquo remainderl
syn keyword cAnsiFunction remainderf remainder fmodl
syn keyword cAnsiFunction fmodf fmod truncl
syn keyword cAnsiFunction truncf trunc llroundl
syn keyword cAnsiFunction llroundf llround lroundl
syn keyword cAnsiFunction lroundf lround roundl
syn keyword cAnsiFunction roundf round llrintl
syn keyword cAnsiFunction llrintf llrint lrintl
syn keyword cAnsiFunction lrintf lrint rintl
syn keyword cAnsiFunction rintf rint nearbyintl
syn keyword cAnsiFunction nearbyintf nearbyint floorl
syn keyword cAnsiFunction floorf floor ceill
syn keyword cAnsiFunction ceilf ceil tgammal
syn keyword cAnsiFunction tgammaf tgamma lgammal
syn keyword cAnsiFunction lgammaf lgamma erfcl
syn keyword cAnsiFunction erfcf erfc erfl
syn keyword cAnsiFunction erff erf sqrtl
syn keyword cAnsiFunction sqrtf sqrt powl
syn keyword cAnsiFunction powf pow hypotl
syn keyword cAnsiFunction hypotf hypot fabsl
syn keyword cAnsiFunction fabsf fabs cbrtl
syn keyword cAnsiFunction cbrtf cbrt scalblnl
syn keyword cAnsiFunction scalblnf scalbln scalbnl
syn keyword cAnsiFunction scalbnf scalbn modfl
syn keyword cAnsiFunction modff modf logbl
syn keyword cAnsiFunction logbf logb log2l
syn keyword cAnsiFunction log2f log2 log1pl
syn keyword cAnsiFunction log1pf log1p log10l
syn keyword cAnsiFunction log10f log10 logl
syn keyword cAnsiFunction logf log ldexpl
syn keyword cAnsiFunction ldexpf ldexp ilogbl
syn keyword cAnsiFunction ilogbf ilogb frexpl
syn keyword cAnsiFunction frexpf frexp expm1l
syn keyword cAnsiFunction expm1f expm1 exp2l
syn keyword cAnsiFunction exp2f exp2 expl
syn keyword cAnsiFunction expf exp tanhl
syn keyword cAnsiFunction tanhf tanh sinhl
syn keyword cAnsiFunction sinhf sinh coshl
syn keyword cAnsiFunction coshf cosh atanhl
syn keyword cAnsiFunction atanhf atanh asinhl
syn keyword cAnsiFunction asinhf asinh acoshl
syn keyword cAnsiFunction acoshf acosh tanl
syn keyword cAnsiFunction tanf tan sinl
syn keyword cAnsiFunction sinf sin cosl
syn keyword cAnsiFunction cosf cos atan2l
syn keyword cAnsiFunction atan2f atan2 atanl
syn keyword cAnsiFunction atanf atan asinl
syn keyword cAnsiFunction asinf asin acosl
syn keyword cAnsiFunction acosf acos signbit
syn keyword cAnsiFunction isnormal isnan isinf
syn keyword cAnsiFunction isfinite fpclassify localeconv
syn keyword cAnsiFunction setlocale wcstoumax wcstoimax
syn keyword cAnsiFunction strtoumax strtoimax feupdateenv
syn keyword cAnsiFunction fesetenv feholdexcept fegetenv
syn keyword cAnsiFunction fesetround fegetround fetestexcept
syn keyword cAnsiFunction fesetexceptflag feraiseexcept fegetexceptflag
syn keyword cAnsiFunction feclearexcept toupper tolower
syn keyword cAnsiFunction isxdigit isupper isspace
syn keyword cAnsiFunction ispunct isprint islower
syn keyword cAnsiFunction isgraph isdigit iscntrl
syn keyword cAnsiFunction isalpha isalnum creall
syn keyword cAnsiFunction crealf creal cprojl
syn keyword cAnsiFunction cprojf cproj conjl
syn keyword cAnsiFunction conjf conj cimagl
syn keyword cAnsiFunction cimagf cimag cargl
syn keyword cAnsiFunction cargf carg csqrtl
syn keyword cAnsiFunction csqrtf csqrt cpowl
syn keyword cAnsiFunction cpowf cpow cabsl
syn keyword cAnsiFunction cabsf cabs clogl
syn keyword cAnsiFunction clogf clog cexpl
syn keyword cAnsiFunction cexpf cexp ctanhl
syn keyword cAnsiFunction ctanhf ctanh csinhl
syn keyword cAnsiFunction csinhf csinh ccoshl
syn keyword cAnsiFunction ccoshf ccosh catanhl
syn keyword cAnsiFunction catanhf catanh casinhl
syn keyword cAnsiFunction casinhf casinh cacoshl
syn keyword cAnsiFunction cacoshf cacosh ctanl
syn keyword cAnsiFunction ctanf ctan csinl
syn keyword cAnsiFunction csinf csin ccosl
syn keyword cAnsiFunction ccosf ccos catanl
syn keyword cAnsiFunction catanf catan casinl
syn keyword cAnsiFunction casinf casin cacosl
syn keyword cAnsiFunction cacosf cacos assert
syn keyword cAnsiFunction UINTMAX_C INTMAX_C UINT64_C
syn keyword cAnsiFunction UINT32_C UINT16_C UINT8_C
syn keyword cAnsiFunction INT64_C INT32_C INT16_C INT8_C
" Common ANSI-standard Names " Common ANSI-standard Names
syn keyword cAnsiName PRId8 PRIi16 PRIo32 PRIu64 syn keyword cAnsiName
syn keyword cAnsiName PRId16 PRIi32 PRIo64 PRIuLEAST8 \ PRId8 PRIi16 PRIo32 PRIu64 PRId16 PRIi32 PRIo64 PRIuLEAST8 PRId32 PRIi64 PRIoLEAST8 PRIuLEAST16 PRId64 PRIiLEAST8 PRIoLEAST16 PRIuLEAST32 PRIdLEAST8 PRIiLEAST16 PRIoLEAST32 PRIuLEAST64 PRIdLEAST16 PRIiLEAST32 PRIoLEAST64 PRIuFAST8 PRIdLEAST32 PRIiLEAST64 PRIoFAST8 PRIuFAST16 PRIdLEAST64 PRIiFAST8 PRIoFAST16 PRIuFAST32 PRIdFAST8 PRIiFAST16 PRIoFAST32 PRIuFAST64 PRIdFAST16 PRIiFAST32 PRIoFAST64 PRIuMAX PRIdFAST32 PRIiFAST64 PRIoMAX PRIuPTR PRIdFAST64 PRIiMAX PRIoPTR PRIx8 PRIdMAX PRIiPTR PRIu8 PRIx16 PRIdPTR PRIo8 PRIu16 PRIx32 PRIi8 PRIo16 PRIu32 PRIx64 PRIxLEAST8 SCNd8 SCNiFAST32 SCNuLEAST32 PRIxLEAST16 SCNd16 SCNiFAST64 SCNuLEAST64 PRIxLEAST32 SCNd32 SCNiMAX SCNuFAST8 PRIxLEAST64 SCNd64 SCNiPTR SCNuFAST16 PRIxFAST8 SCNdLEAST8 SCNo8 SCNuFAST32 PRIxFAST16 SCNdLEAST16 SCNo16 SCNuFAST64 PRIxFAST32 SCNdLEAST32 SCNo32 SCNuMAX PRIxFAST64 SCNdLEAST64 SCNo64 SCNuPTR PRIxMAX SCNdFAST8 SCNoLEAST8 SCNx8 PRIxPTR SCNdFAST16 SCNoLEAST16 SCNx16 PRIX8 SCNdFAST32 SCNoLEAST32 SCNx32 PRIX16 SCNdFAST64 SCNoLEAST64 SCNx64 PRIX32 SCNdMAX SCNoFAST8 SCNxLEAST8 PRIX64 SCNdPTR SCNoFAST16 SCNxLEAST16 PRIXLEAST8 SCNi8 SCNoFAST32 SCNxLEAST32 PRIXLEAST16 SCNi16 SCNoFAST64 SCNxLEAST64 PRIXLEAST32 SCNi32 SCNoMAX SCNxFAST8 PRIXLEAST64 SCNi64 SCNoPTR SCNxFAST16 PRIXFAST8 SCNiLEAST8 SCNu8 SCNxFAST32 PRIXFAST16 SCNiLEAST16 SCNu16 SCNxFAST64 PRIXFAST32 SCNiLEAST32 SCNu32 SCNxMAX PRIXFAST64 SCNiLEAST64 SCNu64 SCNxPTR PRIXMAX SCNiFAST8 SCNuLEAST8 PRIXPTR SCNiFAST16 SCNuLEAST16 STDC CX_LIMITED_RANGE STDC FENV_ACCESS STDC FP_CONTRACT
syn keyword cAnsiName PRId32 PRIi64 PRIoLEAST8 PRIuLEAST16 \ errno environ and bitor not_eq xor and_eq compl or xor_eq bitand not or_eq
syn keyword cAnsiName PRId64 PRIiLEAST8 PRIoLEAST16 PRIuLEAST32
syn keyword cAnsiName PRIdLEAST8 PRIiLEAST16 PRIoLEAST32 PRIuLEAST64
syn keyword cAnsiName PRIdLEAST16 PRIiLEAST32 PRIoLEAST64 PRIuFAST8
syn keyword cAnsiName PRIdLEAST32 PRIiLEAST64 PRIoFAST8 PRIuFAST16
syn keyword cAnsiName PRIdLEAST64 PRIiFAST8 PRIoFAST16 PRIuFAST32
syn keyword cAnsiName PRIdFAST8 PRIiFAST16 PRIoFAST32 PRIuFAST64
syn keyword cAnsiName PRIdFAST16 PRIiFAST32 PRIoFAST64 PRIuMAX
syn keyword cAnsiName PRIdFAST32 PRIiFAST64 PRIoMAX PRIuPTR
syn keyword cAnsiName PRIdFAST64 PRIiMAX PRIoPTR PRIx8
syn keyword cAnsiName PRIdMAX PRIiPTR PRIu8 PRIx16
syn keyword cAnsiName PRIdPTR PRIo8 PRIu16 PRIx32
syn keyword cAnsiName PRIi8 PRIo16 PRIu32 PRIx64
syn keyword cAnsiName PRIxLEAST8 SCNd8 SCNiFAST32 SCNuLEAST32
syn keyword cAnsiName PRIxLEAST16 SCNd16 SCNiFAST64 SCNuLEAST64
syn keyword cAnsiName PRIxLEAST32 SCNd32 SCNiMAX SCNuFAST8
syn keyword cAnsiName PRIxLEAST64 SCNd64 SCNiPTR SCNuFAST16
syn keyword cAnsiName PRIxFAST8 SCNdLEAST8 SCNo8 SCNuFAST32
syn keyword cAnsiName PRIxFAST16 SCNdLEAST16 SCNo16 SCNuFAST64
syn keyword cAnsiName PRIxFAST32 SCNdLEAST32 SCNo32 SCNuMAX
syn keyword cAnsiName PRIxFAST64 SCNdLEAST64 SCNo64 SCNuPTR
syn keyword cAnsiName PRIxMAX SCNdFAST8 SCNoLEAST8 SCNx8
syn keyword cAnsiName PRIxPTR SCNdFAST16 SCNoLEAST16 SCNx16
syn keyword cAnsiName PRIX8 SCNdFAST32 SCNoLEAST32 SCNx32
syn keyword cAnsiName PRIX16 SCNdFAST64 SCNoLEAST64 SCNx64
syn keyword cAnsiName PRIX32 SCNdMAX SCNoFAST8 SCNxLEAST8
syn keyword cAnsiName PRIX64 SCNdPTR SCNoFAST16 SCNxLEAST16
syn keyword cAnsiName PRIXLEAST8 SCNi8 SCNoFAST32 SCNxLEAST32
syn keyword cAnsiName PRIXLEAST16 SCNi16 SCNoFAST64 SCNxLEAST64
syn keyword cAnsiName PRIXLEAST32 SCNi32 SCNoMAX SCNxFAST8
syn keyword cAnsiName PRIXLEAST64 SCNi64 SCNoPTR SCNxFAST16
syn keyword cAnsiName PRIXFAST8 SCNiLEAST8 SCNu8 SCNxFAST32
syn keyword cAnsiName PRIXFAST16 SCNiLEAST16 SCNu16 SCNxFAST64
syn keyword cAnsiName PRIXFAST32 SCNiLEAST32 SCNu32 SCNxMAX
syn keyword cAnsiName PRIXFAST64 SCNiLEAST64 SCNu64 SCNxPTR
syn keyword cAnsiName PRIXMAX SCNiFAST8 SCNuLEAST8
syn keyword cAnsiName PRIXPTR SCNiFAST16 SCNuLEAST16
syn keyword cAnsiName errno environ
syn keyword cAnsiName STDC CX_LIMITED_RANGE
syn keyword cAnsiName STDC FENV_ACCESS
syn keyword cAnsiName STDC FP_CONTRACT
syn keyword cAnsiName and bitor not_eq xor
syn keyword cAnsiName and_eq compl or xor_eq
syn keyword cAnsiName bitand not or_eq
hi def link cAnsiFunction cFunction
hi def link cAnsiName cIdentifier
hi def link cFunction Function
hi def link cIdentifier Identifier
" Booleans " Booleans
syn keyword cBoolean true false TRUE FALSE syn keyword cBoolean true false TRUE FALSE
hi def link cBoolean Boolean
" -----------------------------------------------------------------------------
" Additional optional highlighting " Default highlighting
" ----------------------------------------------------------------------------- hi def link cBoolean Boolean
hi def link cAnsiName Identifier
" Highlight all standard C keywords as Statement
" This is very similar to what other IDEs and editors do
if get(g:, 'cpp_simple_highlight', 0)
hi link cStorageClass Statement
hi link cStructure Statement
hi link cLabel Statement
endif
" Operators " Operators
"syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)=" " syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
"syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->" " syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
"syn match cOperator "[.!~*&%<>^|=,+-]" " syn match cOperator "[.!~*&%<>^|=,+-]"
"syn match cOperator "/[^/*=]"me=e-1 " syn match cOperator "/[^/*=]"me=e-1
"syn match cOperator "/$" " syn match cOperator "/$"
"syn match cOperator "&&\|||" " syn match cOperator "&&\|||"
"syn match cOperator "[][]" " syn match cOperator "[][]"
"
"" Preprocs
"syn keyword cDefined defined contained containedin=cDefine
"hi def link cDefined cDefine
"" Functions " Preprocessor
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine " syn keyword cDefined defined contained containedin=cDefine
"syn match cUserFunctionPointer "(\s*\*\s*\h\w*\s*)\(\s\|\n\)*(" contains=cDelimiter,cOperator " hi def link cDefined cDefine
"
"hi def link cUserFunction cFunction
"hi def link cUserFunctionPointer cFunction
"
"" Delimiters
"syn match cDelimiter "[();\\]"
"" foldmethod=syntax fix, courtesy of Ivan Freitas
"syn match cBraces display "[{}]"
" Links " Delimiters
"hi def link cDelimiter Delimiter " syn match cDelimiter "[();\\]"
" hi def link cDelimiter Delimiter
" foldmethod=syntax fix, courtesy of Ivan Freitas " foldmethod=syntax fix, courtesy of Ivan Freitas
"hi def link cBraces Delimiter " syn match cBraces display "[{}]"
" hi def link cBraces Delimiter
endif endif

File diff suppressed because it is too large Load Diff

82
after/syntax/idris2.vim Normal file
View File

@@ -0,0 +1,82 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
" This script allows for unicode concealing of certain characters
" For instance -> goes to →
"
" It needs vim >= 7.3, set nocompatible, set enc=utf-8
"
" If you want to turn this on, let g:idris_conceal = 1
if !exists('g:idris_conceal') || !has('conceal') || &enc != 'utf-8'
finish
endif
" vim: set fenc=utf-8:
syntax match idrNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ
syntax match idrNiceOperator "<-" conceal cchar=
syntax match idrNiceOperator "->" conceal cchar=
syntax match idrNiceOperator "\<sum\>" conceal cchar=
syntax match idrNiceOperator "\<product\>" conceal cchar=
syntax match idrNiceOperator "\<sqrt\>" conceal cchar=
syntax match idrNiceOperator "\<pi\>" conceal cchar=π
syntax match idrNiceOperator "==" conceal cchar=
syntax match idrNiceOperator "\/=" conceal cchar=
let s:extraConceal = 1
let s:doubleArrow = 1
" Set this to 0 to use the more technically correct arrow from bar
" Some windows font don't support some of the characters,
" so if they are the main font, we don't load them :)
if has("win32")
let s:incompleteFont = [ 'Consolas'
\ , 'Lucida Console'
\ , 'Courier New'
\ ]
let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '')
for s:fontName in s:incompleteFont
if s:mainfont ==? s:fontName
let s:extraConceal = 0
break
endif
endfor
endif
if s:extraConceal
syntax match idrNiceOperator "Void" conceal cchar=
" Match greater than and lower than w/o messing with Kleisli composition
syntax match idrNiceOperator "<=\ze[^<]" conceal cchar=
syntax match idrNiceOperator ">=\ze[^>]" conceal cchar=
if s:doubleArrow
syntax match idrNiceOperator "=>" conceal cchar=
else
syntax match idrNiceOperator "=>" conceal cchar=
endif
syntax match idrNiceOperator "=\zs<<" conceal cchar=«
syntax match idrNiceOperator "++" conceal cchar=
syntax match idrNiceOperator "::" conceal cchar=
syntax match idrNiceOperator "-<" conceal cchar=
syntax match idrNiceOperator ">-" conceal cchar=
syntax match idrNiceOperator "-<<" conceal cchar=
syntax match idrNiceOperator ">>-" conceal cchar=
" Only replace the dot, avoid taking spaces around.
syntax match idrNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=
syntax match idrNiceOperator "\.\." conceal cchar=
syntax match idrNiceOperator "`elem`" conceal cchar=
syntax match idrNiceOperator "`notElem`" conceal cchar=
endif
hi link idrNiceOperator Operator
hi! link Conceal Operator
setlocal conceallevel=2
endif

View File

@@ -1,59 +1,9 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" if get(g:, 'vim_jsx_pretty_disable_js', 0)
" Vim syntax file finish
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif endif
if exists('s:current_syntax') source <sfile>:h/jsx.vim
let b:current_syntax = s:current_syntax
endif
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
syntax cluster jsExpression add=jsxRegion
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
" refine the javascript line comment
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
syntax cluster javascriptValue add=jsxRegion
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
else " build-in javascript syntax
" refine the javascript line comment
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
" refine the template string syntax
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
" add a javaScriptBlock group for build-in syntax
syntax region javaScriptBlock
\ matchgroup=javaScriptBraces
\ start="{"
\ end="}"
\ contained
\ extend
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
\ fold
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
endif
runtime syntax/jsx_pretty.vim
let b:current_syntax = 'javascript.jsx'
let &cpo = s:jsx_cpo
unlet s:jsx_cpo
endif endif

View File

@@ -0,0 +1,26 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript-sql') == -1
" Vim plugin
" Language: JavaScript
" Maintainer: Ian Langworth <ian@langworth.com>
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
exec 'syntax include @SQLSyntax syntax/' . g:javascript_sql_dialect . '.vim'
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region sqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@SQLSyntax,jsTemplateExpression,jsSpecial extend
exec 'syntax match sqlTaggedTemplate +\%(SQL\)\%(`\)\@=+ nextgroup=sqlTemplateString'
hi def link sqlTemplateString jsTemplateString
hi def link sqlTaggedTemplate jsTaggedTemplate
syn cluster jsExpression add=sqlTaggedTemplate
syn cluster sqlTaggedTemplate add=sqlTemplateString
endif

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim source <sfile>:h/jsx.vim
endif endif

59
after/syntax/jsx.vim Normal file
View File

@@ -0,0 +1,59 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
syntax cluster jsExpression add=jsxRegion
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
" refine the javascript line comment
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
syntax cluster javascriptValue add=jsxRegion
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
else " build-in javascript syntax
" refine the javascript line comment
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
" refine the template string syntax
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
" add a javaScriptBlock group for build-in syntax
syntax region javaScriptBlock
\ matchgroup=javaScriptBraces
\ start="{"
\ end="}"
\ contained
\ extend
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
\ fold
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
endif
runtime syntax/jsx_pretty.vim
let b:current_syntax = 'javascript.jsx'
let &cpo = s:jsx_cpo
unlet s:jsx_cpo
endif

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0) let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)

View File

@@ -32,6 +32,6 @@ if exists('s:current_syntax')
let b:current_syntax = s:current_syntax let b:current_syntax = s:current_syntax
endif endif
syntax region graphqlMultilineString matchgroup=reasonMultilineString start=+graphql\_s*\zs{|+ end=+|}+ contains=@GraphQLSyntax,reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation keepend syntax region graphqlExtensionPoint matchgroup=Noise start=+\[%graphql\_s*{|+lc=10 end=+|}\_s*]+he=s+1 contains=@GraphQLSyntax keepend
endif endif

View File

@@ -22,6 +22,7 @@ syn match yardNote "@note" contained
syn match yardOption "@option" contained syn match yardOption "@option" contained
syn match yardOverload "@overload" contained syn match yardOverload "@overload" contained
syn match yardParam "@param" contained syn match yardParam "@param" contained
syn match yardParamName /@param \h\+/hs=s+7 contained contains=yardParam
syn match yardPrivate "@private" contained syn match yardPrivate "@private" contained
syn match yardRaise "@raise" contained syn match yardRaise "@raise" contained
syn match yardReturn "@return" contained syn match yardReturn "@return" contained
@@ -32,7 +33,7 @@ syn match yardVersion "@version" contained
syn match yardYield "@yield" contained syn match yardYield "@yield" contained
syn match yardYieldParam "@yieldparam" contained syn match yardYieldParam "@yieldparam" contained
syn match yardYieldReturn "@yieldreturn" contained syn match yardYieldReturn "@yieldreturn" contained
syn cluster yardTags contains=yardGenericTag,yardAbstract,yardApi,yardAttr,yardAttrReader,yardAttrWriter,yardAuthor,yardDeprecated,yardExample,yardNote,yardOption,yardOverload,yardParam,yardPrivate,yardRaise,yardReturn,yardSee,yardSince,yardTodo,yardVersion,yardYield,yardYieldParam,yardYieldReturn syn cluster yardTags contains=yardGenericTag,yardAbstract,yardApi,yardAttr,yardAttrReader,yardAttrWriter,yardAuthor,yardDeprecated,yardExample,yardNote,yardOption,yardOverload,yardParam,yardParamName,yardPrivate,yardRaise,yardReturn,yardSee,yardSince,yardTodo,yardVersion,yardYield,yardYieldParam,yardYieldReturn
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Directives " Directives
@@ -81,7 +82,7 @@ syn cluster rubyNotTop add=@yardTags,@yardDirectives,@yardTypes,@yardLists,@yard
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
hi def link yardComment rubyComment hi def link yardComment rubyComment
" Tags " Tags
hi def link yardGenericTag rubyKeyword hi def link yardGenericTag rubyTodo
hi def link yardAbstract yardGenericTag hi def link yardAbstract yardGenericTag
hi def link yardApi yardGenericTag hi def link yardApi yardGenericTag
hi def link yardAttr yardGenericTag hi def link yardAttr yardGenericTag
@@ -101,11 +102,11 @@ hi def link yardSee yardGenericTag
hi def link yardSince yardGenericTag hi def link yardSince yardGenericTag
hi def link yardTodo yardGenericTag hi def link yardTodo yardGenericTag
hi def link yardVersion yardGenericTag hi def link yardVersion yardGenericTag
hi def link yield yardGenericTag hi def link yardYield yardGenericTag
hi def link yieldparam yardGenericTag hi def link yardYieldParam yardGenericTag
hi def link yieldreturn yardGenericTag hi def link yardYieldReturn yardGenericTag
" Directives " Directives
hi def link yardGenericDirective rubyKeyword hi def link yardGenericDirective rubyTodo
hi def link yardAttribute yardGenericDirective hi def link yardAttribute yardGenericDirective
hi def link yardEndGroup yardGenericDirective hi def link yardEndGroup yardGenericDirective
hi def link yardGroup yardGenericDirective hi def link yardGroup yardGenericDirective

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file " Vim syntax file

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/tsx.vim source <sfile>:h/tsx.vim

View File

@@ -1,65 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
" To make this file do stuff, add something like the following (without the
" leading ") to your ~/.vimrc:
" au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim
" Vim syntax/macro file
" Language: YAML
" Author: Igor Vergeichik <iverg@mail.ru>
" Sponsor: Tom Sawyer <transami@transami.net>
" Stayven: Ryan King <jking@panoptic.com>
" Copyright (c) 2002 Tom Saywer
" Add an item to a gangly list:
"map , o<bs><bs><bs><bs>-<esc>o
" Convert to Canonical form:
"map \c :%!python -c 'from yaml.redump import redump; import sys; print redump(sys.stdin.read()).rstrip()'
if version < 600
syntax clear
endif
syntax clear
syn match yamlInline "[\[\]\{\}]"
syn match yamlBlock "[>|]\d\?[+-]"
syn region yamlComment start="\#" end="$"
syn match yamlIndicator "#YAML:\S\+"
syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)\@<='" end="'" skip="\\'"
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
syn region yamlString matchgroup=yamlBlock start=/[>|]\d\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+3 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
syn match yamlEscape +\\[abfnrtv'"\\]+ contained
syn match yamlEscape "\\\o\o\=\o\=" contained
syn match yamlEscape "\\x\x\+" contained
syn match yamlType "!\S\+"
syn keyword yamlConstant NULL Null null NONE None none NIL Nil nil
syn keyword yamlConstant TRUE True true YES Yes yes ON On on
syn keyword yamlConstant FALSE False false NO No no OFF Off off
syn match yamlKey "^\s*\zs[^ \t\"\'#]\+\ze\s*:"
syn match yamlKey "^\s*-\s*\zs[^ \t\"\'#]\+\ze\s*:"
syn match yamlAnchor "&\S\+"
syn match yamlAlias "*\S\+"
" Setup the highlighting links
hi link yamlConstant Keyword
hi link yamlIndicator PreCondit
hi link yamlAnchor Function
hi link yamlAlias Function
hi link yamlKey Identifier
hi link yamlType Type
hi link yamlComment Comment
hi link yamlInline Operator
hi link yamlBlock Operator
hi link yamlString String
hi link yamlEscape Special
endif

641
autoload/ada.vim Normal file
View File

@@ -0,0 +1,641 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
" Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" Ned Okie <nokie@radford.edu>
" $Author: krischik $
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
" Version: 4.6
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
" 02.10.2006 MK Better folding.
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" 08.07.2007 TV fix mapleader problems.
" 09.05.2007 MK Session just won't work no matter how much
" tweaking is done
" 19.09.2007 NO still some mapleader problems
" 31.01.2017 MB fix more mapleader problems
" Help Page: ft-ada-functions
"------------------------------------------------------------------------------
if version < 700
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" Section: Constants {{{1
"
let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
let g:ada#WordRegex = '\a\w*'
let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
let g:ada#Keywords = []
" Section: g:ada#Keywords {{{1
"
" Section: add Ada keywords {{{2
"
for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'Ada keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
" Section: GNAT Project Files {{{3
"
if exists ('g:ada_with_gnat_project_files')
for Item in ['project']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'GNAT projectfile keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
endif
" Section: add standart exception {{{2
"
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'Ada standart exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
" Section: add GNAT exception {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Assert_Failure']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'GNAT exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
endif
" Section: add Ada buildin types {{{2
"
for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'Ada buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
" Section: add GNAT buildin types {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'GNAT buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Attributes {{{2
"
for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'Ada attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
" Section: add GNAT Attributes {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'GNAT attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Pragmas {{{2
"
for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'Ada pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
" Section: add GNAT Pragmas {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'GNAT pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
endif
" 1}}}
" Section: g:ada#Ctags_Kinds {{{1
"
let g:ada#Ctags_Kinds = {
\ 'P': ["packspec", "package specifications"],
\ 'p': ["package", "packages"],
\ 'T': ["typespec", "type specifications"],
\ 't': ["type", "types"],
\ 'U': ["subspec", "subtype specifications"],
\ 'u': ["subtype", "subtypes"],
\ 'c': ["component", "record type components"],
\ 'l': ["literal", "enum type literals"],
\ 'V': ["varspec", "variable specifications"],
\ 'v': ["variable", "variables"],
\ 'f': ["formal", "generic formal parameters"],
\ 'n': ["constant", "constants"],
\ 'x': ["exception", "user defined exceptions"],
\ 'R': ["subprogspec", "subprogram specifications"],
\ 'r': ["subprogram", "subprograms"],
\ 'K': ["taskspec", "task specifications"],
\ 'k': ["task", "tasks"],
\ 'O': ["protectspec", "protected data specifications"],
\ 'o': ["protected", "protected data"],
\ 'E': ["entryspec", "task/protected data entry specifications"],
\ 'e': ["entry", "task/protected data entries"],
\ 'b': ["label", "labels"],
\ 'i': ["identifier", "loop/declare identifiers"],
\ 'a': ["autovar", "automatic variables"],
\ 'y': ["annon", "loops and blocks with no identifier"]}
" Section: ada#Word (...) {{{1
"
" Extract current Ada word across multiple lines
" AdaWord ([line, column])\
"
function ada#Word (...)
if a:0 > 1
let l:Line_Nr = a:1
let l:Column_Nr = a:2 - 1
else
let l:Line_Nr = line('.')
let l:Column_Nr = col('.') - 1
endif
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
" Cope with tag searching for items in comments; if we are, don't loop
" backards looking for previous lines
if l:Column_Nr > strlen(l:Line)
" We were in a comment
let l:Line = getline(l:Line_Nr)
let l:Search_Prev_Lines = 0
else
let l:Search_Prev_Lines = 1
endif
" Go backwards until we find a match (Ada ID) that *doesn't* include our
" location - i.e., the previous ID. This is because the current 'correct'
" match will toggle matching/not matching as we traverse characters
" backwards. Thus, we have to find the previous unrelated match, exclude
" it, then use the next full match (ours).
" Remember to convert vim column 'l:Column_Nr' [1..n] to string offset [0..(n-1)]
" ... but start, here, one after the required char.
let l:New_Column = l:Column_Nr + 1
while 1
let l:New_Column = l:New_Column - 1
if l:New_Column < 0
" Have to include previous l:Line from file
let l:Line_Nr = l:Line_Nr - 1
if l:Line_Nr < 1 || !l:Search_Prev_Lines
" Start of file or matching in a comment
let l:Line_Nr = 1
let l:New_Column = 0
let l:Our_Match = match (l:Line, g:ada#WordRegex )
break
endif
" Get previous l:Line, and prepend it to our search string
let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
let l:New_Column = strlen (l:New_Line) - 1
let l:Column_Nr = l:Column_Nr + l:New_Column
let l:Line = l:New_Line . l:Line
endif
" Check to see if this is a match excluding 'us'
let l:Match_End = l:New_Column +
\ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1
if l:Match_End >= l:New_Column &&
\ l:Match_End < l:Column_Nr
" Yes
let l:Our_Match = l:Match_End+1 +
\ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex )
break
endif
endwhile
" Got anything?
if l:Our_Match < 0
return ''
else
let l:Line = strpart (l:Line, l:Our_Match)
endif
" Now simply add further lines until the match gets no bigger
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
let l:Last_Line = line ('$')
let l:Line_Nr = line ('.') + 1
while l:Line_Nr <= l:Last_Line
let l:Last_Match = l:Match_String
let l:Line = l:Line .
\ substitute (getline (l:Line_Nr), g:ada#Comment, '', '')
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
if l:Match_String == l:Last_Match
break
endif
endwhile
" Strip whitespace & return
return substitute (l:Match_String, '\s\+', '', 'g')
endfunction ada#Word
" Section: ada#List_Tag (...) {{{1
"
" List tags in quickfix window
"
function ada#List_Tag (...)
if a:0 > 1
let l:Tag_Word = ada#Word (a:1, a:2)
elseif a:0 > 0
let l:Tag_Word = a:1
else
let l:Tag_Word = ada#Word ()
endif
echo "Searching for" l:Tag_Word
let l:Pattern = '^' . l:Tag_Word . '$'
let l:Tag_List = taglist (l:Pattern)
let l:Error_List = []
"
" add symbols
"
for Tag_Item in l:Tag_List
if l:Tag_Item['kind'] == ''
let l:Tag_Item['kind'] = 's'
endif
let l:Error_List += [
\ l:Tag_Item['filename'] . '|' .
\ l:Tag_Item['cmd'] . '|' .
\ l:Tag_Item['kind'] . "\t" .
\ l:Tag_Item['name'] ]
endfor
set errorformat=%f\|%l\|%m
cexpr l:Error_List
cwindow
endfunction ada#List_Tag
" Section: ada#Jump_Tag (Word, Mode) {{{1
"
" Word tag - include '.' and if Ada make uppercase
"
function ada#Jump_Tag (Word, Mode)
if a:Word == ''
" Get current word
let l:Word = ada#Word()
if l:Word == ''
throw "NOT_FOUND: no identifier found."
endif
else
let l:Word = a:Word
endif
echo "Searching for " . l:Word
try
execute a:Mode l:Word
catch /.*:E426:.*/
let ignorecase = &ignorecase
set ignorecase
execute a:Mode l:Word
let &ignorecase = ignorecase
endtry
return
endfunction ada#Jump_Tag
" Section: ada#Insert_Backspace () {{{1
"
" Backspace at end of line after auto-inserted commentstring '-- ' wipes it
"
function ada#Insert_Backspace ()
let l:Line = getline ('.')
if col ('.') > strlen (l:Line) &&
\ match (l:Line, '-- $') != -1 &&
\ match (&comments,'--') != -1
return "\<bs>\<bs>\<bs>"
else
return "\<bs>"
endif
return
endfunction ada#InsertBackspace
" Section: Insert Completions {{{1
"
" Section: ada#User_Complete(findstart, base) {{{2
"
" This function is used for the 'complete' option.
"
function! ada#User_Complete(findstart, base)
if a:findstart == 1
"
" locate the start of the word
"
let line = getline ('.')
let start = col ('.') - 1
while start > 0 && line[start - 1] =~ '\i\|'''
let start -= 1
endwhile
return start
else
"
" look up matches
"
let l:Pattern = '^' . a:base . '.*$'
"
" add keywords
"
for Tag_Item in g:ada#Keywords
if l:Tag_Item['word'] =~? l:Pattern
if complete_add (l:Tag_Item) == 0
return []
endif
if complete_check ()
return []
endif
endif
endfor
return []
endif
endfunction ada#User_Complete
" Section: ada#Completion (cmd) {{{2
"
" Word completion (^N/^R/^X^]) - force '.' inclusion
function ada#Completion (cmd)
set iskeyword+=46
return a:cmd . "\<C-R>=ada#Completion_End ()\<CR>"
endfunction ada#Completion
" Section: ada#Completion_End () {{{2
"
function ada#Completion_End ()
set iskeyword-=46
return ''
endfunction ada#Completion_End
" Section: ada#Create_Tags {{{1
"
function ada#Create_Tags (option)
if a:option == 'file'
let l:Filename = fnamemodify (bufname ('%'), ':p')
elseif a:option == 'dir'
let l:Filename =
\ fnamemodify (bufname ('%'), ':p:h') . "*.ada " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.adb " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.ads"
else
let l:Filename = a:option
endif
execute '!ctags --excmd=number ' . l:Filename
endfunction ada#Create_Tags
" Section: ada#Switch_Session {{{1
"
function ada#Switch_Session (New_Session)
"
" you should not save to much date into the seession since they will
" be sourced
"
let l:sessionoptions=&sessionoptions
try
set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize
if a:New_Session != v:this_session
"
" We actually got a new session - otherwise there
" is nothing to do.
"
if strlen (v:this_session) > 0
execute 'mksession! ' . v:this_session
endif
let v:this_session = a:New_Session
"if filereadable (v:this_session)
"execute 'source ' . v:this_session
"endif
augroup ada_session
autocmd!
autocmd VimLeavePre * execute 'mksession! ' . v:this_session
augroup END
"if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open
"TlistOpen
"endif
endif
finally
let &sessionoptions=l:sessionoptions
endtry
return
endfunction ada#Switch_Session
" Section: GNAT Pretty Printer folding {{{1
"
if exists('g:ada_folding') && g:ada_folding[0] == 'g'
"
" Lines consisting only of ')' ';' are due to a gnat pretty bug and
" have the same level as the line above (can't happen in the first
" line).
"
let s:Fold_Collate = '^\([;)]*$\|'
"
" some lone statements are folded with the line above
"
if stridx (g:ada_folding, 'i') >= 0
let s:Fold_Collate .= '\s\+\<is\>$\|'
endif
if stridx (g:ada_folding, 'b') >= 0
let s:Fold_Collate .= '\s\+\<begin\>$\|'
endif
if stridx (g:ada_folding, 'p') >= 0
let s:Fold_Collate .= '\s\+\<private\>$\|'
endif
if stridx (g:ada_folding, 'x') >= 0
let s:Fold_Collate .= '\s\+\<exception\>$\|'
endif
" We also handle empty lines and
" comments here.
let s:Fold_Collate .= '--\)'
function ada#Pretty_Print_Folding (Line) " {{{2
let l:Text = getline (a:Line)
if l:Text =~ s:Fold_Collate
"
" fold with line above
"
let l:Level = "="
elseif l:Text =~ '^\s\+('
"
" gnat outdents a line which stards with a ( by one characters so
" that parameters which follow are aligned.
"
let l:Level = (indent (a:Line) + 1) / &shiftwidth
else
let l:Level = indent (a:Line) / &shiftwidth
endif
return l:Level
endfunction ada#Pretty_Print_Folding " }}}2
endif
" Section: Options and Menus {{{1
"
" Section: ada#Switch_Syntax_Options {{{2
"
function ada#Switch_Syntax_Option (option)
syntax off
if exists ('g:ada_' . a:option)
unlet g:ada_{a:option}
echo a:option . 'now off'
else
let g:ada_{a:option}=1
echo a:option . 'now on'
endif
syntax on
endfunction ada#Switch_Syntax_Option
" Section: ada#Map_Menu {{{2
"
function ada#Map_Menu (Text, Keys, Command)
if a:Keys[0] == ':'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "command -buffer " .
\ a:Keys[1:] .
\" :" . a:Command . "<CR>"
elseif a:Keys[0] == '<'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer> " .
\ a:Keys .
\" :" . a:Command . "<CR>"
execute
\ "inoremap <buffer> " .
\ a:Keys .
\" <C-O>:" . a:Command . "<CR>"
else
if exists("g:mapleader")
let l:leader = g:mapleader
else
let l:leader = '\'
endif
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer>" .
\ " <Leader>a" . a:Keys .
\" :" . a:Command
execute
\ "inoremap <buffer>" .
\ " <Leader>a" . a:Keys .
\" <C-O>:" . a:Command
endif
return
endfunction
" Section: ada#Map_Popup {{{2
"
function ada#Map_Popup (Text, Keys, Command)
if exists("g:mapleader")
let l:leader = g:mapleader
else
let l:leader = '\'
endif
execute
\ "50amenu " .
\ "PopUp." . escape(a:Text, ' ') .
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
call ada#Map_Menu (a:Text, a:Keys, a:Command)
return
endfunction ada#Map_Popup
" }}}1
lockvar g:ada#WordRegex
lockvar g:ada#DotWordRegex
lockvar g:ada#Comment
lockvar! g:ada#Keywords
lockvar! g:ada#Ctags_Kinds
let &cpo = s:keepcpo
unlet s:keepcpo
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
endif

View File

@@ -1,7 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
function! cargo#quickfix#CmdPre() abort function! cargo#quickfix#CmdPre() abort
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' &&
\ &makeprg =~ '\V\^cargo\ \.\*'
" Preserve the current directory, and 'lcd' to the nearest Cargo file. " Preserve the current directory, and 'lcd' to the nearest Cargo file.
let b:rust_compiler_cargo_qf_has_lcd = haslocaldir() let b:rust_compiler_cargo_qf_has_lcd = haslocaldir()
let b:rust_compiler_cargo_qf_prev_cd = getcwd() let b:rust_compiler_cargo_qf_prev_cd = getcwd()

View File

@@ -1450,7 +1450,7 @@ fu! csv#SumColumn(list) "{{{3
let b:csv_result = '0' let b:csv_result = '0'
return 0 return 0
else else
let sum = has("float") ? 0.0 : 0 let sum = 0.0
for item in a:list for item in a:list
if empty(item) if empty(item)
continue continue
@@ -1460,33 +1460,25 @@ fu! csv#SumColumn(list) "{{{3
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
try try
let nr = substitute(nr, format1, '', '') let nr = substitute(nr, format1, '', '')
if has("float") && s:nr_format[1] != '.' if s:nr_format[1] != '.'
let nr = substitute(nr, format2, '.', '') let nr = substitute(nr, format2, '.', '')
endif endif
catch catch
let nr = 0 let nr = '0'
endtry endtry
let sum += (has("float") ? str2float(nr) : (nr + 0)) let sum += str2float(nr)
endfor endfor
if has("float") let b:csv_result = sum
let b:csv_result = string(float2nr(sum)) return printf("%.2f", sum)
if float2nr(sum) == sum
return float2nr(sum)
else
return printf("%.2f", sum)
endif
endif
let b:csv_result = string(sum)
return sum
endif endif
endfu endfu
fu! csv#AvgColumn(list) "{{{3 fu! csv#AvgColumn(list) "{{{3
if empty(a:list) if empty(a:list)
let b:csv_result = '0' let b:csv_result = '0'
return 0 return 0.0
else else
let cnt = 0 let cnt = 0
let sum = has("float") ? 0.0 : 0 let sum = 0.0
for item in a:list for item in a:list
if empty(item) if empty(item)
continue continue
@@ -1496,30 +1488,25 @@ fu! csv#AvgColumn(list) "{{{3
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
try try
let nr = substitute(nr, format1, '', '') let nr = substitute(nr, format1, '', '')
if has("float") && s:nr_format[1] != '.' if s:nr_format[1] != '.'
let nr = substitute(nr, format2, '.', '') let nr = substitute(nr, format2, '.', '')
endif endif
catch catch
let nr = 0 let nr ='0'
endtry endtry
let sum += (has("float") ? str2float(nr) : (nr + 0)) let sum += str2float(nr)
let cnt += 1 let cnt += 1
endfor endfor
if has("float") let b:csv_result = printf("%.2f", sum/cnt)
let b:csv_result = printf("%.2f", sum/cnt) return sum/cnt
return str2float(b:csv_result)
else
let b:csv_result = printf("%s", sum/cnt)
return b:csv_result + 0
endif
endif endif
endfu endfu
fu! csv#VarianceColumn(list, is_population) "{{{3 fu! csv#VarianceColumn(list, is_population) "{{{3
if empty(a:list) if empty(a:list)
return 0 return 0.0
else else
let cnt = 0 let cnt = 0
let sum = has("float") ? 0.0 : 0 let sum = 0.0
let avg = csv#AvgColumn(a:list) let avg = csv#AvgColumn(a:list)
for item in a:list for item in a:list
if empty(item) if empty(item)
@@ -1530,64 +1517,64 @@ fu! csv#VarianceColumn(list, is_population) "{{{3
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
try try
let nr = substitute(nr, format1, '', '') let nr = substitute(nr, format1, '', '')
if has("float") && s:nr_format[1] != '.' if s:nr_format[1] != '.'
let nr = substitute(nr, format2, '.', '') let nr = substitute(nr, format2, '.', '')
endif endif
catch catch
let nr = 0 let nr = '0'
endtry endtry
let sum += pow((has("float") ? (str2float(nr)-avg) : ((nr + 0)-avg)), 2) let nr = str2float(nr)
let sum += pow((nr-avg), 2)
let cnt += 1 let cnt += 1
endfor endfor
if(a:is_population == 0) if(a:is_population == 0)
let cnt = cnt-1 let cnt = cnt-1
endif endif
if has("float") let b:csv_result = sum/cnt
let b:csv_result = printf("%." . get(b:, 'csv_accuracy', get(g:, 'csv_accuracy', 2)) . "f", sum/cnt) return b:csv_result
return b:csv_result
else
let b:csv_result = printf("%s", sum/cnt)
return sum/(cnt)
endif
endif endif
endfu endfu
fu! csv#SmplVarianceColumn(list) "{{{2 fu! csv#SmplVarianceColumn(list) "{{{2
unlet! b:csv_result
if empty(a:list) if empty(a:list)
let b:csv_result = '0' let b:csv_result = 0.0
return 0 return 0.0
else else
return csv#VarianceColumn(a:list, 0) return csv#VarianceColumn(a:list, 0)
endif endif
endfu endfu
fu! csv#PopVarianceColumn(list) "{{{2 fu! csv#PopVarianceColumn(list) "{{{2
unlet! b:csv_result
if empty(a:list) if empty(a:list)
let b:csv_result = '0' let b:csv_result = 0.0
return 0 return 0.0
else else
return csv#VarianceColumn(a:list, 1) return csv#VarianceColumn(a:list, 1)
endif endif
endfu endfu
fu! csv#SmplStdDevColumn(list) "{{{2 fu! csv#SmplStdDevColumn(list) "{{{2
unlet! b:csv_result
if empty(a:list) if empty(a:list)
let b:csv_result = '0' let b:csv_result = 0.0
return 0 return 0.0
else else
let result = sqrt(str2float(csv#VarianceColumn(a:list, 0))) let result = sqrt(csv#VarianceColumn(a:list, 0))
let b:csv_result = string(result) let b:csv_result = result
return result return result
endif endif
endfu endfu
fu! csv#PopStdDevColumn(list) "{{{2 fu! csv#PopStdDevColumn(list) "{{{2
unlet! b:csv_result
if empty(a:list) if empty(a:list)
let b:csv_result = '0' let b:csv_result = 0.0
return 0 return 0.0
else else
let result = sqrt(str2float(csv#VarianceColumn(a:list, 1))) let result = sqrt(csv#VarianceColumn(a:list, 1))
let b:csv_result = string(result) let b:csv_result = result
return result return result
endif endif
endfu endfu
@@ -1610,13 +1597,13 @@ fu! csv#MaxColumn(list) "{{{3
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
try try
let nr = substitute(nr, format1, '', '') let nr = substitute(nr, format1, '', '')
if has("float") && s:nr_format[1] != '.' if s:nr_format[1] != '.'
let nr = substitute(nr, format2, '.', '') let nr = substitute(nr, format2, '.', '')
endif endif
catch catch
let nr = 0 let nr = '0'
endtry endtry
call add(result, has("float") ? str2float(nr) : nr+0) call add(result, str2float(nr))
endfor endfor
let result = sort(result, s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues') let result = sort(result, s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues')
let ind = len(result) > 9 ? 9 : len(result) let ind = len(result) > 9 ? 9 : len(result)
@@ -1995,10 +1982,7 @@ fu! csv#AnalyzeColumn(...) "{{{3
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''') call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
endif endif
if has("float") let title="Nr\tCount\t % \tValue"
let title="Nr\tCount\t % \tValue"
else
let title="Nr\tCount\tValue"
endif endif
echohl Title echohl Title
echo printf("%s", title) echo printf("%s", title)
@@ -2014,12 +1998,8 @@ fu! csv#AnalyzeColumn(...) "{{{3
else else
let k = key let k = key
endif endif
if has("float") echo printf("%02d\t%02d\t%2.0f%%\t%.50s", i, res[key],
echo printf("%02d\t%02d\t%2.0f%%\t%.50s", i, res[key], \ ((res[key] + 0.0)/qty)*100, k)
\ ((res[key] + 0.0)/qty)*100, k)
else
echo printf("%02d\t%02d\t%.50s", i, res[key], k)
endif
call remove(res,key) call remove(res,key)
let i+=1 let i+=1
else else
@@ -2950,6 +2930,11 @@ fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3
call csv#Warn("File is no CSV file!") call csv#Warn("File is no CSV file!")
return return
endif endif
" Need a Vim with floating point feature
if !has("float")
call csv#Warn("Your Vim is missing floating point feature!")
return
endif
let save = winsaveview() let save = winsaveview()
call csv#CheckHeaderLine() call csv#CheckHeaderLine()
let nr = matchstr(a:nr, '^\-\?\d\+') let nr = matchstr(a:nr, '^\-\?\d\+')

View File

@@ -276,12 +276,14 @@ function! elixir#indent#handle_inside_block(context)
" hack - handle do: better " hack - handle do: better
let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind])) let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind]))
let block_start_lnum = block_info[0] let block_start_lnum = block_info[0]
call s:debug("block_start_lnum=" . block_start_lnum)
let block_start_col = block_info[1] let block_start_col = block_info[1]
if block_start_lnum != 0 || block_start_col != 0 if block_start_lnum != 0 || block_start_col != 0
let block_text = getline(block_start_lnum) let block_text = getline(block_start_lnum)
let block_start_char = block_text[block_start_col - 1] let block_start_char = block_text[block_start_col - 1]
call s:debug("block_start_char=" . block_start_char)
let never_match = '\(a\)\@=b' let never_match = ''
let config = { let config = {
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, \'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, \'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
@@ -293,17 +295,25 @@ function! elixir#indent#handle_inside_block(context)
\'(': {'aligned_clauses': ')', 'pattern_match_clauses': never_match} \'(': {'aligned_clauses': ')', 'pattern_match_clauses': never_match}
\} \}
" if `with` clause...
if block_start_char == 'w' if block_start_char == 'w'
call s:debug("testing s:handle_with") call s:debug("testing s:handle_with")
return s:handle_with(block_start_lnum, block_start_col, a:context) return s:handle_with(block_start_lnum, block_start_col, a:context)
else else
let block_config = config[block_start_char] let block_config = config[block_start_char]
" if aligned clause (closing tag/`else` clause/etc...) then indent this
" at the same level as the block open tag (e.g. `if`/`case`/etc...)
if s:starts_with(a:context, block_config.aligned_clauses) if s:starts_with(a:context, block_config.aligned_clauses)
call s:debug("clause") call s:debug("clause")
return indent(block_start_lnum) return indent(block_start_lnum)
else else
let clause_lnum = searchpair(block_config.pattern_match_clauses, '', '*', 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()", block_start_lnum) if block_config.pattern_match_clauses == never_match
let relative_lnum = max([clause_lnum, block_start_lnum]) let relative_lnum = block_start_lnum
else
let clause_lnum = searchpair(block_config.pattern_match_clauses, '', '*', 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()", block_start_lnum)
call s:debug("clause_lum=" . clause_lnum)
let relative_lnum = max([clause_lnum, block_start_lnum])
end
call s:debug("pattern matching relative to lnum " . relative_lnum) call s:debug("pattern matching relative to lnum " . relative_lnum)
return s:do_handle_pattern_match_block(relative_lnum, a:context) return s:do_handle_pattern_match_block(relative_lnum, a:context)
endif endif

View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gitignore') == -1
scriptencoding utf-8
" Copyright (c) 2017-2020 Filip Szymański. All rights reserved.
" Use of this source code is governed by an MIT license that can be
" found in the LICENSE file.
function! s:template_sink(templates) abort
try
let l:lines = _fzf_gitignore_create(a:templates)
catch /^Vim(\(let\|return\)):/
return
endtry
new
setlocal filetype=gitignore
call setline(1, l:lines)
$-2,$delete _
normal! gg
endfunction
function! fzf_gitignore#run() abort
try
let l:opts = {
\ 'source': _fzf_gitignore_get_all_templates(),
\ 'sink*': function('s:template_sink'),
\ 'options': '-m --prompt="Template> " --header="gitignore.io"'
\ }
catch /^Vim(\(let\|return\)):/
return
endtry
call fzf#run(fzf#wrap(l:opts))
endfunction
" vim: ts=2 et sw=2
endif

View File

@@ -55,6 +55,10 @@ function! go#config#TermCloseOnExit() abort
return get(g:, 'go_term_close_on_exit', 1) return get(g:, 'go_term_close_on_exit', 1)
endfunction endfunction
function! go#config#TermReuse() abort
return get(g:, 'go_term_reuse', 0)
endfunction
function! go#config#SetTermCloseOnExit(value) abort function! go#config#SetTermCloseOnExit(value) abort
let g:go_term_close_on_exit = a:value let g:go_term_close_on_exit = a:value
endfunction endfunction
@@ -548,6 +552,14 @@ function! go#config#GoplsLocal() abort
return get(g:, 'go_gopls_local', v:null) return get(g:, 'go_gopls_local', v:null)
endfunction endfunction
function! go#config#GoplsGofumpt() abort
return get(g:, 'go_gopls_gofumpt', v:null)
endfunction
function! go#config#GoplsSettings() abort
return get(g:, 'go_gopls_settings', v:null)
endfunction
function! go#config#GoplsEnabled() abort function! go#config#GoplsEnabled() abort
return get(g:, 'go_gopls_enabled', 1) return get(g:, 'go_gopls_enabled', 1)
endfunction endfunction
@@ -560,6 +572,10 @@ function! go#config#GoplsOptions() abort
return get(g:, 'go_gopls_options', ['-remote=auto']) return get(g:, 'go_gopls_options', ['-remote=auto'])
endfunction endfunction
function! go#config#FillStructMode() abort
return get(g:, 'go_fillstruct_mode', 'fillstruct')
endfunction
" Set the default value. A value of "1" is a shortcut for this, for " Set the default value. A value of "1" is a shortcut for this, for
" compatibility reasons. " compatibility reasons.
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1 if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
function! jsx_pretty#comment#update_commentstring(original) function! jsx_pretty#comment#update_commentstring(original)
let line = getline(".") let line = getline(".")

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
if exists('*shiftwidth') if exists('*shiftwidth')
function! s:sw() function! s:sw()

View File

@@ -0,0 +1,264 @@
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
func! polyglot#detect#Inp()
let line = getline(nextnonblank(1))
if line =~# '^\*'
set ft=abaqus | return
endif
for lnum in range(1, min([line("$"), 500]))
let line = getline(lnum)
if line =~? '^header surface data'
set ft=trasys | return
endif
endfor
endfunc
func! polyglot#detect#Asa()
if exists("g:filetype_asa")
let &ft = g:filetype_asa | return
endif
set ft=aspvbs | return
endfunc
func! polyglot#detect#Asp()
if exists("g:filetype_asp")
let &ft = g:filetype_asp | return
endif
for lnum in range(1, min([line("$"), 3]))
let line = getline(lnum)
if line =~? 'perlscript'
set ft=aspperl | return
endif
endfor
set ft=aspvbs | return
endfunc
func! polyglot#detect#H()
for lnum in range(1, min([line("$"), 200]))
let line = getline(lnum)
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
if exists("g:c_syntax_for_h")
set ft=objc | return
endif
set ft=objcpp | return
endif
endfor
if exists("g:c_syntax_for_h")
set ft=c | return
endif
if exists("g:ch_syntax_for_h")
set ft=ch | return
endif
set ft=cpp | return
endfunc
func! polyglot#detect#M()
let saw_comment = 0
for lnum in range(1, min([line("$"), 100]))
let line = getline(lnum)
if line =~# '^\s*/\*'
let saw_comment = 1
endif
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
set ft=objc | return
endif
if line =~# '^\s*%'
set ft=octave | return
endif
if line =~# '^\s*(\*'
set ft=mma | return
endif
if line =~? '^\s*\(\(type\|var\)\(\<\|\>\)\|--\)'
set ft=murphi | return
endif
endfor
if saw_comment
set ft=objc | return
endif
if exists("g:filetype_m")
let &ft = g:filetype_m | return
endif
set ft=octave | return
endfunc
func! polyglot#detect#Fs()
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\(: \|new-device\)'
set ft=forth | return
endif
if line =~# '^\s*\(#light\|import\|let\|module\|namespace\|open\|type\)'
set ft=fsharp | return
endif
if line =~# '\s*\(#version\|precision\|uniform\|varying\|vec[234]\)'
set ft=glsl | return
endif
endfor
if exists("g:filetype_fs")
let &ft = g:filetype_fs | return
endif
set ft=forth | return
endfunc
func! polyglot#detect#Re()
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\s*#\%(\%(if\|ifdef\|define\|pragma\)\s\+\w\|\s*include\s\+[<"]\|template\s*<\)'
set ft=cpp | return
endif
set ft=reason | return
endfor
endfunc
func! polyglot#detect#Idr()
for lnum in range(1, min([line("$"), 5]))
let line = getline(lnum)
if line =~# '^\s*--.*[Ii]dris \=1'
set ft=idris | return
endif
if line =~# '^\s*--.*[Ii]dris \=2'
set ft=idris2 | return
endif
endfor
for lnum in range(1, min([line("$"), 30]))
let line = getline(lnum)
if line =~# '^pkgs =.*'
set ft=idris | return
endif
if line =~# '^depends =.*'
set ft=idris2 | return
endif
if line =~# '^%language \(TypeProviders\|ElabReflection\)'
set ft=idris | return
endif
if line =~# '^%language PostfixProjections'
set ft=idris2 | return
endif
if line =~# '^%access .*'
set ft=idris | return
endif
endfor
if exists("g:filetype_idr")
let &ft = g:filetype_idr | return
endif
set ft=idris2 | return
endfunc
func! polyglot#detect#Lidr()
for lnum in range(1, min([line("$"), 200]))
let line = getline(lnum)
if line =~# '^>\s*--.*[Ii]dris \=1'
set ft=lidris | return
endif
endfor
set ft=lidris2 | return
endfunc
func! polyglot#detect#Bas()
for lnum in range(1, min([line("$"), 5]))
let line = getline(lnum)
if line =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
set ft=vb | return
endif
endfor
set ft=basic | return
endfunc
func! polyglot#detect#Pm()
let line = getline(nextnonblank(1))
if line =~# 'XPM2'
set ft=xpm2 | return
endif
if line =~# 'XPM'
set ft=xpm | return
endif
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)'
set ft=raku | return
endif
if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)'
set ft=perl | return
endif
endfor
if exists("g:filetype_pm")
let &ft = g:filetype_pm | return
endif
if polyglot#shebang#Detect() | return | endif
set ft=perl | au BufWritePost <buffer> ++once call polyglot#detect#Pm()
return
endfunc
func! polyglot#detect#Pl()
let line = getline(nextnonblank(1))
if line =~# '^[^#]*:-' || line =~# '^\s*\%(%\|/\*\)' || line =~# '\.\s*$'
set ft=prolog | return
endif
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)'
set ft=raku | return
endif
if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)'
set ft=perl | return
endif
endfor
if exists("g:filetype_pl")
let &ft = g:filetype_pl | return
endif
if polyglot#shebang#Detect() | return | endif
set ft=perl | au BufWritePost <buffer> ++once call polyglot#detect#Pl()
return
endfunc
func! polyglot#detect#T()
for lnum in range(1, min([line("$"), 5]))
let line = getline(lnum)
if line =~# '^\.'
set ft=nroff | return
endif
endfor
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)'
set ft=raku | return
endif
if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)'
set ft=perl | return
endif
endfor
if exists("g:filetype_t")
let &ft = g:filetype_t | return
endif
if polyglot#shebang#Detect() | return | endif
set ft=perl | au BufWritePost <buffer> ++once call polyglot#detect#T()
return
endfunc
func! polyglot#detect#Tt2()
for lnum in range(1, min([line("$"), 3]))
let line = getline(lnum)
if line =~? '<\%(!DOCTYPE HTML\|[%?]\|html\)'
set ft=tt2html | return
endif
endfor
set ft=tt2 | return
endfunc
func! polyglot#detect#Html()
let line = getline(nextnonblank(1))
if line =~# '^\(%\|<[%&].*>\)'
set ft=mason | return
endif
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+'
set ft=htmldjango | return
endif
if line =~# '\(\<\|\>\)DTD\s\+XHTML\s'
set ft=xhtml | return
endif
endfor
set ft=html | au BufWritePost <buffer> ++once call polyglot#detect#Html()
return
endfunc

View File

@@ -0,0 +1,127 @@
func! polyglot#shebang#Detect()
let ft = s:Filetype()
if ft != ""
let &ft = ft
endif
if &ft == ""
runtime! scripts.vim
endif
return &ft != ""
endfunc
let s:r_hashbang = '^#!\s*\(\S\+\)\s*\(.*\)\s*'
let s:r_envflag = '%(\S\+=\S\+\|-[iS]\|--ignore-environment\|--split-string\)'
let s:r_env = '^\%(\' . s:r_envflag . '\s\+\)*\(\S\+\)'
func! s:Filetype()
let l:line1 = getline(1)
if l:line1 !~# "^#!"
return
endif
let l:pathrest = matchlist(l:line1, s:r_hashbang)
if len(l:pathrest) == 0
return
endif
let [_, l:path, l:rest; __] = l:pathrest
let l:script = split(l:path, "/")[-1]
if l:script == "env"
let l:argspath = matchlist(l:rest, s:r_env)
if len(l:argspath) == 0
return
endif
let l:script = l:argspath[1]
endif
if has_key(s:interpreters, l:script)
return s:interpreters[l:script]
endif
for interpreter in keys(s:interpreters)
if l:script =~# '^' . interpreter
return s:interpreters[interpreter]
endif
endfor
endfunc
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
let s:interpreters = {
\ 'osascript': 'applescript',
\ 'tcc': 'c',
\ 'coffee': 'coffee',
\ 'crystal': 'crystal',
\ 'dart': 'dart',
\ 'elixir': 'elixir',
\ 'escript': 'erlang',
\ 'fish': 'fish',
\ 'gnuplot': 'gnuplot',
\ 'groovy': 'groovy',
\ 'runhaskell': 'haskell',
\ 'chakra': 'javascript',
\ 'd8': 'javascript',
\ 'gjs': 'javascript',
\ 'js': 'javascript',
\ 'node': 'javascript',
\ 'nodejs': 'javascript',
\ 'qjs': 'javascript',
\ 'rhino': 'javascript',
\ 'v8': 'javascript',
\ 'v8-shell': 'javascript',
\ 'julia': 'julia',
\ 'lua': 'lua',
\ 'moon': 'moon',
\ 'ocaml': 'ocaml',
\ 'ocamlrun': 'ocaml',
\ 'ocamlscript': 'ocaml',
\ 'cperl': 'perl',
\ 'perl': 'perl',
\ 'php': 'php',
\ 'swipl': 'prolog',
\ 'yap': 'prolog',
\ 'pwsh': 'ps1',
\ 'python': 'python',
\ 'python2': 'python',
\ 'python3': 'python',
\ 'qmake': 'qmake',
\ 'Rscript': 'r',
\ 'racket': 'racket',
\ 'perl6': 'raku',
\ 'raku': 'raku',
\ 'rakudo': 'raku',
\ 'ruby': 'ruby',
\ 'macruby': 'ruby',
\ 'rake': 'ruby',
\ 'jruby': 'ruby',
\ 'rbx': 'ruby',
\ 'scala': 'scala',
\ 'ash': 'sh',
\ 'bash': 'sh',
\ 'dash': 'sh',
\ 'ksh': 'sh',
\ 'mksh': 'sh',
\ 'pdksh': 'sh',
\ 'rc': 'sh',
\ 'sh': 'sh',
\ 'zsh': 'sh',
\ 'boolector': 'smt2',
\ 'cvc4': 'smt2',
\ 'mathsat5': 'smt2',
\ 'opensmt': 'smt2',
\ 'smtinterpol': 'smt2',
\ 'smt-rat': 'smt2',
\ 'stp': 'smt2',
\ 'verit': 'smt2',
\ 'yices2': 'smt2',
\ 'z3': 'smt2',
\ 'deno': 'typescript',
\ 'ts-node': 'typescript',
\ }

View File

@@ -0,0 +1,239 @@
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
let s:globs = {
\ '8th': '*.8th',
\ 'Dockerfile': '*.dockerfile,*.dock,*.Dockerfile,Dockerfile,dockerfile,Dockerfile*',
\ 'Jenkinsfile': '*.jenkinsfile,*.Jenkinsfile,Jenkinsfile,Jenkinsfile*',
\ 'a2ps': 'a2psrc,.a2psrc',
\ 'a65': '*.a65',
\ 'aap': '*.aap',
\ 'abap': '*.abap',
\ 'abaqus': '*.inp',
\ 'abc': '*.abc',
\ 'abel': '*.abl',
\ 'acedb': '*.wrm',
\ 'ada': '*.adb,*.ads,*.ada,*.adc,*.gpr,*.ada_m',
\ 'ahdl': '*.tdf',
\ 'aidl': '*.aidl',
\ 'alsaconf': '.asoundrc',
\ 'aml': '*.aml',
\ 'ampl': '*.run',
\ 'ant': 'build.xml',
\ 'apache': '.htaccess,access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*',
\ 'apiblueprint': '*.apib',
\ 'applescript': '*.applescript,*.scpt',
\ 'aptconf': 'apt.conf',
\ 'arch': '.arch-inventory,=tagging-method',
\ 'arduino': '*.pde,*.ino',
\ 'art': '*.art',
\ 'asciidoc': '*.asciidoc,*.adoc,*.asc',
\ 'asl': '*.asl,*.dsl',
\ 'asn': '*.asn,*.asn1',
\ 'aspperl': '*.asp',
\ 'aspvbs': '*.asa,*.asp',
\ 'atlas': '*.atl,*.as',
\ 'autohotkey': '*.ahk,*.ahkl',
\ 'autoit': '*.au3',
\ 'automake': '[Mm]akefile.am,GNUmakefile.am',
\ 'ave': '*.ave',
\ 'awk': '*.awk,*.gawk',
\ 'basic': '*.basic',
\ 'blade': '*.blade,*.blade.php',
\ 'brewfile': 'Brewfile',
\ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE',
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
\ 'caddyfile': 'Caddyfile',
\ 'carp': '*.carp',
\ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
\ 'coffee': '*.coffee,*._coffee,*.cake,*.cjsx,*.iced,*.coffeekup,Cakefile',
\ 'conf': '*.conf,auto.master,config',
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh',
\ 'cql': '*.cql',
\ 'cryptol': '*.cry,*.cyl,*.lcry,*.lcyl',
\ 'crystal': '*.cr,Projectfile',
\ 'csv': '*.csv,*.tsv,*.tab',
\ 'cucumber': '*.feature,*.story',
\ 'cuesheet': '*.cue',
\ 'd': '*.d,*.di',
\ 'dart': '*.dart,*.drt',
\ 'dcov': '*.lst',
\ 'dd': '*.dd',
\ 'ddoc': '*.ddoc',
\ 'dhall': '*.dhall',
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
\ 'dsdl': '*.sdl',
\ 'dune': 'jbuild,dune,dune-project,dune-workspace',
\ 'ecrystal': '*.ecr',
\ 'eelixir': '*.eex,*.leex',
\ 'elf': '*.am',
\ 'elixir': '*.ex,*.exs,mix.lock',
\ 'elm': '*.elm',
\ 'embeddedpuppet': '*.epp',
\ 'ember-script': '*.em,*.emberscript',
\ 'emblem': '*.emblem,*.em',
\ 'erlang': '*.erl,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.app,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
\ 'eruby': '*.erb,*.erb.deface,*.rhtml',
\ 'fbs': '*.fbs',
\ 'fennel': '*.fnl',
\ 'ferm': '*.ferm,ferm.conf',
\ 'fish': '*.fish',
\ 'flow': '*.flow',
\ 'forth': '*.fs,*.ft,*.fth',
\ 'fsharp': '*.fs,*.fsi,*.fsx',
\ 'gdscript3': '*.gd',
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
\ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules',
\ 'gitignore': '.gitignore',
\ 'gitrebase': 'git-rebase-todo',
\ 'gitsendemail': '.gitsendemail.*',
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
\ 'gmpl': '*.mod',
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
\ 'go': '*.go',
\ 'gohtmltmpl': '*.tmpl',
\ 'gomod': 'go.mod',
\ 'graphql': '*.graphql,*.gql,*.graphqls',
\ 'groovy': '*.groovy,*.grt,*.gtpl,*.gvy,*.gradle,Jenkinsfile',
\ 'grub': '',
\ 'haml': '*.haml,*.haml.deface,*.hamlc,*.hamlbars',
\ 'haproxy': '*.cfg,haproxy.cfg,haproxy*.conf*',
\ 'haskell': '*.hs,*.hs-boot,*.hsc,*.bpk,*.hsig',
\ 'haxe': '*.hx,*.hxsl',
\ 'hcl': '*.hcl,*.nomad,*.workflow,Appfile',
\ 'helm': '',
\ 'help': '',
\ 'hive': '*.q,*.hql,*.ql',
\ 'html': '*.html,*.htm,*.html.hl,*.inc,*.st,*.xht,*.xhtml',
\ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb',
\ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs',
\ 'html.twig': '*.twig',
\ 'htmldjango': '*.jinja,*.j2,*.jinja2,*.njk',
\ 'i3config': '*.i3.config,*.i3config,i3.config,i3config,.i3.config,.i3config',
\ 'icalendar': '*.ics',
\ 'idris': '*.idr,*.lidr,idris-response',
\ 'idris2': '*.idr,*.ipkg,idris-response',
\ 'ion': '*.ion',
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,*.javascript,Jakefile',
\ 'javascriptreact': '*.jsx',
\ 'jq': '*.jq,.jqrc,.jqrc*',
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.tern-config,.tern-project,.watchmanconfig,composer.lock,mcmod.info,Pipfile.lock',
\ 'json5': '*.json5',
\ 'jsonnet': '*.jsonnet,*.libsonnet',
\ 'jst': '*.ejs,*.ect,*.jst',
\ 'julia': '*.jl',
\ 'kotlin': '*.kt,*.ktm,*.kts',
\ 'ledger': '*.ldg,*.ledger,*.journal',
\ 'less': '*.less',
\ 'lidris2': '*.lidr',
\ 'lilypond': '*.ly,*.ily',
\ 'litcoffee': '*.litcoffee,*.coffee.md',
\ 'livescript': '*.ls,*._ls,Slakefile',
\ 'llvm': '*.ll',
\ 'log': '*.log,*.LOG,*_log,*_LOG',
\ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc',
\ 'm4': '*.m4,*.at',
\ 'mako': '*.mako,*.mao',
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr',
\ 'markdown.mdx': '*.mdx',
\ 'mason': '*.mason,*.mhtml,*.comp',
\ 'meson': 'meson.build,meson_options.txt',
\ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma',
\ 'moon': '*.moon',
\ 'murphi': '*.m',
\ 'nginx': '*.nginx,*.nginxconf,*.vhost,nginx.conf,nginx*.conf,*nginx.conf',
\ 'nim': '*.nim,*.nim.cfg,*.nimble,*.nimrod,*.nims,nim.cfg',
\ 'nix': '*.nix',
\ 'oasis': '_oasis',
\ 'objc': '*.m,*.h',
\ 'ocaml': '*.ml,*.eliom,*.eliomi,*.ml4,*.mli,*.mll,*.mly,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo,.ocamlinit',
\ 'ocamlbuild_tags': '_tags',
\ 'ocpbuild': '*.ocp',
\ 'ocpbuildroot': '*.root',
\ 'octave': '*.oct,*.m',
\ 'odin': '*.odin',
\ 'omake': '*.om,OMakefile,OMakeroot,OMakeroot.in',
\ 'opam': '*.opam,*.opam.template,opam',
\ 'opencl': '*.cl,*.opencl',
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc',
\ 'php': '*.php,*.aw,*.ctp,*.fcgi,*.inc,*.php3,*.php4,*.php5,*.phps,*.phpt,*.phtml,.php,.php_cs,.php_cs.dist,Phakefile',
\ 'plantuml': '*.puml,*.iuml,*.plantuml,*.uml,*.pu',
\ 'pod': '*.pod',
\ 'pony': '*.pony',
\ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb',
\ 'proto': '*.proto',
\ 'ps1': '*.ps1,*.psd1,*.psm1,*.pssc',
\ 'ps1xml': '*.ps1xml',
\ 'pug': '*.jade,*.pug',
\ 'puppet': '*.pp,Modulefile',
\ 'purescript': '*.purs',
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,Snakefile,wscript,.pythonrc,.pythonstartup',
\ 'qmake': '*.pro,*.pri',
\ 'qml': '*.qml,*.qbs',
\ 'r': '*.r,*.rsx,*.s,*.S,.Rprofile,expr-dist',
\ 'racket': '*.rkt,*.rktd,*.rktl,*.scrbl',
\ 'ragel': '*.rl',
\ 'raku': '*.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl,*.pl6,*.pm,*.pm6,*.t,*.rakudoc,*.rakutest,*.raku,*.rakumod,*.pod6,*.t6',
\ 'raml': '*.raml',
\ 'razor': '*.cshtml,*.razor',
\ 'reason': '*.re,*.rei',
\ 'requirements': '*.pip,*requirements.{txt,in},*require.{txt,in},constraints.{txt,in}',
\ 'rhelp': '*.rd',
\ 'rst': '*.rst,*.rest,*.rest.txt,*.rst.txt',
\ 'ruby': '*.rb,*.builder,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.pluginspec,*.podspec,*.rabl,*.rake,*.rbi,*.rbuild,*.rbw,*.rbx,*.ru,*.ruby,*.spec,*.thor,*.watchr,*.rxml,*.rjs,*.rant,*.axlsx,*.cap,*.opal,.irbrc,.pryrc,.simplecov,Appraisals,Berksfile,Buildfile,Capfile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,Mavenfile,Podfile,Puppetfile,Rakefile,Snapfile,Thorfile,Vagrantfile,buildfile,Rantfile,.autotest,Cheffile,KitchenSink,Routefile,.Guardfile,.Brewfile,vagrantfile,[Rr]akefile*,*_spec.rb',
\ 'rust': '*.rs,*.rs.in',
\ 'sbt.scala': '*.sbt',
\ 'scala': '*.scala,*.kojo,*.sc',
\ 'scss': '*.scss',
\ 'sexplib': '*.sexp',
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile,zlogin,zlogout,zprofile,zshenv,zshrc',
\ 'slim': '*.slim',
\ 'slime': '*.slime',
\ 'smt2': '*.smt2,*.smt',
\ 'solidity': '*.sol',
\ 'sql': '*.pgsql,*.pls,*.bdy,*.ddl,*.fnc,*.pck,*.pkb,*.pks,*.plb,*.plsql,*.prc,*.spc,*.sql,*.tpb,*.tps,*.trg,*.vw,*.tyb,*.typ,*.tyc',
\ 'stylus': '*.styl,*.stylus',
\ 'svelte': '*.svelte',
\ 'svg': '*.svg',
\ 'swift': '*.swift',
\ 'sxhkdrc': '*.sxhkdrc,sxhkdrc',
\ 'systemd': '*.automount,*.dnssd,*.link,*.mount,*.netdev,*.network,*.nspawn,*.path,*.service,*.slice,*.socket,*.swap,*.target,*.timer,*.#*',
\ 'tablegen': '*.td',
\ 'tads': '*.t',
\ 'terraform': '*.tf,*.tfvars',
\ 'textile': '*.textile',
\ 'thrift': '*.thrift',
\ 'tmux': '.tmux*.conf',
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,poetry.lock,Pipfile',
\ 'tptp': '*.p,*.tptp,*.ax',
\ 'trasys': '*.inp',
\ 'tt2': '*.tt2',
\ 'tt2html': '*.tt2',
\ 'typescript': '*.ts',
\ 'typescriptreact': '*.tsx',
\ 'unison': '*.u,*.uu',
\ 'v': '*.v',
\ 'vala': '*.vala,*.vapi,*.valadoc',
\ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
\ 'vbnet': '*.vb,*.vbhtml',
\ 'vcl': '*.vcl',
\ 'velocity': '*.vm',
\ 'vmasm': '*.mar',
\ 'vue': '*.vue,*.wpy',
\ 'xdc': '*.xdc',
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
\ 'xml.twig': '*.xml.twig',
\ 'xs': '*.xs',
\ 'xsl': '*.xslt,*.xsl',
\ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,glide.lock,yarn.lock,fish_history,fish_read_history',
\ 'yaml.ansible': 'playbook.y{a,}ml,site.y{a,}ml,main.y{a,}ml,local.y{a,}ml,requirements.y{a,}ml,tasks.*.y{a,}ml,roles.*.y{a,}ml,handlers.*.y{a,}ml',
\ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml',
\ 'zephir': '*.zep',
\ 'zig': '*.zig,*.zir',
\ 'zir': '*.zir',
\ 'zsh': '*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*',
\}
func! polyglot#sleuth#GlobForFiletype(type)
return get(s:globs, a:type, '')
endfunc

View File

@@ -65,12 +65,12 @@ endfunction
function! s:RustfmtConfigOptions() function! s:RustfmtConfigOptions()
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';') let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
if l:rustfmt_toml !=# '' if l:rustfmt_toml !=# ''
return '--config-path '.fnamemodify(l:rustfmt_toml, ":p") return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
endif endif
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';') let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
if l:_rustfmt_toml !=# '' if l:_rustfmt_toml !=# ''
return '--config-path '.fnamemodify(l:_rustfmt_toml, ":p") return '--config-path '.shellescape(fnamemodify(l:_rustfmt_toml, ":p"))
endif endif
" Default to edition 2018 in case no rustfmt.toml was found. " Default to edition 2018 in case no rustfmt.toml was found.
@@ -109,7 +109,7 @@ function! s:DeleteLines(start, end) abort
endfunction endfunction
function! s:RunRustfmt(command, tmpname, from_writepre) function! s:RunRustfmt(command, tmpname, from_writepre)
mkview! let l:view = winsaveview()
let l:stderr_tmpname = tempname() let l:stderr_tmpname = tempname()
call writefile([], l:stderr_tmpname) call writefile([], l:stderr_tmpname)
@@ -215,7 +215,7 @@ function! s:RunRustfmt(command, tmpname, from_writepre)
lwindow lwindow
endif endif
silent! loadview call winrestview(l:view)
endfunction endfunction
function! rustfmt#FormatRange(line1, line2) function! rustfmt#FormatRange(line1, line2)

View File

@@ -68,6 +68,7 @@ function! terraform#commands(ArgLead, CmdLine, CursorPos) abort
\ 'version', \ 'version',
\ 'workspace', \ 'workspace',
\ '0.12upgrade', \ '0.12upgrade',
\ '0.13upgrade',
\ 'debug', \ 'debug',
\ 'force-unlock', \ 'force-unlock',
\ 'push', \ 'push',

42
compiler/ant.vim Normal file
View File

@@ -0,0 +1,42 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
" Vim Compiler File
" Compiler: ant
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Mi, 13 Apr 2005 22:50:07 CEST
if exists("current_compiler")
finish
endif
let current_compiler = "ant"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=ant
" first line:
" ant with jikes +E, which assumes the following
" two property lines in your 'build.xml':
"
" <property name = "build.compiler" value = "jikes"/>
" <property name = "build.compiler.emacs" value = "true"/>
"
" second line:
" ant with javac
"
" note that this will work also for tasks like [wtkbuild]
"
CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
\%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
" ,%-C%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -969,8 +969,7 @@ The result is also available in the buffer-local variable `b:csv_result`.
See also |csv-aggregate-functions| See also |csv-aggregate-functions|
*MinCol_CSV* 3.27 Maximum/Minimum value of a Column *MaxCol_CSV* *MinCol_CSV*
3.27 Maximum/Minimum value of a Column *MaxCol_CSV*
--------------------------------------- ---------------------------------------
You can let Vim output the 10 maximum/minimum values of a column using the You can let Vim output the 10 maximum/minimum values of a column using the
`:CSVMaxCol` command > `:CSVMaxCol` command >
@@ -984,6 +983,7 @@ given, this calculates the sum for the column the cursor is on. Note, that the
delimiter will be stripped away from each value and also empty values won't be delimiter will be stripped away from each value and also empty values won't be
considered. considered.
*format_number_csv*
By default, Vim uses the a numerical format that uses the '.' as decimal By default, Vim uses the a numerical format that uses the '.' as decimal
separator while there is no thousands separator. If youre file contains separator while there is no thousands separator. If youre file contains
the numbers in a different format, you can use the /format/ option to specify the numbers in a different format, you can use the /format/ option to specify
@@ -1003,10 +1003,6 @@ uses the Space as thousands separator and the '.' as decimal separator.
If [distinct] is given, only returns the number of distinct values. If [distinct] is given, only returns the number of distinct values.
Note, if you Vim is compiled without floating point number format (|+float|),
Vim will only aggregate the integer part and therefore won't use the 'y'
argument in the /format/ specifier.
The result is also available in the buffer-local variable `b:csv_result`. The result is also available in the buffer-local variable `b:csv_result`.
3.28 Average value of a Column *AvgCol_CSV* 3.28 Average value of a Column *AvgCol_CSV*
@@ -1021,19 +1017,21 @@ given, this calculates the sum for the column the cursor is on. Note, that the
delimiter will be stripped away from each value and also empty values won't be delimiter will be stripped away from each value and also empty values won't be
considered. considered.
For the [/format/] part, see |MaxCol_CSV|. For the [/format/] part, see |format_number_csv|.
The result is also available in the buffer-local variable `b:csv_result`. The result is also available in the buffer-local variable `b:csv_result`.
See also |csv-aggregate-functions| See also |csv-aggregate-functions|
3.29 Variance of a Column *VarCol_CSV* 3.29 Variance of a Column *VarCol_CSV* *SmplVarCol* *PopVarCol*
_________________________ _________________________
:[range]PopVarCol [nr] [/format/] :[range]PopVarCol [nr] [/format/]
:[range]SmplVarCol [nr] [/format/] :[range]SmplVarCol [nr] [/format/]
Calculate the Population or Sample Variance for the specified column.
This outputs the result of the column `<nr>` within the range given. If no range This outputs the result of the column `<nr>` within the range given. If no range
is given, this will calculate the statistical variance of the whole column. If <nr> is not is given, this will calculate the statistical variance of the whole column. If <nr> is not
given, this calculates the variance for the column the cursor is on. Note, that the delimiter given, this calculates the variance for the column the cursor is on. Note, that the delimiter
@@ -1041,13 +1039,17 @@ will be stripped away from each value and also empty values won't be considered.
The result is also available in the buffer-local variable `b:csv_result`. The result is also available in the buffer-local variable `b:csv_result`.
3.30 Standard Deviation of a Column *StdDevCol_CSV* For the [/format/] part, see |format_number_csv|.
3.30 Standard Deviation of a Column *StdDevCol_CSV* *PopStdCol* *SmplStdCol*
___________________________________ ___________________________________
:[range]PopStdCol [nr] [/format/] :[range]PopStdCol [nr] [/format/]
:[range]SmplStdCol [nr] [/format/] :[range]SmplStdCol [nr] [/format/]
Calculate the Population or Sample Standard Deviation for the specified column.
This outputs the result of the column `<nr>` within the range given. If no range This outputs the result of the column `<nr>` within the range given. If no range
is given, this will calculate the standard deviation of the whole column. If <nr> is not is given, this will calculate the standard deviation of the whole column. If <nr> is not
given, this calculates the standard deviation for the column the cursor is on. Note, that given, this calculates the standard deviation for the column the cursor is on. Note, that
@@ -1055,6 +1057,8 @@ the delimiter will be stripped away from each value and also empty values won't
The result is also available in the buffer-local variable `b:csv_result`. The result is also available in the buffer-local variable `b:csv_result`.
For the [/format/] part, see |format_number_csv|.
*:CSVDupColumn* *:CSVDupColumn*
3.31 Duplicate columns *DupColumn_CSV* 3.31 Duplicate columns *DupColumn_CSV*
---------------------- ----------------------
@@ -1089,7 +1093,7 @@ This outputs the sum of the row [range]. If no range is given, this will
calculate the sum for the current row. Note, that the delimiter will be calculate the sum for the current row. Note, that the delimiter will be
stripped away from each value and also empty values won't be considered. stripped away from each value and also empty values won't be considered.
For the [/format/] part, see |MaxCol_CSV|. For the [/format/] part, see |format_number_csv|
============================================================================== ==============================================================================
4. CSV Configuration *csv-configuration* 4. CSV Configuration *csv-configuration*

85
doc/fzf_gitignore.txt Normal file
View File

@@ -0,0 +1,85 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gitignore') == -1
*fzf_gitignore.txt* Create useful .gitignore files for your project
Author: Filip Szymański <fszymanski.pl@gmail.com>
==============================================================================
CONTENTS *fzf-gitignore-contents*
1. Introduction |fzf-gitignore-introduction|
2. Configuration |fzf-gitignore-configuration|
3. Commands |fzf-gitignore-commands|
4. Mappings |fzf-gitignore-mappings|
5. License |fzf-gitignore-license|
6. Bugs |fzf-gitignore-bugs|
7. Contributing |fzf-gitignore-contributing|
==============================================================================
INTRODUCTION *fzf-gitignore-introduction*
fzf[1] interface for creating .gitignore files using the gitignore.io[2] API.
Note: This plugin was inspired by helm-gitignore[3].
==============================================================================
CONFIGURATION *fzf-gitignore-configuration*
*g:fzf_gitignore_no_maps*
Set this option to disable all key mappings.
>
let g:fzf_gitignore_no_maps = 1
<
Default: Not defined (number)
*g:fzf_gitignore_map*
Set this option to change the |<Plug>(fzf-gitignore)| key mapping.
>
let g:fzf_gitignore_map = '<Leader>i'
<
Default: '<Leader>gi' (string)
==============================================================================
COMMANDS *fzf-gitignore-commands*
*:FzfGitignore*
Create .gitignore file.
==============================================================================
MAPPINGS *fzf-gitignore-mappings*
-----------------------------------+----------------------------------------
Mapping | Description ~
-----------------------------------+----------------------------------------
<Plug>(fzf-gitignore) | Create .gitignore file
-----------------------------------+----------------------------------------
==============================================================================
LICENSE *fzf-gitignore-license*
MIT
==============================================================================
BUGS *fzf-gitignore-bugs*
If you find a bug please create an issue on GitHub.
https://github.com/fszymanski/fzf-gitignore/issues
==============================================================================
CONTRIBUTING *fzf-gitignore-contributing*
Think you can make this plugin better? Awesome. Fork it on GitHub and create
a pull request.
https://github.com/fszymanski/fzf-gitignore
==============================================================================
[1] https://github.com/junegunn/fzf
[2] https://www.gitignore.io/
[3] https://github.com/jupl/helm-gitignore
vim: tw=78 ts=8 ft=help norl
endif

View File

@@ -46,8 +46,7 @@ the list of recognized template tag names.
REASONML *graphql-reasonml* REASONML *graphql-reasonml*
GraphQL syntax support inside of ReasonML template strings using graphql-ppx GraphQL syntax support inside of ReasonML template strings using graphql-ppx
is available when vim-reasonml (https://github.com/jordwalke/vim-reasonml) is is available.
also installed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
vim:tw=78:ft=help:norl: vim:tw=78:ft=help:norl:

View File

@@ -426,10 +426,6 @@ CTRL-t
If [!] is not given the first error is jumped to. If [!] is not given the first error is jumped to.
If using neovim `:GoTestFunc` will run in a new terminal or run
asynchronously in the background according to |'g:go_term_enabled'|. You
can set the mode of the new terminal with |'g:go_term_mode'|.
*:GoTestCompile* *:GoTestCompile*
:GoTestCompile[!] [expand] :GoTestCompile[!] [expand]
@@ -441,10 +437,6 @@ CTRL-t
If [!] is not given the first error is jumped to. If [!] is not given the first error is jumped to.
If using neovim `:GoTestCompile` will run in a new terminal or run
asynchronously in the background according to |'g:go_term_enabled'|. You
can set the mode of the new terminal with |'g:go_term_mode'|.
*:GoCoverage* *:GoCoverage*
:GoCoverage[!] [options] :GoCoverage[!] [options]
@@ -802,7 +794,7 @@ CTRL-t
You can define a constant value instead of the default field based value. You can define a constant value instead of the default field based value.
For example the following command will add ``valid:"1"`` to all fields. For example the following command will add ``valid:"1"`` to all fields.
> >
:GoAddTags valid=1 :GoAddTags valid:1
< <
*:GoRemoveTags* *:GoRemoveTags*
:[range]GoRemoveTags [key],[option] [key1],[option1] ... :[range]GoRemoveTags [key],[option] [key1],[option1] ...
@@ -1483,6 +1475,14 @@ accuracy or `godef` for its performance. Valid options are `godef`, `gopls`,
and `guru`. and `guru`.
> >
let g:go_def_mode = 'gopls' let g:go_def_mode = 'gopls'
<
*'g:go_fillstruct_mode'*
Use this option to define the command to be used for |:GoFillStruct|. By
default `fillstruct` is used. Valid values are `fillstruct` and `gopls`. By
default it is `fillstruct`.
>
let g:go_fillstruct_mode = 'fillstruct'
< <
*'g:go_referrers_mode'* *'g:go_referrers_mode'*
@@ -1718,6 +1718,13 @@ The default command used to open a new terminal for go commands such as
Applicable to Neovim and Vim with `terminal` feature only. Applicable to Neovim and Vim with `terminal` feature only.
> >
let g:go_term_mode = "vsplit" let g:go_term_mode = "vsplit"
<
*'g:go_term_reuse'*
Reuse the terminal window when |'g:go_term_enabled'| is set. By default it's
disabled.
>
let g:go_term_reuse = 0
< <
*'g:go_term_height'* *'g:go_term_height'*
*'g:go_term_width'* *'g:go_term_width'*
@@ -1782,25 +1789,34 @@ same.
*'g:go_gopls_enabled'* *'g:go_gopls_enabled'*
Specifies whether `gopls` can be used by vim-go. By default gopls is enabled. Specifies whether `gopls` can be used by vim-go.
When gopls is disabled completion will not work and other configuration
Completion will not work when gopls is disabled and other configuration
options may also need to be adjusted. options may also need to be adjusted.
By default gopls is enabled.
> >
let g:go_gopls_enabled = 1 let g:go_gopls_enabled = 1
< <
*'g:go_gopls_options'* *'g:go_gopls_options'*
The commandline arguments to pass to gopls. By default, it's `-remote=auto`. The commandline arguments to pass to gopls.
By default, it is `['-remote=auto']`.
> >
let g:go_gopls_options = [] let g:go_gopls_options = ['-remote=auto']
< <
*'g:go_gopls_analyses'* *'g:go_gopls_analyses'*
The analyses settings for `gopls`. By default, it's `v:null`. Valid map values The analyses settings for `gopls`.
are `v:true` and `v:false`.
The Expected value is either `v:null` or a dictionary. The dictionary will be
provided to `gopls` via json-rpc, so dictionary values need to be of the
appropriate type for Vim to convert to JSON (e.g. truthy dictionary values
should be `v:true` or `v:false`). By default, it is `v:null`.
> >
let g:go_gopls_analyses = v:null let g:go_gopls_analyses = v:null
< <
@@ -1808,34 +1824,36 @@ are `v:true` and `v:false`.
*'g:go_gopls_complete_unimported'* *'g:go_gopls_complete_unimported'*
Specifies whether `gopls` should include suggestions from unimported packages. Specifies whether `gopls` should include suggestions from unimported packages.
When it is `v:null`, `gopls`' default will be used. By default it is
`v:null`. When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_complete_unimported = v:null let g:go_gopls_complete_unimported = v:null
< <
*'g:go_gopls_deep_completion'* *'g:go_gopls_deep_completion'*
Specifies whether `gopls` should use deep completion. When it is `v:null`, Specifies whether `gopls` should use deep completion.
`gopls`' default will be used. By default it is `v:null`.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_deep_completion = v:null let g:go_gopls_deep_completion = v:null
< <
*'g:go_gopls_matcher'* *'g:go_gopls_matcher'*
Specifies how `gopls` should match for completions. Valid values are `v:null`, Specifies how `gopls` should match for completions.
`fuzzy`, and `caseSensitive`. When it is `v:null`, `gopls`' default will be
used. By default it is `v:null`. Valid values are `v:null`, `fuzzy`, and `caseSensitive`. When it is `v:null`,
`gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_matcher = v:null let g:go_gopls_matcher = v:null
< <
*'g:go_gopls_staticcheck'* *'g:go_gopls_staticcheck'*
Specifies whether `gopls` should run staticcheck checks. When it is `v:null`, Specifies whether `gopls` should run staticcheck checks.
`gopls`' default will be used. By default it is `v:null`.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_staticcheck = v:null let g:go_gopls_staticcheck = v:null
< <
@@ -1845,8 +1863,9 @@ Specifies whether `gopls` should run staticcheck checks. When it is `v:null`,
Specifies whether `gopls` can provide placeholders for function parameters and Specifies whether `gopls` can provide placeholders for function parameters and
struct fields. When set, completion items will be treated as anonymous struct fields. When set, completion items will be treated as anonymous
snippets if UltiSnips is installed and configured to be used as snippets if UltiSnips is installed and configured to be used as
|'g:go_snippet_engine'|. When it is `v:null`, `gopls`' default will be used. |'g:go_snippet_engine'|.
By default it is `v:null`.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_use_placeholders = v:null let g:go_gopls_use_placeholders = v:null
< <
@@ -1854,8 +1873,9 @@ By default it is `v:null`.
*'g:go_gopls_temp_modfile'* *'g:go_gopls_temp_modfile'*
Specifies whether `gopls` should use a temp modfile and suggest edits rather Specifies whether `gopls` should use a temp modfile and suggest edits rather
than modifying the ambient go.mod file. When it is `v:null`, `gopls`' default than modifying the ambient go.mod file.
will be used. By default it is `v:null`.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_temp_modfile = v:null let g:go_gopls_temp_modfile = v:null
< <
@@ -1863,17 +1883,41 @@ will be used. By default it is `v:null`.
*'g:go_gopls_local'* *'g:go_gopls_local'*
Specifies the prefix for imports that `gopls` should consider group Specifies the prefix for imports that `gopls` should consider group
separately. When it is `v:null`, `gopls`' default will be used. By default it separately.
is `v:null`.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
> >
let g:go_gopls_local = v:null let g:go_gopls_local = v:null
< <
*'g:go_gopls_gofumpt'*
Specifies whether `gopls` should use `gofumpt` for formatting.
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
>
let g:go_gopls_gofumpt = v:null
<
*'g:go_gopls_settings'*
Specifies `gopls` workspace settings for `gopls` that are not yet officially
supported by vim-go.
Any value in the dictionary will be overridden by values provided in the
specific options supported by vim-go (e.g. g:go_gopls_staticcheck) or
settings statically configured by vim-go to ensure expected behavior. By
default it is `v:null`.
>
let g:go_gopls_settings = v:null
<
*'g:go_diagnostics_enabled'* *'g:go_diagnostics_enabled'*
Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for
the current buffer will be processed when it is not set; all others will be the current buffer will be processed when it is not set; all others will be
ignored. By default it is disabled. ignored.
By default it is disabled.
> >
let g:go_diagnostics_enabled = 0 let g:go_diagnostics_enabled = 0
< <
@@ -2242,6 +2286,8 @@ The program will halt on the breakpoint, at which point you can inspect the
program state. You can go to the next line with |:GoDebugNext| (<F10>) or step program state. You can go to the next line with |:GoDebugNext| (<F10>) or step
in with |:GoDebugStep| (<F11>). in with |:GoDebugStep| (<F11>).
The program can also be halted with `:GoDebugHalt` (<F6>).
The variable window in the bottom left (`GODEBUG_VARIABLES`) will display all The variable window in the bottom left (`GODEBUG_VARIABLES`) will display all
local variables. Struct values are displayed as `{...}`, array/slices as local variables. Struct values are displayed as `{...}`, array/slices as
`[4]`. Use <CR> on the variable name to expand the values. `[4]`. Use <CR> on the variable name to expand the values.
@@ -2258,10 +2304,21 @@ the `dlv` process, or |:GoDebugRestart| to recompile the code.
*go-debug-commands* *go-debug-commands*
DEBUGGER COMMANDS~ DEBUGGER COMMANDS~
Only |:GoDebugStart|, `:GoDebugTest`, and |:GoDebugBreakpoint| are available Only |:GoDebugAttach|, |:GoDebugStart|, |:GoDebugTest|, and
by default. `:GoDebugContinue` becomes available after running `:GoDebugStart` |:GoDebugBreakpoint| are available by default. |:GoDebugContinue| becomes
or `:GoDebugTest`. The rest of the commands and mappings become available available after running |:GoDebugAttach|, |:GoDebugStart| or |:GoDebugTest|.
after executing `:GoDebugContinue`. The rest of the commands and mappings become available after executing
|:GoDebugContinue|.
*:GoDebugAttach*
:GoDebugAttach pid
Start the debug mode for pid; this does several things:
* Setup the debug windows according to |'g:go_debug_windows'|.
* Make the `:GoDebug*` commands and `(go-debug-*)` mappings available.
Use |:GoDebugStop| to stop `dlv` and exit debugging mode.
*:GoDebugStart* *:GoDebugStart*
:GoDebugStart [pkg] [program-args] :GoDebugStart [pkg] [program-args]
@@ -2285,12 +2342,28 @@ after executing `:GoDebugContinue`.
Use `-test.flag` to pass flags to `go test` when debugging a test; for Use `-test.flag` to pass flags to `go test` when debugging a test; for
example `-test.v` or `-test.run TestFoo` example `-test.v` or `-test.run TestFoo`
*:GoDebugTestFunc*
:GoDebugTestFunc [expand]
Behaves the same as |:GoDebugTest| and implicitly adds `-test.run` to run
the nearest test or example function (i.e the nearest function declaration
that matches `func Test` or `func Example`) at or previous to the cursor.
Search will not wrap around when at the top of the file.
*:GoDebugRestart* *:GoDebugRestart*
:GoDebugRestart :GoDebugRestart
Stop the program (if running) and restart `dlv` to recompile the package. Stop the program (if running) and restart `dlv` to recompile the package.
The current window layout and breakpoints will be left intact. The current window layout and breakpoints will be left intact.
*:GoDebugHalt*
*(go-debug-halt)*
:GoDebugHalt
Halt the program.
Mapped to <F6> by default.
*:GoDebugStop* *:GoDebugStop*
*(go-debug-stop)* *(go-debug-stop)*
:GoDebugStop :GoDebugStop

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
vim-jsx-pretty is syntax highlight for JSX (React.js). vim-jsx-pretty is syntax highlight for JSX (React.js).
(https://github.com/MaxMEllon/vim-jsx-pretty) (https://github.com/MaxMEllon/vim-jsx-pretty)
@@ -46,6 +46,7 @@ CONFIG *vim-jsx-pretty-config*
|---------------------------------------|---------|----------------------| |---------------------------------------|---------|----------------------|
| g:vim_jsx_pretty_enable_jsx_highlight | 1 | jsx highlight flag | | g:vim_jsx_pretty_enable_jsx_highlight | 1 | jsx highlight flag |
| g:vim_jsx_pretty_colorful_config | 0 | colorful config flag | | g:vim_jsx_pretty_colorful_config | 0 | colorful config flag |
| g:vim_jsx_pretty_disable_js | 0 | js toggle flag |
< <
- *g:vim_jsx_pretty_enable_jsx_highlight* - *g:vim_jsx_pretty_enable_jsx_highlight*

1215
filetype.vim Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

29
ftplugin/8th.vim Normal file
View File

@@ -0,0 +1,29 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '8th') == -1
" Vim ftplugin file
" Language: 8th
" Version: any
" Last Change: 2015/11/08
" Maintainer: Ron Aaron <ron@aaron-tech.com>
" URL: https://8th-dev.com/
" Filetypes: *.8th
" NOTE: 8th allows any non-whitespace in a name, so you need to do:
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
" This goes with the syntax/8th.vim file.
" Only do this when not done yet for this buffer
if exists("b:did_8thplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_8thplugin = 1
setlocal ts=2 sts=2 sw=2 et
setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
setlocal fo=tcrqol
setlocal matchpairs+=\::;
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
setlocal suffixesadd=.8th
endif

24
ftplugin/a2ps.vim Normal file
View File

@@ -0,0 +1,24 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'a2ps') == -1
" Vim filetype plugin file
" Language: a2ps(1) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< inc< fo<"
setlocal comments=:# commentstring=#\ %s include=^\\s*Include:
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

29
ftplugin/aap.vim Normal file
View File

@@ -0,0 +1,29 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aap') == -1
" Vim filetype plugin file
" Language: Aap recipe
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 Apr 05
" 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
" Reset 'formatoptions', 'comments' and 'expandtab' to undo this plugin.
let b:undo_ftplugin = "setl fo< com< et<"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql
" Set 'comments' to format dashed lists in comments.
setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:-
" Expand tabs to spaces to avoid trouble.
setlocal expandtab
endif

33
ftplugin/abap.vim Normal file
View File

@@ -0,0 +1,33 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abap') == -1
" Vim filetype plugin file
" Language: ABAP
" Author: Steven Oliver <oliver.steven@gmail.com>
" Copyright: Copyright (c) 2013 Steven Oliver
" License: You may redistribute this under the same terms as Vim itself
" --------------------------------------------------------------------------
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal softtabstop=2 shiftwidth=2
setlocal suffixesadd=.abap
" Windows allows you to filter the open file dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
\ "All Files (*.*)\t*.*\n"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: set sw=4 sts=4 et tw=80 :
endif

101
ftplugin/abaqus.vim Normal file
View File

@@ -0,0 +1,101 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abaqus') == -1
" Vim filetype plugin file
" Language: Abaqus finite element input file (www.abaqus.com)
" Maintainer: Carl Osterwisch <osterwischc@asme.org>
" Last Change: 2012 Apr 30
" 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
" Save the compatibility options and temporarily switch to vim defaults
let s:cpo_save = &cpoptions
set cpoptions&vim
" Set the format of the include file specification for Abaqus
" Used in :check gf ^wf [i and other commands
setlocal include=\\<\\cINPUT\\s*=
" Remove characters up to the first = when evaluating filenames
setlocal includeexpr=substitute(v:fname,'.\\{-}=','','')
" Remove comma from valid filename characters since it is used to
" separate keyword parameters
setlocal isfname-=,
" Define format of comment lines (see 'formatoptions' for uses)
setlocal comments=:**
setlocal commentstring=**%s
" Definitions start with a * and assign a NAME, NSET, or ELSET
" Used in [d ^wd and other commands
setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
" Abaqus keywords and identifiers may include a - character
setlocal iskeyword+=-
let b:undo_ftplugin = "setlocal include< includeexpr< isfname<"
\ . " comments< commentstring< define< iskeyword<"
if has("folding")
" Fold all lines that do not begin with *
setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
setlocal foldmethod=expr
let b:undo_ftplugin .= " foldexpr< foldmethod<"
endif
" Set the file browse filter (currently only supported under Win32 gui)
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
\ "Abaqus Results (*.dat)\t*.dat\n" .
\ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
\ "All Files (*.*)\t*.*\n"
let b:undo_ftplugin .= "|unlet! b:browsefilter"
endif
" Define patterns for the matchit plugin
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 1
let b:match_words =
\ '\*part:\*end\s*part,' .
\ '\*assembly:\*end\s*assembly,' .
\ '\*instance:\*end\s*instance,' .
\ '\*step:\*end\s*step'
let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words"
endif
" Define keys used to move [count] keywords backward or forward.
noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
" Define key to toggle commenting of the current line or range
noremap <silent><buffer> <LocalLeader><LocalLeader>
\ :call <SID>Abaqus_ToggleComment()<CR>j
function! <SID>Abaqus_ToggleComment() range
if strpart(getline(a:firstline), 0, 2) == "**"
" Un-comment all lines in range
silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
else
" Comment all lines in range
silent execute a:firstline . ',' . a:lastline . 's/^/**/'
endif
endfunction
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
\ . "|unmap <buffer> <LocalLeader><LocalLeader>"
" Undo must be done in nocompatible mode for <LocalLeader>.
let b:undo_ftplugin = "let s:cpo_save = &cpoptions|"
\ . "set cpoptions&vim|"
\ . b:undo_ftplugin
\ . "|let &cpoptions = s:cpo_save"
\ . "|unlet s:cpo_save"
" Restore saved compatibility options
let &cpoptions = s:cpo_save
unlet s:cpo_save
endif

214
ftplugin/ada.vim Normal file
View File

@@ -0,0 +1,214 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6 with patch from David Bürgin
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
" 02.10.2006 MK Better folding.
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" 08.07.2007 TV fix default compiler problems.
" Help Page: ft-ada-plugin
"------------------------------------------------------------------------------
" Provides mapping overrides for tag jumping that figure out the current
" Ada object and tag jump to that, not the 'simple' vim word.
" Similarly allows <Ctrl-N> matching of full-length ada entities from tags.
"------------------------------------------------------------------------------
" Only do this when not done yet for this buffer
if exists ("b:did_ftplugin") || version < 700
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 45
"
" Temporarily set cpoptions to ensure the script loads OK
"
let s:cpoptions = &cpoptions
set cpoptions-=C
" Section: Comments {{{1
"
setlocal comments=O:--,:--\ \
setlocal commentstring=--\ \ %s
setlocal complete=.,w,b,u,t,i
" Section: case {{{1
"
setlocal nosmartcase
setlocal ignorecase
" Section: formatoptions {{{1
"
setlocal formatoptions+=ron
" Section: Tagging {{{1
"
if exists ("g:ada_extended_tagging")
" Make local tag mappings for this buffer (if not already set)
if g:ada_extended_tagging == 'jump'
if mapcheck('<C-]>','n') == ''
nnoremap <unique> <buffer> <C-]> :call ada#Jump_Tag ('', 'tjump')<cr>
endif
if mapcheck('g<C-]>','n') == ''
nnoremap <unique> <buffer> g<C-]> :call ada#Jump_Tag ('','stjump')<cr>
endif
elseif g:ada_extended_tagging == 'list'
if mapcheck('<C-]>','n') == ''
nnoremap <unique> <buffer> <C-]> :call ada#List_Tag ()<cr>
endif
if mapcheck('g<C-]>','n') == ''
nnoremap <unique> <buffer> g<C-]> :call ada#List_Tag ()<cr>
endif
endif
endif
" Section: Completion {{{1
"
setlocal completefunc=ada#User_Complete
setlocal omnifunc=adacomplete#Complete
if exists ("g:ada_extended_completion")
if mapcheck ('<C-N>','i') == ''
inoremap <unique> <buffer> <C-N> <C-R>=ada#Completion("\<lt>C-N>")<cr>
endif
if mapcheck ('<C-P>','i') == ''
inoremap <unique> <buffer> <C-P> <C-R>=ada#Completion("\<lt>C-P>")<cr>
endif
if mapcheck ('<C-X><C-]>','i') == ''
inoremap <unique> <buffer> <C-X><C-]> <C-R>=<SID>ada#Completion("\<lt>C-X>\<lt>C-]>")<cr>
endif
if mapcheck ('<bs>','i') == ''
inoremap <silent> <unique> <buffer> <bs> <C-R>=ada#Insert_Backspace ()<cr>
endif
endif
" Section: Matchit {{{1
"
" Only do this when not done yet for this buffer & matchit is used
"
if !exists ("b:match_words") &&
\ exists ("loaded_matchit")
"
" The following lines enable the macros/matchit.vim plugin for
" Ada-specific extended matching with the % key.
"
let s:notend = '\%(\<end\s\+\)\@<!'
let b:match_words =
\ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
\ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
\ '\%(\<while\>.*\|\<for\>.*\|'.s:notend.'\)\<loop\>:\<end\>\s\+\<loop\>,' .
\ '\%(\<do\>\|\<begin\>\):\<exception\>:\<end\>\s*\%($\|[;A-Z]\),' .
\ s:notend . '\<record\>:\<end\>\s\+\<record\>'
endif
" Section: Compiler {{{1
"
if ! exists("g:ada_default_compiler")
if has("vms")
let g:ada_default_compiler = 'decada'
else
let g:ada_default_compiler = 'gnat'
endif
endif
if ! exists("current_compiler") ||
\ current_compiler != g:ada_default_compiler
execute "compiler " . g:ada_default_compiler
endif
" Section: Folding {{{1
"
if exists("g:ada_folding")
if g:ada_folding[0] == 'i'
setlocal foldmethod=indent
setlocal foldignore=--
setlocal foldnestmax=5
elseif g:ada_folding[0] == 'g'
setlocal foldmethod=expr
setlocal foldexpr=ada#Pretty_Print_Folding(v:lnum)
elseif g:ada_folding[0] == 's'
setlocal foldmethod=syntax
endif
setlocal tabstop=8
setlocal softtabstop=3
setlocal shiftwidth=3
endif
" Section: Abbrev {{{1
"
if exists("g:ada_abbrev")
iabbrev ret return
iabbrev proc procedure
iabbrev pack package
iabbrev func function
endif
" Section: Commands, Mapping, Menus {{{1
"
call ada#Map_Popup (
\ 'Tag.List',
\ 'l',
\ 'call ada#List_Tag ()')
call ada#Map_Popup (
\'Tag.Jump',
\'j',
\'call ada#Jump_Tag ()')
call ada#Map_Menu (
\'Tag.Create File',
\':AdaTagFile',
\'call ada#Create_Tags (''file'')')
call ada#Map_Menu (
\'Tag.Create Dir',
\':AdaTagDir',
\'call ada#Create_Tags (''dir'')')
call ada#Map_Menu (
\'Highlight.Toggle Space Errors',
\ ':AdaSpaces',
\'call ada#Switch_Syntax_Option (''space_errors'')')
call ada#Map_Menu (
\'Highlight.Toggle Lines Errors',
\ ':AdaLines',
\'call ada#Switch_Syntax_Option (''line_errors'')')
call ada#Map_Menu (
\'Highlight.Toggle Rainbow Color',
\ ':AdaRainbow',
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
call ada#Map_Menu (
\'Highlight.Toggle Standard Types',
\ ':AdaTypes',
\'call ada#Switch_Syntax_Option (''standard_types'')')
" 1}}}
" Reset cpoptions
let &cpoptions = s:cpoptions
unlet s:cpoptions
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
endif

23
ftplugin/alsaconf.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'alsaconf') == -1
" Vim filetype plugin file
" Language: alsaconf(8) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

48
ftplugin/ant.vim Normal file
View File

@@ -0,0 +1,48 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
" Vim filetype plugin file
" Language: ant
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
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 = "XML Files (*.xml)\t*.xml\n" .
\ "All Files (*.*)\t*.*\n"
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
" Change the :browse e filter to primarily show Ant-related files.
if has("gui_win32")
let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" .
\ "Java Files (*.java)\t*.java\n" .
\ "Properties Files (*.prop*)\t*.prop*\n" .
\ "Manifest Files (*.mf)\t*.mf\n" .
\ s:browsefilter
endif
" Undo the stuff we changed.
let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
endif

23
ftplugin/arch.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arch') == -1
" Vim filetype plugin file
" Language: GNU Arch inventory file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

19
ftplugin/art.vim Normal file
View File

@@ -0,0 +1,19 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'art') == -1
" Vim filetype plugin
" Language: ART-IM and ART*Enterprise
" Maintainer: Dorai Sitaram <ds26@gte.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: Apr 2, 2003
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
run ftplugin/lisp.vim
setl lw-=if
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while
endif

64
ftplugin/aspvbs.vim Normal file
View File

@@ -0,0 +1,64 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aspvbs') == -1
" Vim filetype plugin file
" Language: aspvbs
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
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 = "HTML Files (*.html, *.htm)\t*.htm*\n" .
\ "All Files (*.*)\t*.*\n"
let s:match_words = ""
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
if exists("b:match_words")
let s:match_words = b:match_words
endif
" ASP: Active Server Pages (with Visual Basic Script)
" thanks to Gontran BAERTS
if exists("loaded_matchit")
let s:notend = '\%(\<end\s\+\)\@<!'
let b:match_ignorecase = 1
let b:match_words =
\ s:notend . '\<if\>\%(.\{-}then\s\+\w\)\@!:\<elseif\>:^\s*\<else\>:\<end\s\+\<if\>,' .
\ s:notend . '\<select\s\+case\>:\<case\>:\<case\s\+else\>:\<end\s\+select\>,' .
\ '^\s*\<sub\>:\<end\s\+sub\>,' .
\ '^\s*\<function\>:\<end\s\+function\>,' .
\ '\<class\>:\<end\s\+class\>,' .
\ '^\s*\<do\>:\<loop\>,' .
\ '^\s*\<for\>:\<next\>,' .
\ '\<while\>:\<wend\>,' .
\ s:match_words
endif
" Change the :browse e filter to primarily show ASP-related files.
if has("gui_win32")
let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter
endif
let b:undo_ftplugin = "unlet! b:match_words b:match_ignorecase b:browsefilter | " . s:undo_ftplugin
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
endif

20
ftplugin/automake.vim Normal file
View File

@@ -0,0 +1,20 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'automake') == -1
" Vim filetype plugin file
" Language: Automake
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim
let &cpo = s:cpo_save
unlet s:cpo_save
endif

22
ftplugin/awk.vim Normal file
View File

@@ -0,0 +1,22 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'awk') == -1
" Vim filetype plugin
" Language: awk, nawk, gawk, mawk
" Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2017 Feb 17
" This plugin was prepared by Mark Sikora
" 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
let b:undo_ftplugin = "setl commentstring<"
setlocal commentstring=#\ %s
endif

98
ftplugin/bzl.vim Normal file
View File

@@ -0,0 +1,98 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'bzl') == -1
" Vim filetype plugin file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2015 Aug 11
""
" @section Introduction, intro
" Core settings for the bzl filetype, used for BUILD and *.bzl files for the
" Bazel build system (http://bazel.io/).
if exists('b:did_ftplugin')
finish
endif
" Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force
" PEP8 conventions on every python file, but these conflict with Google's
" indentation guidelines. As a workaround, we explicitly source the system
" ftplugin, but save indentation settings beforehand and restore them after.
let s:save_expandtab = &l:expandtab
let s:save_shiftwidth = &l:shiftwidth
let s:save_softtabstop = &l:softtabstop
let s:save_tabstop = &l:tabstop
" NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken
" for compatible mode.
let s:save_cpo = &cpo
set cpo&vim
" Load base python ftplugin (also defines b:did_ftplugin).
source $VIMRUNTIME/ftplugin/python.vim
" NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim.
setlocal comments=b:#,fb:-
" Restore pre-existing indentation settings.
let &l:expandtab = s:save_expandtab
let &l:shiftwidth = s:save_shiftwidth
let &l:softtabstop = s:save_softtabstop
let &l:tabstop = s:save_tabstop
setlocal formatoptions-=t
" Make gf work with imports in BUILD files.
setlocal includeexpr=substitute(v:fname,'//','','')
" Enable syntax-based folding, if specified.
if get(g:, 'ft_bzl_fold', 0)
setlocal foldmethod=syntax
setlocal foldtext=BzlFoldText()
endif
if exists('*BzlFoldText')
finish
endif
function BzlFoldText() abort
let l:start_num = nextnonblank(v:foldstart)
let l:end_num = prevnonblank(v:foldend)
if l:end_num <= l:start_num + 1
" If the fold is empty, don't print anything for the contents.
let l:content = ''
else
" Otherwise look for something matching the content regex.
" And if nothing matches, print an ellipsis.
let l:content = '...'
for l:line in getline(l:start_num + 1, l:end_num - 1)
let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$')
if !empty(l:content_match)
let l:content = l:content_match
break
endif
endfor
endif
" Enclose content with start and end
let l:start_text = getline(l:start_num)
let l:end_text = substitute(getline(l:end_num), '^\s*', '', '')
let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text
" Compute the available width for the displayed text.
let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0)
let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines'
" Expand tabs, truncate, pad, and concatenate
let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g')
let l:text = strpart(l:text, 0, l:width - len(l:lines_folded))
let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text))
return l:text . l:padding . l:lines_folded
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
endif

23
ftplugin/conf.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'conf') == -1
" Vim filetype plugin file
" Language: generic configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -37,8 +37,9 @@ nnoremap <buffer><Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR>
nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR> nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR>
nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR> nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR>
" autocmd is setup per buffer. Please do not use :autocmd!. It refreshes
" augroup hence removes autocmds for other buffers (#105)
augroup plugin-ft-crystal augroup plugin-ft-crystal
autocmd!
autocmd BufWritePre <buffer> if g:crystal_auto_format && &filetype ==# 'crystal' | call crystal_lang#format('', 1) | endif autocmd BufWritePre <buffer> if g:crystal_auto_format && &filetype ==# 'crystal' | call crystal_lang#format('', 1) | endif
augroup END augroup END

23
ftplugin/dosini.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dosini') == -1
" Vim filetype plugin file
" Language: Configuration File (ini file) for MSDOS/MS Windows
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

20
ftplugin/gitignore.vim Normal file
View File

@@ -0,0 +1,20 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gitignore') == -1
scriptencoding utf-8
" Copyright (c) 2017-2020 Filip Szymański. All rights reserved.
" Use of this source code is governed by an MIT license that can be
" found in the LICENSE file.
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal commentstring=#\ %s
let b:undo_ftplugin = 'setlocal commentstring<'
" vim: ts=2 et sw=2
endif

23
ftplugin/groovy.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
" Vim filetype plugin file
" Language: groovy
" Maintainer: Justin M. Keyes <justinkz@gmail.com>
" Last Change: 2016 May 22
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo-=C
let b:undo_ftplugin = 'setlocal commentstring<'
setlocal commentstring=//%s
let &cpo = s:cpo_save
unlet s:cpo_save
endif

23
ftplugin/grub.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'grub') == -1
" Vim filetype plugin file
" Language: grub(8) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

127
ftplugin/handlebars.vim Normal file
View File

@@ -0,0 +1,127 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
if exists('b:loaded_mustache_handlebars')
finish
endif
let b:loaded_mustache_handlebars = 1
let s:cpo_save = &cpo
set cpo&vim
" Matchit support for Mustache & Handlebars
" extending HTML matchit groups
if exists("loaded_matchit") && exists("b:match_words")
let b:match_words = b:match_words
\ . ',{:},[:],(:),'
\ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}'
\ . ':'
\ . '\%({{\)\@<=\s*else\s*}}'
\ . ':'
\ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},'
\ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}'
\ . ':'
\ . '\%({{\)\@<=/\s*\1\s*}}'
endif
" Set template for comment
setlocal commentstring={{!--\ %s\ --}}
if exists("g:mustache_abbreviations")
inoremap <buffer> {{{ {{{}}}<left><left><left>
inoremap <buffer> {{ {{}}<left><left>
inoremap <buffer> {{! {{!}}<left><left>
inoremap <buffer> {{< {{<}}<left><left>
inoremap <buffer> {{> {{>}}<left><left>
inoremap <buffer> {{# {{#}}<cr>{{/}}<up><left><left>
inoremap <buffer> {{if {{#if }}<cr>{{/if}}<up><left>
inoremap <buffer> {{ife {{#if }}<cr>{{else}}<cr>{{/if}}<up><up><left>
endif
" Section movement
" Adapted from vim-ruby - many thanks to the maintainers of that plugin
function! s:sectionmovement(pattern,flags,mode,count)
norm! m'
if a:mode ==# 'v'
norm! gv
endif
let i = 0
while i < a:count
let i = i + 1
" saving current position
let line = line('.')
let col = col('.')
let pos = search(a:pattern,'W'.a:flags)
" if there's no more matches, return to last position
if pos == 0
call cursor(line,col)
return
endif
endwhile
endfunction
nnoremap <silent> <buffer> [[ :<C-U>call <SID>sectionmovement('{{','b','n',v:count1)<CR>
nnoremap <silent> <buffer> ]] :<C-U>call <SID>sectionmovement('{{','' ,'n',v:count1)<CR>
xnoremap <silent> <buffer> [[ :<C-U>call <SID>sectionmovement('{{','b','v',v:count1)<CR>
xnoremap <silent> <buffer> ]] :<C-U>call <SID>sectionmovement('{{','' ,'v',v:count1)<CR>
" Operator pending mappings
" Operators are available by default. Set `let g:mustache_operators = 0` in
" your .vimrc to disable them.
if ! exists("g:mustache_operators")
let g:mustache_operators = 1
endif
if exists("g:mustache_operators") && g:mustache_operators
onoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR>
onoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR>
xnoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR>
xnoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR>
endif
function! s:wrap_around()
" If the cursor is at the end of the tag element, move back
" so that the end tag can be detected.
while getline('.')[col('.')-1] ==# '}'
execute 'norm h'
endwhile
" Moves to the end of the closing tag
let pos = search('}}','We')
if pos != 0
if getline('.')[col('.')] ==# '}'
" Ending tag contains 3 closing brackets '}}}',
" move to the last bracket.
execute 'norm l'
endif
" select the whole tag
execute 'norm v%'
endif
endfunction
function! s:wrap_inside()
" If the cursor is at the end of the tag element, move back
" so that the end tag can be detected.
while getline('.')[col('.')-1] ==# '}'
execute 'norm h'
endwhile
" Moves to the end of the closing tag
let pos = search('}}','W')
if pos != 0
" select only inside the tag
execute 'norm v%loho'
endif
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nofoldenable
endif

101
ftplugin/help.vim Normal file
View File

@@ -0,0 +1,101 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'help') == -1
" Vim filetype plugin file
" Language: Vim help file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2018-12-29
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<"
setlocal formatoptions+=tcroql textwidth=78
if has("conceal")
setlocal cole=2 cocu=nc
endif
" Prefer Vim help instead of manpages.
setlocal keywordprg=:help
if !exists('g:no_plugin_maps')
function! s:show_toc() abort
let bufname = bufname('%')
let info = getloclist(0, {'winid': 1})
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
lopen
return
endif
let toc = []
let lnum = 2
let last_line = line('$') - 1
let last_added = 0
let has_section = 0
let has_sub_section = 0
while lnum && lnum <= last_line
let level = 0
let add_text = ''
let text = getline(lnum)
if text =~# '^=\+$' && lnum + 1 < last_line
" A de-facto section heading. Other headings are inferred.
let has_section = 1
let has_sub_section = 0
let lnum = nextnonblank(lnum + 1)
let text = getline(lnum)
let add_text = text
while add_text =~# '\*[^*]\+\*\s*$'
let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$')
endwhile
elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$'
" Any line that's yelling is important.
let has_sub_section = 1
let level = has_section
let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$')
elseif text =~# '\~$'
\ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}'
\ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$'
\ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$'
" These lines could be headers or code examples. We only want the
" ones that have subsequent lines at the same indent or more.
let l = nextnonblank(lnum + 1)
if getline(l) =~# '\*[^*]\+\*$'
" Ignore tag lines
let l = nextnonblank(l + 1)
endif
if indent(lnum) <= indent(l)
let level = has_section + has_sub_section
let add_text = matchstr(text, '\S.*')
endif
endif
let add_text = substitute(add_text, '\s\+$', '', 'g')
if !empty(add_text) && last_added != lnum
let last_added = lnum
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
\ 'text': repeat(' ', level) . add_text})
endif
let lnum = nextnonblank(lnum + 1)
endwhile
call setloclist(0, toc, ' ')
call setloclist(0, [], 'a', {'title': 'Help TOC'})
lopen
let w:qf_toc = bufname
endfunction
nnoremap <silent><buffer> gO :call <sid>show_toc()<cr>
endif
let &cpo = s:cpo_save
unlet s:cpo_save
endif

17
ftplugin/htmldjango.vim Normal file
View File

@@ -0,0 +1,17 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'htmldjango') == -1
" Vim filetype plugin file
" Language: Django HTML template
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
" Last Change: 2007 Jan 25
" Only use this filetype plugin when no other was loaded.
if exists("b:did_ftplugin")
finish
endif
" Use HTML and Django template ftplugins.
runtime! ftplugin/html.vim
runtime! ftplugin/django.vim
endif

334
ftplugin/idris2.vim Normal file
View File

@@ -0,0 +1,334 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
if bufname('%') == "idris-response"
finish
endif
if exists("b:did_ftplugin")
finish
endif
setlocal shiftwidth=2
setlocal tabstop=2
if !exists("g:idris_allow_tabchar") || g:idris_allow_tabchar == 0
setlocal expandtab
endif
setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
setlocal commentstring=--%s
setlocal iskeyword+=?
setlocal wildignore+=*.ibc
let idris_response = 0
let b:did_ftplugin = 1
" Text near cursor position that needs to be passed to a command.
" Refinment of `expand(<cword>)` to accomodate differences between
" a (n)vim word and what Idris requires.
function! s:currentQueryObject()
let word = expand("<cword>")
if word =~ '^?'
" Cut off '?' that introduces a hole identifier.
let word = strpart(word, 1)
endif
return word
endfunction
function! s:IdrisCommand(...)
let idriscmd = shellescape(join(a:000))
" echo("idris2 " . expand ('%:p') . " --client " . idriscmd)
return system("idris2 --find-ipkg " . shellescape(expand('%:p')) . " --client " . idriscmd)
endfunction
function! IdrisDocFold(lineNum)
let line = getline(a:lineNum)
if line =~ "^\s*|||"
return "1"
endif
return "0"
endfunction
function! IdrisFold(lineNum)
return IdrisDocFold(a:lineNum)
endfunction
setlocal foldmethod=expr
setlocal foldexpr=IdrisFold(v:lnum)
function! IdrisResponseWin()
if (!bufexists("idris-response"))
botright 10split
badd idris-response
b idris-response
let g:idris_respwin = "active"
set buftype=nofile
wincmd k
elseif (bufexists("idris-response") && g:idris_respwin == "hidden")
botright 10split
b idris-response
let g:idris_respwin = "active"
wincmd k
endif
endfunction
function! IdrisHideResponseWin()
let g:idris_respwin = "hidden"
endfunction
function! IdrisShowResponseWin()
let g:idris_respwin = "active"
endfunction
function! IWrite(str)
if (bufexists("idris-response"))
let save_cursor = getcurpos()
b idris-response
%delete
let resp = split(a:str, '\n')
call append(1, resp)
b #
call setpos('.', save_cursor)
else
echo a:str
endif
endfunction
function! IdrisReload(q)
w
let file = expand('%:p')
let tc = system("idris2 --find-ipkg " . shellescape(file) . " --client ''")
if (! (tc is ""))
call IWrite(tc)
else
if (a:q==0)
call IWrite("Successfully reloaded " . file)
endif
endif
return tc
endfunction
function! IdrisReloadToLine(cline)
return IdrisReload(1)
"w
"let file = expand("%:p")
"let tc = s:IdrisCommand(":lto", a:cline, file)
"if (! (tc is ""))
" call IWrite(tc)
"endif
"return tc
endfunction
function! IdrisShowType()
w
let word = s:currentQueryObject()
let cline = line(".")
let ccol = col(".")
let ty = s:IdrisCommand(":t", word)
call IWrite(ty)
endfunction
function! IdrisShowDoc()
w
let word = expand("<cword>")
let ty = s:IdrisCommand(":doc", word)
call IWrite(ty)
endfunction
function! IdrisProofSearch(hint)
let view = winsaveview()
w
let cline = line(".")
let word = s:currentQueryObject()
if (a:hint==0)
let hints = ""
else
let hints = input ("Hints: ")
endif
let result = s:IdrisCommand(":ps!", cline, word, hints)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
endif
endfunction
function! IdrisGenerateDef()
let view = winsaveview()
w
let cline = line(".")
let word = s:currentQueryObject()
let result = s:IdrisCommand(":gd!", cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
endif
endfunction
function! IdrisMakeLemma()
let view = winsaveview()
w
let cline = line(".")
let word = s:currentQueryObject()
let result = s:IdrisCommand(":ml!", cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
call search(word, "b")
endif
endfunction
function! IdrisRefine()
let view = winsaveview()
w
let cline = line(".")
let word = expand("<cword>")
let name = input ("Name: ")
let result = s:IdrisCommand(":ref!", cline, word, name)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
endif
endfunction
function! IdrisAddMissing()
let view = winsaveview()
w
let cline = line(".")
let word = expand("<cword>")
let result = s:IdrisCommand(":am!", cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
endif
endfunction
function! IdrisCaseSplit()
w
let view = winsaveview()
let cline = line(".")
let ccol = col(".")
let word = expand("<cword>")
let result = s:IdrisCommand(":cs!", cline, ccol, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
endif
endfunction
function! IdrisMakeWith()
let view = winsaveview()
w
let cline = line(".")
let word = s:currentQueryObject()
let tc = IdrisReload(1)
let result = s:IdrisCommand(":mw!", cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
call search("_")
endif
endfunction
function! IdrisMakeCase()
let view = winsaveview()
w
let cline = line(".")
let word = s:currentQueryObject()
let result = s:IdrisCommand(":mc!", cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
call search("_")
endif
endfunction
function! IdrisAddClause(proof)
let view = winsaveview()
w
let cline = line(".")
let word = expand("<cword>")
if (a:proof==0)
let fn = ":ac!"
else
let fn = ":apc!"
endif
let result = s:IdrisCommand(fn, cline, word)
if (! (result is ""))
call IWrite(result)
else
e
call winrestview(view)
call search(word)
endif
endfunction
function! IdrisEval()
w
let expr = input ("Expression: ")
let result = s:IdrisCommand(expr)
call IWrite(" = " . result)
endfunction
nnoremap <buffer> <silent> <LocalLeader>t :call IdrisShowType()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>r :call IdrisReload(0)<ENTER>
nnoremap <buffer> <silent> <LocalLeader>c :call IdrisCaseSplit()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>a 0:call search(":")<ENTER>b:call IdrisAddClause(0)<ENTER>w
nnoremap <buffer> <silent> <LocalLeader>d 0:call search(":")<ENTER>b:call IdrisAddClause(0)<ENTER>w
nnoremap <buffer> <silent> <LocalLeader>b 0:call IdrisAddClause(0)<ENTER>
nnoremap <buffer> <silent> <LocalLeader>m :call IdrisAddMissing()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>md 0:call search(":")<ENTER>b:call IdrisAddClause(1)<ENTER>w
nnoremap <buffer> <silent> <LocalLeader>f :call IdrisRefine()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>o :call IdrisProofSearch(0)<ENTER>
nnoremap <buffer> <silent> <LocalLeader>s :call IdrisProofSearch(0)<ENTER>
nnoremap <buffer> <silent> <LocalLeader>g :call IdrisGenerateDef()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>p :call IdrisProofSearch(1)<ENTER>
nnoremap <buffer> <silent> <LocalLeader>l :call IdrisMakeLemma()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>e :call IdrisEval()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>w 0:call IdrisMakeWith()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>mc :call IdrisMakeCase()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>i 0:call IdrisResponseWin()<ENTER>
nnoremap <buffer> <silent> <LocalLeader>h :call IdrisShowDoc()<ENTER>
menu Idris.Reload <LocalLeader>r
menu Idris.Show\ Type <LocalLeader>t
menu Idris.Evaluate <LocalLeader>e
menu Idris.-SEP0- :
menu Idris.Add\ Clause <LocalLeader>a
menu Idris.Generate\ Definition <LocalLeader>g
menu Idris.Add\ with <LocalLeader>w
menu Idris.Case\ Split <LocalLeader>c
menu Idris.Add\ missing\ cases <LocalLeader>m
menu Idris.Proof\ Search <LocalLeader>s
menu Idris.Proof\ Search\ with\ hints <LocalLeader>p
au BufHidden idris-response call IdrisHideResponseWin()
au BufEnter idris-response call IdrisShowResponseWin()
endif

View File

@@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
" Vim filetype plugin " Vim filetype plugin
" Language: LessCSS " Language: less
" Author: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Alessandro Vioni <jenoma@gmail.com>
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de> " URL: https://github.com/genoma/vim-less
" Last Change: 2011 Sep 30 " Last Change: 2014 November 24
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -14,17 +14,11 @@ let b:did_ftplugin = 1
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
setlocal iskeyword+=- setlocal formatoptions-=t formatoptions+=croql
setlocal commentstring=//%s
setlocal define=^\\s*\\%(@mixin\\\|=\\) setlocal comments=:// commentstring=//\ %s
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
setlocal omnifunc=csscomplete#CompleteCSS setlocal omnifunc=csscomplete#CompleteCSS
setlocal suffixesadd=.less setlocal suffixesadd=.less
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
setlocal fo=croql
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
" vim:set sw=2:
endif endif

24
ftplugin/m4.vim Normal file
View File

@@ -0,0 +1,24 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'm4') == -1
" Vim filetype plugin file
" Language: m4
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:#,:dnl commentstring=dnl\ %s
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -1,127 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
if exists('b:loaded_mustache_handlebars') runtime! ftplugin/handlebars*.vim ftplugin/handlebars/*.vim
finish
endif
let b:loaded_mustache_handlebars = 1
let s:cpo_save = &cpo
set cpo&vim
" Matchit support for Mustache & Handlebars
" extending HTML matchit groups
if exists("loaded_matchit") && exists("b:match_words")
let b:match_words = b:match_words
\ . ',{:},[:],(:),'
\ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}'
\ . ':'
\ . '\%({{\)\@<=\s*else\s*}}'
\ . ':'
\ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},'
\ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}'
\ . ':'
\ . '\%({{\)\@<=/\s*\1\s*}}'
endif
" Set template for comment
setlocal commentstring={{!--\ %s\ --}}
if exists("g:mustache_abbreviations")
inoremap <buffer> {{{ {{{}}}<left><left><left>
inoremap <buffer> {{ {{}}<left><left>
inoremap <buffer> {{! {{!}}<left><left>
inoremap <buffer> {{< {{<}}<left><left>
inoremap <buffer> {{> {{>}}<left><left>
inoremap <buffer> {{# {{#}}<cr>{{/}}<up><left><left>
inoremap <buffer> {{if {{#if }}<cr>{{/if}}<up><left>
inoremap <buffer> {{ife {{#if }}<cr>{{else}}<cr>{{/if}}<up><up><left>
endif
" Section movement
" Adapted from vim-ruby - many thanks to the maintainers of that plugin
function! s:sectionmovement(pattern,flags,mode,count)
norm! m'
if a:mode ==# 'v'
norm! gv
endif
let i = 0
while i < a:count
let i = i + 1
" saving current position
let line = line('.')
let col = col('.')
let pos = search(a:pattern,'W'.a:flags)
" if there's no more matches, return to last position
if pos == 0
call cursor(line,col)
return
endif
endwhile
endfunction
nnoremap <silent> <buffer> [[ :<C-U>call <SID>sectionmovement('{{','b','n',v:count1)<CR>
nnoremap <silent> <buffer> ]] :<C-U>call <SID>sectionmovement('{{','' ,'n',v:count1)<CR>
xnoremap <silent> <buffer> [[ :<C-U>call <SID>sectionmovement('{{','b','v',v:count1)<CR>
xnoremap <silent> <buffer> ]] :<C-U>call <SID>sectionmovement('{{','' ,'v',v:count1)<CR>
" Operator pending mappings
" Operators are available by default. Set `let g:mustache_operators = 0` in
" your .vimrc to disable them.
if ! exists("g:mustache_operators")
let g:mustache_operators = 1
endif
if exists("g:mustache_operators") && g:mustache_operators
onoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR>
onoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR>
xnoremap <silent> <buffer> ie :<C-U>call <SID>wrap_inside()<CR>
xnoremap <silent> <buffer> ae :<C-U>call <SID>wrap_around()<CR>
endif
function! s:wrap_around()
" If the cursor is at the end of the tag element, move back
" so that the end tag can be detected.
while getline('.')[col('.')-1] ==# '}'
execute 'norm h'
endwhile
" Moves to the end of the closing tag
let pos = search('}}','We')
if pos != 0
if getline('.')[col('.')] ==# '}'
" Ending tag contains 3 closing brackets '}}}',
" move to the last bracket.
execute 'norm l'
endif
" select the whole tag
execute 'norm v%'
endif
endfunction
function! s:wrap_inside()
" If the cursor is at the end of the tag element, move back
" so that the end tag can be detected.
while getline('.')[col('.')-1] ==# '}'
execute 'norm h'
endwhile
" Moves to the end of the closing tag
let pos = search('}}','W')
if pos != 0
" select only inside the tag
execute 'norm v%loho'
endif
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nofoldenable
endif endif

24
ftplugin/prolog.vim Normal file
View File

@@ -0,0 +1,24 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'prolog') == -1
" Vim filetype plugin file
" Language: Prolog
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=s1:/*,mb:*,ex:*/,:% commentstring=%\ %s
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

552
ftplugin/sql.vim Normal file
View File

@@ -0,0 +1,552 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sql') == -1
" SQL filetype plugin file
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
" Version: 12.0
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Last Change: 2017 Mar 07
" Download: http://vim.sourceforge.net/script.php?script_id=454
" For more details please use:
" :h sql.txt
"
" This file should only contain values that are common to all SQL languages
" Oracle, Microsoft SQL Server, Sybase ASA/ASE, MySQL, and so on
" If additional features are required create:
" vimfiles/after/ftplugin/sql.vim (Windows)
" .vim/after/ftplugin/sql.vim (Unix)
" to override and add any of your own settings.
" This file also creates a command, SQLSetType, which allows you to change
" SQL dialects on the fly. For example, if I open an Oracle SQL file, it
" is color highlighted appropriately. If I open an Informix SQL file, it
" will still be highlighted according to Oracles settings. By running:
" :SQLSetType sqlinformix
"
" All files called sqlinformix.vim will be loaded from the indent and syntax
" directories. This allows you to easily flip SQL dialects on a per file
" basis. NOTE: you can also use completion:
" :SQLSetType <tab>
"
" To change the default dialect, add the following to your vimrc:
" let g:sql_type_default = 'sqlanywhere'
"
" This file also creates a command, SQLGetType, which allows you to
" determine what the current dialect is in use.
" :SQLGetType
"
" History
"
" Version 12.0 (April 2013)
"
" NF: Added support for "BEGIN TRY ... END TRY ... BEGIN CATCH ... END CATCH
" BF: This plugin is designed to be used with other plugins to enable the
" SQL completion with Perl, Python, Java, ... The loading mechanism
" was not checking if the SQL objects were created, which can lead to
" the plugin not loading the SQL support.
"
" Version 11.0 (May 2013)
"
" NF: Updated to use SyntaxComplete's new regex support for syntax groups.
"
" Version 10.0 (Dec 2012)
"
" NF: Changed all maps to use noremap instead of must map
" NF: Changed all visual maps to use xnoremap instead of vnoremap as they
" should only be used in visual mode and not select mode.
" BF: Most of the maps were using doubled up backslashes before they were
" changed to using the search() function, which meant they no longer
" worked.
"
" Version 9.0
"
" NF: Completes 'b:undo_ftplugin'
" BF: Correctly set cpoptions when creating script
"
" Version 8.0
"
" NF: Improved the matchit plugin regex (Talek)
"
" Version 7.0
"
" NF: Calls the sqlcomplete#ResetCacheSyntax() function when calling
" SQLSetType.
"
" Version 6.0
"
" NF: Adds the command SQLGetType
"
" Version 5.0
"
" NF: Adds the ability to choose the keys to control SQL completion, just add
" the following to your .vimrc:
" let g:ftplugin_sql_omni_key = '<C-C>'
" let g:ftplugin_sql_omni_key_right = '<Right>'
" let g:ftplugin_sql_omni_key_left = '<Left>'
"
" BF: format-options - Auto-wrap comments using textwidth was turned off
" by mistake.
" Only do this when not done yet for this buffer
" This ftplugin can be used with other ftplugins. So ensure loading
" happens if all elements of this plugin have not yet loaded.
if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql'
finish
endif
let s:save_cpo = &cpo
set cpo&vim
" Disable autowrapping for code, but enable for comments
" t Auto-wrap text using textwidth
" c Auto-wrap comments using textwidth, inserting the current comment
" leader automatically.
setlocal formatoptions-=t
setlocal formatoptions+=c
" Functions/Commands to allow the user to change SQL syntax dialects
" through the use of :SQLSetType <tab> for completion.
" This works with both Vim 6 and 7.
if !exists("*SQL_SetType")
" NOTE: You cannot use function! since this file can be
" sourced from within this function. That will result in
" an error reported by Vim.
function SQL_GetList(ArgLead, CmdLine, CursorPos)
if !exists('s:sql_list')
" Grab a list of files that contain "sql" in their names
let list_indent = globpath(&runtimepath, 'indent/*sql*')
let list_syntax = globpath(&runtimepath, 'syntax/*sql*')
let list_ftplugin = globpath(&runtimepath, 'ftplugin/*sql*')
let sqls = "\n".list_indent."\n".list_syntax."\n".list_ftplugin."\n"
" Strip out everything (path info) but the filename
" Regex
" From between two newline characters
" Non-greedily grab all characters
" Followed by a valid filename \w\+\.\w\+ (sql.vim)
" Followed by a newline, but do not include the newline
"
" Replace it with just the filename (get rid of PATH)
"
" Recursively, since there are many filenames that contain
" the word SQL in the indent, syntax and ftplugin directory
let sqls = substitute( sqls,
\ '[\n]\%(.\{-}\)\(\w\+\.\w\+\)\n\@=',
\ '\1\n',
\ 'g'
\ )
" Remove duplicates, since sqlanywhere.vim can exist in the
" sytax, indent and ftplugin directory, yet we only want
" to display the option once
let index = match(sqls, '.\{-}\ze\n')
while index > -1
" Get the first filename
let file = matchstr(sqls, '.\{-}\ze\n', index)
" Recursively replace any *other* occurrence of that
" filename with nothing (ie remove it)
let sqls = substitute(sqls, '\%>'.(index+strlen(file)).'c\<'.file.'\>\n', '', 'g')
" Move on to the next filename
let index = match(sqls, '.\{-}\ze\n', (index+strlen(file)+1))
endwhile
" Sort the list if using version 7
if v:version >= 700
let mylist = split(sqls, "\n")
let mylist = sort(mylist)
let sqls = join(mylist, "\n")
endif
let s:sql_list = sqls
endif
return s:sql_list
endfunction
function SQL_SetType(name)
" User has decided to override default SQL scripts and
" specify a vendor specific version
" (ie Oracle, Informix, SQL Anywhere, ...)
" So check for an remove any settings that prevent the
" scripts from being executed, and then source the
" appropriate Vim scripts.
if exists("b:did_ftplugin")
unlet b:did_ftplugin
endif
if exists("b:current_syntax")
" echomsg 'SQLSetType - clearing syntax'
syntax clear
if exists("b:current_syntax")
unlet b:current_syntax
endif
endif
if exists("b:did_indent")
" echomsg 'SQLSetType - clearing indent'
unlet b:did_indent
" Set these values to their defaults
setlocal indentkeys&
setlocal indentexpr&
endif
" Ensure the name is in the correct format
let new_sql_type = substitute(a:name,
\ '\s*\([^\.]\+\)\(\.\w\+\)\?', '\L\1', '')
" Do not specify a buffer local variable if it is
" the default value
if new_sql_type == 'sql'
let new_sql_type = 'sqloracle'
endif
let b:sql_type_override = new_sql_type
" Remove any cached SQL since a new sytax will have different
" items and groups
if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100
call sqlcomplete#ResetCacheSyntax()
endif
" Vim will automatically source the correct files if we
" change the filetype. You cannot do this with setfiletype
" since that command will only execute if a filetype has
" not already been set. In this case we want to override
" the existing filetype.
let &filetype = 'sql'
if b:sql_compl_savefunc != ""
" We are changing the filetype to SQL from some other filetype
" which had OMNI completion defined. We need to activate the
" SQL completion plugin in order to cache some of the syntax items
" while the syntax rules for SQL are active.
call sqlcomplete#PreCacheSyntax()
endif
endfunction
command! -nargs=* -complete=custom,SQL_GetList SQLSetType :call SQL_SetType(<q-args>)
endif
" Functions/Commands to allow the user determine current SQL syntax dialect
" This works with both Vim 6 and 7.
if !exists("*SQL_GetType")
function SQL_GetType()
if exists('b:sql_type_override')
echomsg "Current SQL dialect in use:".b:sql_type_override
else
echomsg "Current SQL dialect in use:".g:sql_type_default
endif
endfunction
command! -nargs=0 SQLGetType :call SQL_GetType()
endif
if exists("b:sql_type_override")
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
exec 'runtime ftplugin/'.b:sql_type_override.'.vim'
" else
" echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
endif
elseif exists("g:sql_type_default")
" echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim'
if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != ''
exec 'runtime ftplugin/'.g:sql_type_default.'.vim'
" else
" echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
endif
endif
" If the above runtime command succeeded, do not load the default settings
" as they should have already been loaded from a previous run.
if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql'
finish
endif
let b:undo_ftplugin = "setl comments< formatoptions< define< omnifunc<" .
\ " | unlet! b:browsefilter b:match_words"
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:current_ftplugin = 'sql'
" Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" .
\ "All Files (*.*)\t*.*\n"
endif
" Some standard expressions for use with the matchit strings
let s:notend = '\%(\<end\s\+\)\@<!'
let s:when_no_matched_or_others = '\%(\<when\>\%(\s\+\%(\%(\<not\>\s\+\)\?<matched\>\)\|\<others\>\)\@!\)'
let s:or_replace = '\%(or\s\+replace\s\+\)\?'
" Define patterns for the matchit macro
if !exists("b:match_words")
" SQL is generally case insensitive
let b:match_ignorecase = 1
" Handle the following:
" if
" elseif | elsif
" else [if]
" end if
"
" [while condition] loop
" leave
" break
" continue
" exit
" end loop
"
" for
" leave
" break
" continue
" exit
" end loop
"
" do
" statements
" doend
"
" case
" when
" when
" default
" end case
"
" merge
" when not matched
" when matched
"
" EXCEPTION
" WHEN column_not_found THEN
" WHEN OTHERS THEN
"
" begin try
" end try
" begin catch
" end catch
"
" create[ or replace] procedure|function|event
" \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'.
" For ColdFusion support
setlocal matchpairs+=<:>
let b:match_words = &matchpairs .
\ ',\%(\<begin\)\%(\s\+\%(try\|catch\)\>\)\@!:\<end\>\W*$,'.
\
\ '\<begin\s\+try\>:'.
\ '\<end\s\+try\>:'.
\ '\<begin\s\+catch\>:'.
\ '\<end\s\+catch\>,'.
\
\ s:notend . '\<if\>:'.
\ '\<elsif\>\|\<elseif\>\|\<else\>:'.
\ '\<end\s\+if\>,'.
\
\ '\(^\s*\)\@<=\(\<\%(do\|for\|while\|loop\)\>.*\):'.
\ '\%(\<exit\>\|\<leave\>\|\<break\>\|\<continue\>\):'.
\ '\%(\<doend\>\|\%(\<end\s\+\%(for\|while\|loop\>\)\)\),'.
\
\ '\%('. s:notend . '\<case\>\):'.
\ '\%('.s:when_no_matched_or_others.'\):'.
\ '\%(\<when\s\+others\>\|\<end\s\+case\>\),' .
\
\ '\<merge\>:' .
\ '\<when\s\+not\s\+matched\>:' .
\ '\<when\s\+matched\>,' .
\
\ '\%(\<create\s\+' . s:or_replace . '\)\?'.
\ '\%(function\|procedure\|event\):'.
\ '\<returns\?\>'
" \ '\<begin\>\|\<returns\?\>:'.
" \ '\<end\>\(;\)\?\s*$'
" \ '\<exception\>:'.s:when_no_matched_or_others.
" \ ':\<when\s\+others\>,'.
"
" \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'.
" \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'.
" \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' .
endif
" Define how to find the macro definition of a variable using the various
" [d, [D, [_CTRL_D and so on features
" Match these values ignoring case
" ie DECLARE varname INTEGER
let &l:define = '\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>'
" Mappings to move to the next BEGIN ... END block
" \W - no characters or digits
nnoremap <buffer> <silent> ]] :call search('\c^\s*begin\>', 'W' )<CR>
nnoremap <buffer> <silent> [[ :call search('\c^\s*begin\>', 'bW' )<CR>
nnoremap <buffer> <silent> ][ :call search('\c^\s*end\W*$', 'W' )<CR>
nnoremap <buffer> <silent> [] :call search('\c^\s*end\W*$', 'bW' )<CR>
xnoremap <buffer> <silent> ]] :<C-U>exec "normal! gv"<Bar>call search('\c^\s*begin\>', 'W' )<CR>
xnoremap <buffer> <silent> [[ :<C-U>exec "normal! gv"<Bar>call search('\c^\s*begin\>', 'bW' )<CR>
xnoremap <buffer> <silent> ][ :<C-U>exec "normal! gv"<Bar>call search('\c^\s*end\W*$', 'W' )<CR>
xnoremap <buffer> <silent> [] :<C-U>exec "normal! gv"<Bar>call search('\c^\s*end\W*$', 'bW' )<CR>
" By default only look for CREATE statements, but allow
" the user to override
if !exists('g:ftplugin_sql_statements')
let g:ftplugin_sql_statements = 'create'
endif
" Predefined SQL objects what are used by the below mappings using
" the ]} style maps.
" This global variable allows the users to override its value
" from within their vimrc.
" Note, you cannot use \?, since these patterns can be used to search
" backwards, you must use \{,1}
if !exists('g:ftplugin_sql_objects')
let g:ftplugin_sql_objects = 'function,procedure,event,' .
\ '\(existing\\|global\s\+temporary\s\+\)\{,1}' .
\ 'table,trigger' .
\ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable'
endif
" Key to trigger SQL completion
if !exists('g:ftplugin_sql_omni_key')
let g:ftplugin_sql_omni_key = '<C-C>'
endif
" Key to trigger drill into column list
if !exists('g:ftplugin_sql_omni_key_right')
let g:ftplugin_sql_omni_key_right = '<Right>'
endif
" Key to trigger drill out of column list
if !exists('g:ftplugin_sql_omni_key_left')
let g:ftplugin_sql_omni_key_left = '<Left>'
endif
" Replace all ,'s with bars, except ones with numbers after them.
" This will most likely be a \{,1} string.
let s:ftplugin_sql_objects =
\ '\c^\s*' .
\ '\(\(' .
\ substitute(g:ftplugin_sql_statements, ',\d\@!', '\\\\|', 'g') .
\ '\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}' .
\ '\<\(' .
\ substitute(g:ftplugin_sql_objects, ',\d\@!', '\\\\|', 'g') .
\ '\)\>'
" Mappings to move to the next CREATE ... block
exec "nnoremap <buffer> <silent> ]} :call search('".s:ftplugin_sql_objects."', 'W')<CR>"
exec "nnoremap <buffer> <silent> [{ :call search('".s:ftplugin_sql_objects."', 'bW')<CR>"
" Could not figure out how to use a :call search() string in visual mode
" without it ending visual mode
" Unfortunately, this will add a entry to the search history
exec 'xnoremap <buffer> <silent> ]} /'.s:ftplugin_sql_objects.'<CR>'
exec 'xnoremap <buffer> <silent> [{ ?'.s:ftplugin_sql_objects.'<CR>'
" Mappings to move to the next COMMENT
"
" Had to double the \ for the \| separator since this has a special
" meaning on maps
let b:comment_leader = '\(--\\|\/\/\\|\*\\|\/\*\\|\*\/\)'
" Find the start of the next comment
let b:comment_start = '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ '\(\s*'.b:comment_leader.'\)'
" Find the end of the previous comment
let b:comment_end = '\(^\s*'.b:comment_leader.'.*\n\)'.
\ '\(^\s*'.b:comment_leader.'\)\@!'
" Skip over the comment
let b:comment_jump_over = "call search('".
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ "', 'W')"
let b:comment_skip_back = "call search('".
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ "', 'bW')"
" Move to the start and end of comments
exec 'nnoremap <silent><buffer> ]" :call search('."'".b:comment_start."'".', "W" )<CR>'
exec 'nnoremap <silent><buffer> [" :call search('."'".b:comment_end."'".', "W" )<CR>'
exec 'xnoremap <silent><buffer> ]" :<C-U>exec "normal! gv"<Bar>call search('."'".b:comment_start."'".', "W" )<CR>'
exec 'xnoremap <silent><buffer> [" :<C-U>exec "normal! gv"<Bar>call search('."'".b:comment_end."'".', "W" )<CR>'
" Comments can be of the form:
" /*
" *
" */
" or
" --
" or
" //
setlocal comments=s1:/*,mb:*,ex:*/,:--,://
" Set completion with CTRL-X CTRL-O to autoloaded function.
if exists('&omnifunc')
" Since the SQL completion plugin can be used in conjunction
" with other completion filetypes it must record the previous
" OMNI function prior to setting up the SQL OMNI function
let b:sql_compl_savefunc = &omnifunc
" Source it to determine its version
runtime autoload/sqlcomplete.vim
" This is used by the sqlcomplete.vim plugin
" Source it for its global functions
runtime autoload/syntaxcomplete.vim
setlocal omnifunc=sqlcomplete#Complete
" Prevent the intellisense plugin from loading
let b:sql_vis = 1
if !exists('g:omni_sql_no_default_maps')
let regex_extra = ''
if exists('g:loaded_syntax_completion') && exists('g:loaded_sql_completion')
if g:loaded_syntax_completion > 120 && g:loaded_sql_completion > 140
let regex_extra = '\\w*'
endif
endif
" Static maps which use populate the completion list
" using Vim's syntax highlighting rules
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'a <C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'k <C-\><C-O>:call sqlcomplete#Map("sqlKeyword'.regex_extra.'")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'f <C-\><C-O>:call sqlcomplete#Map("sqlFunction'.regex_extra.'")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'o <C-\><C-O>:call sqlcomplete#Map("sqlOption'.regex_extra.'")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'T <C-\><C-O>:call sqlcomplete#Map("sqlType'.regex_extra.'")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'s <C-\><C-O>:call sqlcomplete#Map("sqlStatement'.regex_extra.'")<CR><C-X><C-O>'
" Dynamic maps which use populate the completion list
" using the dbext.vim plugin
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'t <C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'p <C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'v <C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'c <C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'l <C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
" The next 3 maps are only to be used while the completion window is
" active due to the <CR> at the beginning of the map
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'L <C-Y><C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
" <C-Right> is not recognized on most Unix systems, so only create
" these additional maps on the Windows platform.
" If you would like to use these maps, choose a different key and make
" the same map in your vimrc.
" if has('win32')
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key_right.' <C-R>=sqlcomplete#DrillIntoTable()<CR>'
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key_left.' <C-R>=sqlcomplete#DrillOutOfColumns()<CR>'
" endif
" Remove any cached items useful for schema changes
exec 'inoremap <buffer> '.g:ftplugin_sql_omni_key.'R <C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>'
endif
if b:sql_compl_savefunc != ""
" We are changing the filetype to SQL from some other filetype
" which had OMNI completion defined. We need to activate the
" SQL completion plugin in order to cache some of the syntax items
" while the syntax rules for SQL are active.
call sqlcomplete#ResetCacheSyntax()
call sqlcomplete#PreCacheSyntax()
endif
endif
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:sw=4:
endif

49
ftplugin/vb.vim Normal file
View File

@@ -0,0 +1,49 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'visual-basic') == -1
" Vim filetype plugin file
" Language: VisualBasic (ft=vb)
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
" we need this wrapper, as call doesn't allow a count
fun! <SID>VbSearch(pattern, flags)
let cnt = v:count1
while cnt > 0
call search(a:pattern, a:flags)
let cnt = cnt - 1
endwhile
endfun
let s:cpo_save = &cpo
set cpo&vim
" NOTE the double escaping \\|
nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr>
nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr>
nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
" matchit support
if exists("loaded_matchit")
let b:match_ignorecase=1
let b:match_words=
\ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
\ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
\ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
\ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
\ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
\ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
\ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
\ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
\ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
endif
let &cpo = s:cpo_save
unlet s:cpo_save
endif

29
ftplugin/yaml.vim Normal file
View File

@@ -0,0 +1,29 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
" Vim filetype plugin file
" Language: YAML (YAML Ain't Markup Language)
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive)
" Last Change: 2020 Mar 02
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< et< fo<"
setlocal comments=:# commentstring=#\ %s expandtab
setlocal formatoptions-=t formatoptions+=croql
if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0
let b:undo_ftplugin .= " sw< sts<"
setlocal shiftwidth=2 softtabstop=2
endif
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -1,24 +1,51 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if (exists("b:did_ftplugin")) if exists("b:did_ftplugin")
finish finish
endif endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let s:cpo_orig = &cpo
set cpo&vim
" Recomended code style, no tabs and 4-space indentation
setlocal expandtab setlocal expandtab
setlocal tabstop=4 setlocal tabstop=8
setlocal softtabstop=4
setlocal shiftwidth=4 setlocal shiftwidth=4
setlocal suffixesadd=.zig setlocal formatoptions-=t formatoptions+=croql
setlocal suffixesadd=.zir
setlocal commentstring=//\ %s setlocal suffixesadd=.zig,.zir
setlocal makeprg=zig\ build setlocal makeprg=zig\ build
if (has("comments")) if has('comments')
set comments=:///,://,:\\\\ setlocal comments=:///,://!,://,:\\\\
set formatoptions=tcqor setlocal commentstring=//\ %s
endif endif
if has('find_in_path')
let &l:includeexpr='substitute(v:fname, "^([^.])$", "\1.zig", "")'
let &l:include='\v(\@import>|\@cInclude>|^\s*\#\s*include)'
endif
let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
if exists("*json_decode") && executable('zig')
silent let s:env = system('zig env')
if v:shell_error == 0
let &l:path=json_decode(s:env)['std_dir'] . ',' . &l:path
endif
unlet! s:env
endif
let b:undo_ftplugin =
\ 'setl et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
let &cpo = s:cpo_orig
unlet s:cpo_orig
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
endif endif

196
heuristics.yaml Normal file
View File

@@ -0,0 +1,196 @@
---
extensions: [inp]
rules:
- lines: 1
pattern: '^\*'
filetype: abaqus
- lines: 500
pattern: '^header surface data'
ignore_case: true
filetype: trasys
---
extensions: [asa]
rules:
- override: true
- filetype: aspvbs
---
extensions: [asp]
rules:
- override: true
- lines: 3
pattern: 'perlscript'
ignore_case: true
filetype: aspperl
- filetype: aspvbs
---
extensions: [h]
rules:
- lines: 200
pattern: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
rules:
- if_exists: "g:c_syntax_for_h"
filetype: objc
- filetype: objcpp
- if_exists: "g:c_syntax_for_h"
filetype: c
- if_exists: "g:ch_syntax_for_h"
filetype: ch
- filetype: cpp
---
extensions: [m]
rules:
- lines: 100
rules:
- pattern: '^\s*/\*'
set: 'saw_comment'
- pattern: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
filetype: objc
- pattern: '^\s*%'
filetype: octave
- pattern: '^\s*\(\*'
filetype: mma
- pattern: '^\s*((type|var)\b|--)'
ignore_case: true
filetype: murphi
- if_set: "saw_comment"
filetype: objc
- override: true
- filetype: octave
---
extensions: [fs]
rules:
- lines: 50
rules:
- pattern: '^(: |new-device)'
filetype: forth
- pattern: '^\s*(#light|import|let|module|namespace|open|type)'
filetype: fsharp
- pattern: '\s*(#version|precision|uniform|varying|vec[234])'
filetype: glsl
- override: true
- filetype: forth
---
extensions: [re]
rules:
- lines: 50
rules:
- pattern: '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+[<"]|template\s*<)'
filetype: cpp
- filetype: reason
---
extensions: [idr]
rules:
- lines: 5
rules:
- pattern: '^\s*--.*[Ii]dris ?1'
filetype: idris
- pattern: '^\s*--.*[Ii]dris ?2'
filetype: idris2
- lines: 30
rules:
- pattern: '^pkgs =.*'
filetype: idris
- pattern: '^depends =.*'
filetype: idris2
- pattern: '^%language (TypeProviders|ElabReflection)'
filetype: idris
- pattern: '^%language PostfixProjections'
filetype: idris2
- pattern: '^%access .*'
filetype: idris
- override: true
- filetype: idris2
---
extensions: [lidr]
rules:
- lines: 200
pattern: '^>\s*--.*[Ii]dris ?1'
filetype: lidris
- filetype: lidris2
---
extensions: [bas]
rules:
- lines: 5
pattern: 'VB_Name|Begin VB\.(Form|MDIForm|UserControl)'
filetype: vb
ignore_case: true
- filetype: basic
---
extensions: [pm]
rules:
- lines: 1
rules:
- pattern: 'XPM2'
filetype: xpm2
- pattern: 'XPM'
filetype: xpm
- lines: 50
rules:
- pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
filetype: raku
- pattern: '\buse\s+(?:strict\b|v?5\.)'
filetype: perl
- override: true
- filetype: perl
shebang: true
fallback: true
---
extensions: [pl]
rules:
- lines: 1
or:
- pattern: '^[^#]*:-'
- pattern: '^\s*(?:%|/\*)'
- pattern: '\.\s*$'
filetype: prolog
- lines: 50
rules:
- pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
filetype: raku
- pattern: '\buse\s+(?:strict\b|v?5\.)'
filetype: perl
- override: true
- filetype: perl
shebang: true
fallback: true
---
extensions: [t]
rules:
- lines: 5
pattern: '^\.'
filetype: nroff
- lines: 50
rules:
- pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
filetype: raku
- pattern: '\buse\s+(?:strict\b|v?5\.)'
filetype: perl
## I haven't found turing syntax for vim...
# - pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
# filetype: turing
- override: true
- filetype: perl
shebang: true
fallback: true
---
extensions: [tt2]
rules:
- lines: 3
pattern: '<(?:!DOCTYPE HTML|[%?]|html)'
ignore_case: true
filetype: tt2html
- filetype: tt2
---
extensions: [html]
rules:
- lines: 1
pattern: '^(%|<[%&].*>)'
filetype: mason
- lines: 50
rules:
- pattern: '{%-?\s*(end.*|extends|block|macro|set|if|for|include|trans)\b|{#\s+'
filetype: htmldjango
- pattern: '\bDTD\s+XHTML\s'
filetype: xhtml
- filetype: html
fallback: true

16
indent/aap.vim Normal file
View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aap') == -1
" Vim indent file
" Language: Aap recipe
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jun 24
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Works mostly like Python.
runtime! indent/python.vim
endif

312
indent/ada.vim Normal file
View File

@@ -0,0 +1,312 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
"------------------------------------------------------------------------------
" Description: Vim Ada indent file
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" Neil Bird <neil@fnxweb.com>
" Ned Okie <nokie@radford.edu>
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 16.07.2006 MK Ada-Mode as vim-ball
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested to save on spaces
" 19.09.2007 NO g: missing before ada#Comment
" Help Page: ft-vim-indent
"------------------------------------------------------------------------------
" ToDo:
" Verify handling of multi-line exprs. and recovery upon the final ';'.
" Correctly find comments given '"' and "" ==> " syntax.
" Combine the two large block-indent functions into one?
"------------------------------------------------------------------------------
" Only load this indent file when no other was loaded.
if exists("b:did_indent") || version < 700
finish
endif
let b:did_indent = 45
setlocal indentexpr=GetAdaIndent()
setlocal indentkeys-=0{,0}
setlocal indentkeys+=0=~then,0=~end,0=~elsif,0=~when,0=~exception,0=~begin,0=~is,0=~record
" Only define the functions once.
if exists("*GetAdaIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
if exists("g:ada_with_gnat_project_files")
let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<\(loop\|use\)\>\|declare\>\|begin\>\|type\>.*\<is\>[^;]*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|project\>\|then\>\|when\>\|is\>\)'
else
let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<\(loop\|use\)\>\|declare\>\|begin\>\|type\>.*\<is\>[^;]*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|then\>\|when\>\|is\>\)'
endif
" Section: s:MainBlockIndent {{{1
"
" Try to find indent of the block we're in
" prev_indent = the previous line's indent
" prev_lnum = previous line (to start looking on)
" blockstart = expr. that indicates a possible start of this block
" stop_at = if non-null, if a matching line is found, gives up!
" No recursive previous block analysis: simply look for a valid line
" with a lesser or equal indent than we currently (on prev_lnum) have.
" This shouldn't work as well as it appears to with lines that are currently
" nowhere near the correct indent (e.g., start of line)!
" Seems to work OK as it 'starts' with the indent of the /previous/ line.
function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at)
let lnum = a:prev_lnum
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
while lnum > 1
if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent
return a:prev_indent
elseif line =~ '^\s*' . a:blockstart
let ind = indent(lnum)
if ind < a:prev_indent
return ind
endif
endif
let lnum = prevnonblank(lnum - 1)
" Get previous non-blank/non-comment-only line
while 1
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
if line !~ '^\s*$' && line !~ '^\s*#'
break
endif
let lnum = prevnonblank(lnum - 1)
if lnum <= 0
return a:prev_indent
endif
endwhile
endwhile
" Fallback - just move back one
return a:prev_indent - shiftwidth()
endfunction MainBlockIndent
" Section: s:EndBlockIndent {{{1
"
" Try to find indent of the block we're in (and about to complete),
" including handling of nested blocks. Works on the 'end' of a block.
" prev_indent = the previous line's indent
" prev_lnum = previous line (to start looking on)
" blockstart = expr. that indicates a possible start of this block
" blockend = expr. that indicates a possible end of this block
function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
let lnum = a:prev_lnum
let line = getline(lnum)
let ends = 0
while lnum > 1
if getline(lnum) =~ '^\s*' . a:blockstart
let ind = indent(lnum)
if ends <= 0
if ind < a:prev_indent
return ind
endif
else
let ends = ends - 1
endif
elseif getline(lnum) =~ '^\s*' . a:blockend
let ends = ends + 1
endif
let lnum = prevnonblank(lnum - 1)
" Get previous non-blank/non-comment-only line
while 1
let line = getline(lnum)
let line = substitute( line, g:ada#Comment, '', '' )
if line !~ '^\s*$'
break
endif
let lnum = prevnonblank(lnum - 1)
if lnum <= 0
return a:prev_indent
endif
endwhile
endwhile
" Fallback - just move back one
return a:prev_indent - shiftwidth()
endfunction EndBlockIndent
" Section: s:StatementIndent {{{1
"
" Return indent of previous statement-start
" (after we've indented due to multi-line statements).
" This time, we start searching on the line *before* the one given (which is
" the end of a statement - we want the previous beginning).
function s:StatementIndent( current_indent, prev_lnum )
let lnum = a:prev_lnum
while lnum > 0
let prev_lnum = lnum
let lnum = prevnonblank(lnum - 1)
" Get previous non-blank/non-comment-only line
while 1
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
if line !~ '^\s*$' && line !~ '^\s*#'
break
endif
let lnum = prevnonblank(lnum - 1)
if lnum <= 0
return a:current_indent
endif
endwhile
" Leave indent alone if our ';' line is part of a ';'-delineated
" aggregate (e.g., procedure args.) or first line after a block start.
if line =~ s:AdaBlockStart || line =~ '(\s*$'
return a:current_indent
endif
if line !~ '[.=(]\s*$'
let ind = indent(prev_lnum)
if ind < a:current_indent
return ind
endif
endif
endwhile
" Fallback - just use current one
return a:current_indent
endfunction StatementIndent
" Section: GetAdaIndent {{{1
"
" Find correct indent of a new line based upon what went before
"
function GetAdaIndent()
" Find a non-blank line above the current line.
let lnum = prevnonblank(v:lnum - 1)
let ind = indent(lnum)
let package_line = 0
" Get previous non-blank/non-comment-only/non-cpp line
while 1
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
if line !~ '^\s*$' && line !~ '^\s*#'
break
endif
let lnum = prevnonblank(lnum - 1)
if lnum <= 0
return ind
endif
endwhile
" Get default indent (from prev. line)
let ind = indent(lnum)
let initind = ind
" Now check what's on the previous line
if line =~ s:AdaBlockStart || line =~ '(\s*$'
" Check for false matches to AdaBlockStart
let false_match = 0
if line =~ '^\s*\(procedure\|function\|package\)\>.*\<is\s*new\>'
" Generic instantiation
let false_match = 1
elseif line =~ ')\s*;\s*$' || line =~ '^\([^(]*([^)]*)\)*[^(]*;\s*$'
" forward declaration
let false_match = 1
endif
" Move indent in
if ! false_match
let ind = ind + shiftwidth()
endif
elseif line =~ '^\s*\(case\|exception\)\>'
" Move indent in twice (next 'when' will move back)
let ind = ind + 2 * shiftwidth()
elseif line =~ '^\s*end\s*record\>'
" Move indent back to tallying 'type' preceeding the 'record'.
" Allow indent to be equal to 'end record's.
let ind = s:MainBlockIndent( ind+shiftwidth(), lnum, 'type\>', '' )
elseif line =~ '\(^\s*new\>.*\)\@<!)\s*[;,]\s*$'
" Revert to indent of line that started this parenthesis pair
exe lnum
exe 'normal! $F)%'
if getline('.') =~ '^\s*('
" Dire layout - use previous indent (could check for g:ada#Comment here)
let ind = indent( prevnonblank( line('.')-1 ) )
else
let ind = indent('.')
endif
exe v:lnum
elseif line =~ '[.=(]\s*$'
" A statement continuation - move in one
let ind = ind + shiftwidth()
elseif line =~ '^\s*new\>'
" Multiple line generic instantiation ('package blah is\nnew thingy')
let ind = s:StatementIndent( ind - shiftwidth(), lnum )
elseif line =~ ';\s*$'
" Statement end (but not 'end' ) - try to find current statement-start indent
let ind = s:StatementIndent( ind, lnum )
endif
" Check for potential argument list on next line
let continuation = (line =~ '[A-Za-z0-9_]\s*$')
" Check current line; search for simplistic matching start-of-block
let line = getline(v:lnum)
if line =~ '^\s*#'
" Start of line for ada-pp
let ind = 0
elseif continuation && line =~ '^\s*('
" Don't do this if we've already indented due to the previous line
if ind == initind
let ind = ind + shiftwidth()
endif
elseif line =~ '^\s*\(begin\|is\)\>'
let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
elseif line =~ '^\s*record\>'
let ind = s:MainBlockIndent( ind, lnum, 'type\>\|for\>.*\<use\>', '' ) + shiftwidth()
elseif line =~ '^\s*\(else\|elsif\)\>'
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
elseif line =~ '^\s*when\>'
" Align 'when' one /in/ from matching block start
let ind = s:MainBlockIndent( ind, lnum, '\(case\|exception\)\>', '' ) + shiftwidth()
elseif line =~ '^\s*end\>\s*\<if\>'
" End of if statements
let ind = s:EndBlockIndent( ind, lnum, 'if\>', 'end\>\s*\<if\>' )
elseif line =~ '^\s*end\>\s*\<loop\>'
" End of loops
let ind = s:EndBlockIndent( ind, lnum, '\(\(while\|for\)\>.*\)\?\<loop\>', 'end\>\s*\<loop\>' )
elseif line =~ '^\s*end\>\s*\<record\>'
" End of records
let ind = s:EndBlockIndent( ind, lnum, '\(type\>.*\)\=\<record\>', 'end\>\s*\<record\>' )
elseif line =~ '^\s*end\>\s*\<procedure\>'
" End of procedures
let ind = s:EndBlockIndent( ind, lnum, 'procedure\>.*\<is\>', 'end\>\s*\<procedure\>' )
elseif line =~ '^\s*end\>\s*\<case\>'
" End of case statement
let ind = s:EndBlockIndent( ind, lnum, 'case\>.*\<is\>', 'end\>\s*\<case\>' )
elseif line =~ '^\s*end\>'
" General case for end
let ind = s:MainBlockIndent( ind, lnum, '\(if\|while\|for\|loop\|accept\|begin\|record\|case\|exception\|package\)\>', '' )
elseif line =~ '^\s*exception\>'
let ind = s:MainBlockIndent( ind, lnum, 'begin\>', '' )
elseif line =~ '^\s*then\>'
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
endif
return ind
endfunction GetAdaIndent
let &cpo = s:keepcpo
unlet s:keepcpo
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
endif

16
indent/ant.vim Normal file
View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
" Vim indent file
" Language: ANT files
" Maintainer: David Fishburn <fishburn@ianywhere.com>
" Last Change: Thu May 15 2003 10:02:54 PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Use XML formatting rules
runtime! indent/xml.vim
endif

15
indent/automake.vim Normal file
View File

@@ -0,0 +1,15 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'automake') == -1
" Vim indent file
" Language: automake
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
if exists("b:did_indent")
finish
endif
" same as makefile indenting for now.
runtime! indent/make.vim
endif

236
indent/awk.vim Normal file
View File

@@ -0,0 +1,236 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'awk') == -1
" vim: set sw=3 sts=3:
" Awk indent script. It can handle multi-line statements and expressions.
" It works up to the point where the distinction between correct/incorrect
" and personal taste gets fuzzy. Drop me an e-mail for bug reports and
" reasonable style suggestions.
"
" Bugs:
" =====
" - Some syntax errors may cause erratic indentation.
" - Same for very unusual but syntacticly correct use of { }
" - In some cases it's confused by the use of ( and { in strings constants
" - This version likes the closing brace of a multiline pattern-action be on
" character position 1 before the following pattern-action combination is
" formatted
" Author:
" =======
" Erik Janssen, ejanssen@itmatters.nl
"
" History:
" ========
" 26-04-2002 Got initial version working reasonably well
" 29-04-2002 Fixed problems in function headers and max line width
" Added support for two-line if's without curly braces
" Fixed hang: 2011 Aug 31
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetAwkIndent()
" Mmm, copied from the tcl indent program. Is this okay?
setlocal indentkeys-=:,0#
" Only define the function once.
if exists("*GetAwkIndent")
finish
endif
" This function contains a lot of exit points. It checks for simple cases
" first to get out of the function as soon as possible, thereby reducing the
" number of possibilities later on in the difficult parts
function! GetAwkIndent()
" Find previous line and get its indentation
let prev_lineno = s:Get_prev_line( v:lnum )
if prev_lineno == 0
return 0
endif
let prev_data = getline( prev_lineno )
let ind = indent( prev_lineno )
" Increase indent if the previous line contains an opening brace. Search
" for this brace the hard way to prevent errors if the previous line is a
" 'pattern { action }' (simple check match on /{/ increases the indent then)
if s:Get_brace_balance( prev_data, '{', '}' ) > 0
return ind + shiftwidth()
endif
let brace_balance = s:Get_brace_balance( prev_data, '(', ')' )
" If prev line has positive brace_balance and starts with a word (keyword
" or function name), align the current line on the first '(' of the prev
" line
if brace_balance > 0 && s:Starts_with_word( prev_data )
return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
endif
" If this line starts with an open brace bail out now before the line
" continuation checks.
if getline( v:lnum ) =~ '^\s*{'
return ind
endif
" If prev line seems to be part of multiline statement:
" 1. Prev line is first line of a multiline statement
" -> attempt to indent on first ' ' or '(' of prev line, just like we
" indented the positive brace balance case above
" 2. Prev line is not first line of a multiline statement
" -> copy indent of prev line
let continue_mode = s:Seems_continuing( prev_data )
if continue_mode > 0
if s:Seems_continuing( getline(s:Get_prev_line( prev_lineno )) )
" Case 2
return ind
else
" Case 1
if continue_mode == 1
" Need continuation due to comma, backslash, etc
return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
else
" if/for/while without '{'
return ind + shiftwidth()
endif
endif
endif
" If the previous line doesn't need continuation on the current line we are
" on the start of a new statement. We have to make sure we align with the
" previous statement instead of just the previous line. This is a bit
" complicated because the previous statement might be multi-line.
"
" The start of a multiline statement can be found by:
"
" 1 If the previous line contains closing braces and has negative brace
" balance, search backwards until cumulative brace balance becomes zero,
" take indent of that line
" 2 If the line before the previous needs continuation search backward
" until that's not the case anymore. Take indent of one line down.
" Case 1
if prev_data =~ ')' && brace_balance < 0
while brace_balance != 0 && prev_lineno > 0
let prev_lineno = s:Get_prev_line( prev_lineno )
let prev_data = getline( prev_lineno )
let brace_balance=brace_balance+s:Get_brace_balance(prev_data,'(',')' )
endwhile
let ind = indent( prev_lineno )
else
" Case 2
if s:Seems_continuing( getline( prev_lineno - 1 ) )
let prev_lineno = prev_lineno - 2
let prev_data = getline( prev_lineno )
while prev_lineno > 0 && (s:Seems_continuing( prev_data ) > 0)
let prev_lineno = s:Get_prev_line( prev_lineno )
let prev_data = getline( prev_lineno )
endwhile
let ind = indent( prev_lineno + 1 )
endif
endif
" Decrease indent if this line contains a '}'.
if getline(v:lnum) =~ '^\s*}'
let ind = ind - shiftwidth()
endif
return ind
endfunction
" Find the open and close braces in this line and return how many more open-
" than close braces there are. It's also used to determine cumulative balance
" across multiple lines.
function! s:Get_brace_balance( line, b_open, b_close )
let line2 = substitute( a:line, a:b_open, "", "g" )
let openb = strlen( a:line ) - strlen( line2 )
let line3 = substitute( line2, a:b_close, "", "g" )
let closeb = strlen( line2 ) - strlen( line3 )
return openb - closeb
endfunction
" Find out whether the line starts with a word (i.e. keyword or function
" call). Might need enhancements here.
function! s:Starts_with_word( line )
if a:line =~ '^\s*[a-zA-Z_0-9]\+\s*('
return 1
endif
return 0
endfunction
" Find the length of the first word in a line. This is used to be able to
" align a line relative to the 'print ' or 'if (' on the previous line in case
" such a statement spans multiple lines.
" Precondition: only to be used on lines where 'Starts_with_word' returns 1.
function! s:First_word_len( line )
let white_end = matchend( a:line, '^\s*' )
if match( a:line, '^\s*func' ) != -1
let word_end = matchend( a:line, '[a-z]\+\s\+[a-zA-Z_0-9]\+[ (]*' )
else
let word_end = matchend( a:line, '[a-zA-Z_0-9]\+[ (]*' )
endif
return word_end - white_end
endfunction
" Determine if 'line' completes a statement or is continued on the next line.
" This one is far from complete and accepts illegal code. Not important for
" indenting, however.
function! s:Seems_continuing( line )
" Unfinished lines
if a:line =~ '\(--\|++\)\s*$'
return 0
endif
if a:line =~ '[\\,\|\&\+\-\*\%\^]\s*$'
return 1
endif
" if/for/while (cond) eol
if a:line =~ '^\s*\(if\|while\|for\)\s*(.*)\s*$' || a:line =~ '^\s*else\s*'
return 2
endif
return 0
endfunction
" Get previous relevant line. Search back until a line is that is no
" comment or blank and return the line number
function! s:Get_prev_line( lineno )
let lnum = a:lineno - 1
let data = getline( lnum )
while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
let lnum = lnum - 1
let data = getline( lnum )
endwhile
return lnum
endfunction
" This function checks whether an indented line exceeds a maximum linewidth
" (hardcoded 80). If so and it is possible to stay within 80 positions (or
" limit num of characters beyond linewidth) by decreasing the indent (keeping
" it > base_indent), do so.
function! s:Safe_indent( base, wordlen, this_line )
let line_base = matchend( a:this_line, '^\s*' )
let line_len = strlen( a:this_line ) - line_base
let indent = a:base
if (indent + a:wordlen + line_len) > 80
" Simple implementation good enough for the time being
let indent = indent + 3
endif
return indent + a:wordlen
endfunction
endif

98
indent/bzl.vim Normal file
View File

@@ -0,0 +1,98 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'bzl') == -1
" Vim indent file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2017 Jun 13
if exists('b:did_indent')
finish
endif
" Load base python indent.
if !exists('*GetPythonIndent')
runtime! indent/python.vim
endif
let b:did_indent = 1
" Only enable bzl google indent if python google indent is enabled.
if !get(g:, 'no_google_python_indent')
setlocal indentexpr=GetBzlIndent(v:lnum)
endif
if exists('*GetBzlIndent')
finish
endif
let s:save_cpo = &cpo
set cpo-=C
" Maximum number of lines to look backwards.
let s:maxoff = 50
""
" Determine the correct indent level given an {lnum} in the current buffer.
function GetBzlIndent(lnum) abort
let l:use_recursive_indent = !get(g:, 'no_google_python_recursive_indent')
if l:use_recursive_indent
" Backup and override indent setting variables.
if exists('g:pyindent_nested_paren')
let l:pyindent_nested_paren = g:pyindent_nested_paren
endif
if exists('g:pyindent_open_paren')
let l:pyindent_open_paren = g:pyindent_open_paren
endif
let g:pyindent_nested_paren = 'shiftwidth() * 2'
let g:pyindent_open_paren = 'shiftwidth() * 2'
endif
let l:indent = -1
" Indent inside parens.
" Align with the open paren unless it is at the end of the line.
" E.g.
" open_paren_not_at_EOL(100,
" (200,
" 300),
" 400)
" open_paren_at_EOL(
" 100, 200, 300, 400)
call cursor(a:lnum, 1)
let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
\ " =~ '\\(Comment\\|String\\)$'")
if l:par_line > 0
call cursor(l:par_line, 1)
if l:par_col != col('$') - 1
let l:indent = l:par_col
endif
endif
" Delegate the rest to the original function.
if l:indent == -1
let l:indent = GetPythonIndent(a:lnum)
endif
if l:use_recursive_indent
" Restore global variables.
if exists('l:pyindent_nested_paren')
let g:pyindent_nested_paren = l:pyindent_nested_paren
else
unlet g:pyindent_nested_paren
endif
if exists('l:pyindent_open_paren')
let g:pyindent_open_paren = l:pyindent_open_paren
else
unlet g:pyindent_open_paren
endif
endif
return l:indent
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
endif

View File

@@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net> " Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com> " Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com> " Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
" Last Update: 2017-Feb-28 " Last Update: 2020-Jun-11
" License: Vim license " License: Vim license
" URL: https://github.com/vim-erlang/vim-erlang-runtime " URL: https://github.com/vim-erlang/vim-erlang-runtime

View File

@@ -23,18 +23,19 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Language: GraphQL " Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org> " Maintainer: Jon Parise <jon@indelible.org>
if exists('b:did_indent') " Set our local options if indentation hasn't already been set up.
finish " This generally means we've been detected as the primary filetype.
if !exists('b:did_indent')
setlocal autoindent
setlocal nocindent
setlocal nolisp
setlocal nosmartindent
setlocal indentexpr=GetGraphQLIndent()
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
let b:did_indent = 1
endif endif
let b:did_indent = 1
setlocal autoindent
setlocal nocindent
setlocal nolisp
setlocal nosmartindent
setlocal indentexpr=GetGraphQLIndent()
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
" If our indentation function already exists, we have nothing more to do. " If our indentation function already exists, we have nothing more to do.
if exists('*GetGraphQLIndent') if exists('*GetGraphQLIndent')
@@ -44,9 +45,13 @@ endif
let s:cpo_save = &cpoptions let s:cpo_save = &cpoptions
set cpoptions&vim set cpoptions&vim
" searchpair() skip expression that matches in comments and strings.
let s:pair_skip_expr =
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "comment\\|string"'
" Check if the character at lnum:col is inside a string. " Check if the character at lnum:col is inside a string.
function s:InString(lnum, col) function s:InString(lnum, col)
return synIDattr(synID(a:lnum, a:col, 1), 'name') is# 'graphqlString' return synIDattr(synID(a:lnum, a:col, 1), 'name') ==# 'graphqlString'
endfunction endfunction
function GetGraphQLIndent() function GetGraphQLIndent()
@@ -60,18 +65,18 @@ function GetGraphQLIndent()
let l:line = getline(v:lnum) let l:line = getline(v:lnum)
" If this line contains just a closing bracket, find its matching opening " If this line contains just a closing bracket, find its matching opening
" bracket and indent the closing backet to match. " bracket and indent the closing bracket to match.
let l:col = matchend(l:line, '^\s*[]})]') let l:col = matchend(l:line, '^\s*[]})]')
if l:col > 0 && !s:InString(v:lnum, l:col) if l:col > 0 && !s:InString(v:lnum, l:col)
let l:bracket = l:line[l:col - 1]
call cursor(v:lnum, l:col) call cursor(v:lnum, l:col)
if l:bracket is# '}' let l:bracket = l:line[l:col - 1]
let l:matched = searchpair('{', '', '}', 'bW') if l:bracket ==# '}'
elseif l:bracket is# ']' let l:matched = searchpair('{', '', '}', 'bW', s:pair_skip_expr)
let l:matched = searchpair('\[', '', '\]', 'bW') elseif l:bracket ==# ']'
elseif l:bracket is# ')' let l:matched = searchpair('\[', '', '\]', 'bW', s:pair_skip_expr)
let l:matched = searchpair('(', '', ')', 'bW') elseif l:bracket ==# ')'
let l:matched = searchpair('(', '', ')', 'bW', s:pair_skip_expr)
else else
let l:matched = -1 let l:matched = -1
endif endif
@@ -84,9 +89,8 @@ function GetGraphQLIndent()
return indent(v:lnum) return indent(v:lnum)
endif endif
" If the previous line contained an opening bracket, and we are still in it, " If the previous line ended with an opening bracket, indent this line.
" add indent depending on the bracket type. if getline(l:prevlnum) =~# '\%(#.*\)\@<![[{(]\s*$'
if getline(l:prevlnum) =~# '[[{(]\s*$'
return indent(l:prevlnum) + shiftwidth() return indent(l:prevlnum) + shiftwidth()
endif endif

129
indent/handlebars.vim Normal file
View File

@@ -0,0 +1,129 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
" Mustache & Handlebars syntax
" Language: Mustache, Handlebars
" Maintainer: Juvenn Woo <machese@gmail.com>
" Screenshot: http://imgur.com/6F408
" Version: 3
" Last Change: 26 Nov 2018
" Remarks: based on eruby indent plugin by tpope
" References:
" [Mustache](http://github.com/defunkt/mustache)
" [Handlebars](https://github.com/wycats/handlebars.js)
" [ctemplate](http://code.google.com/p/google-ctemplate/)
" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html)
" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html)
if exists("b:did_indent_hbs")
finish
endif
unlet! b:did_indent
setlocal indentexpr=
runtime! indent/html.vim
unlet! b:did_indent
" Force HTML indent to not keep state.
let b:html_indent_usestate = 0
if &l:indentexpr == ''
if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)'
else
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
endif
endif
let b:handlebars_subtype_indentexpr = &l:indentexpr
let b:did_indent = 1
let b:did_indent_hbs = 1
setlocal indentexpr=GetHandlebarsIndent()
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
" Only define the function once.
if exists("*GetHandlebarsIndent")
finish
endif
function! GetHandlebarsIndent(...)
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
if a:0 && a:1 == '.'
let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d'
let v:lnum = a:1
endif
let vcol = col('.')
call cursor(v:lnum,1)
call cursor(v:lnum,vcol)
exe "let ind = ".b:handlebars_subtype_indentexpr
" Workaround for Andy Wokula's HTML indent. This should be removed after
" some time, since the newest version is fixed in a different way.
if b:handlebars_subtype_indentexpr =~# '^HtmlIndent('
\ && exists('b:indent')
\ && type(b:indent) == type({})
\ && has_key(b:indent, 'lnum')
" Force HTML indent to not keep state
let b:indent.lnum = -1
endif
let lnum = prevnonblank(v:lnum-1)
let prevLine = getline(lnum)
let currentLine = getline(v:lnum)
" all indent rules only apply if the block opening/closing
" tag is on a separate line
" indent after block {{#block
if prevLine =~# '\v\s*\{\{[#^].*\s*'
let ind = ind + sw
endif
" but not if the block ends on the same line
if prevLine =~# '\v\s*\{\{\#(.+)(\s+|\}\}).*\{\{\/\1'
let ind = ind - sw
endif
" unindent after block close {{/block}}
if currentLine =~# '\v^\s*\{\{\/\S*\}\}\s*'
let ind = ind - sw
endif
" indent after component block {{a-component
if prevLine =~# '\v\s*\{\{\w'
let ind = ind + sw
endif
" but not if the component block ends on the same line
if prevLine =~# '\v\s*\{\{\w(.+)\}\}'
let ind = ind - sw
endif
" unindent }} lines, and following lines if not inside a block expression
let savedPos = getpos('.')
if currentLine =~# '\v^\s*\}\}\s*$' || (currentLine !~# '\v^\s*\{\{\/' && prevLine =~# '\v^\s*[^\{\} \t]+\}\}\s*$')
let closingLnum = search('}}\s*$', 'Wbc', lnum)
let [openingLnum, col] = searchpairpos('{{', '', '}}', 'Wb')
if openingLnum > 0 && closingLnum > 0
if strpart(getline(openingLnum), col - 1, 3) !~ '{{[#^]'
let ind = ind - sw
endif
else
call setpos('.', savedPos)
endif
endif
" unindent {{else}}
if currentLine =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind - sw
endif
" indent again after {{else}}
if prevLine =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind + sw
endif
return ind
endfunction
endif

16
indent/htmldjango.vim Normal file
View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'htmldjango') == -1
" Vim indent file
" Language: Django HTML template
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
" Last Change: 2007 Jan 25
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Use HTML formatting rules.
runtime! indent/html.vim
endif

148
indent/idris2.vim Normal file
View File

@@ -0,0 +1,148 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
" indentation for idris (idris-lang.org)
"
" Based on haskell indentation by motemen <motemen@gmail.com>
"
" author: raichoo (raichoo@googlemail.com)
"
" Modify g:idris_indent_if and g:idris_indent_case to
" change indentation for `if'(default 3) and `case'(default 5).
" Example (in .vimrc):
" > let g:idris_indent_if = 2
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
if !exists('g:idris_indent_if')
" if bool
" >>>then ...
" >>>else ...
let g:idris_indent_if = 3
endif
if !exists('g:idris_indent_case')
" case xs of
" >>>>>[] => ...
" >>>>>(y::ys) => ...
let g:idris_indent_case = 5
endif
if !exists('g:idris_indent_let')
" let x : Nat = O in
" >>>>x
let g:idris_indent_let = 4
endif
if !exists('g:idris_indent_rewrite')
" rewrite prf in expr
" >>>>>>>>x
let g:idris_indent_rewrite = 8
endif
if !exists('g:idris_indent_where')
" where f : Nat -> Nat
" >>>>>>f x = x
let g:idris_indent_where = 6
endif
if !exists('g:idris_indent_do')
" do x <- a
" >>>y <- b
let g:idris_indent_do = 3
endif
setlocal indentexpr=GetIdrisIndent()
setlocal indentkeys=!^F,o,O,}
function! GetIdrisIndent()
let prevline = getline(v:lnum - 1)
if prevline =~ '\s\+(\s*.\+\s\+:\s\+.\+\s*)\s\+->\s*$'
return match(prevline, '(')
elseif prevline =~ '\s\+{\s*.\+\s\+:\s\+.\+\s*}\s\+->\s*$'
return match(prevline, '{')
endif
if prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
let s = match(prevline, '[:=]')
if s > 0
return s + 2
else
return match(prevline, '\S')
endif
endif
if prevline =~ '[{([][^})\]]\+$'
return match(prevline, '[{([]')
endif
if prevline =~ '\<let\>\s\+.\+\<in\>\s*$'
return match(prevline, '\<let\>') + g:idris_indent_let
endif
if prevline =~ '\<rewrite\>\s\+.\+\<in\>\s*$'
return match(prevline, '\<rewrite\>') + g:idris_indent_rewrite
endif
if prevline !~ '\<else\>'
let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')
if s > 0
return s
endif
let s = match(prevline, '\<if\>')
if s > 0
return s + g:idris_indent_if
endif
endif
if prevline =~ '\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
return match(prevline, '\S') + &shiftwidth
endif
if prevline =~ '\<where\>\s\+\S\+.*$'
return match(prevline, '\<where\>') + g:idris_indent_where
endif
if prevline =~ '\<do\>\s\+\S\+.*$'
return match(prevline, '\<do\>') + g:idris_indent_do
endif
if prevline =~ '^\s*\<\(co\)\?data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
return match(prevline, '=')
endif
if prevline =~ '\<with\>\s\+([^)]*)\s*$'
return match(prevline, '\S') + &shiftwidth
endif
if prevline =~ '\<case\>\s\+.\+\<of\>\s*$'
return match(prevline, '\<case\>') + g:idris_indent_case
endif
if prevline =~ '^\s*\(\<namespace\>\|\<\(co\)\?data\>\)\s\+\S\+\s*$'
return match(prevline, '\(\<namespace\>\|\<\(co\)\?data\>\)') + &shiftwidth
endif
if prevline =~ '^\s*\(\<using\>\|\<parameters\>\)\s*([^(]*)\s*$'
return match(prevline, '\(\<using\>\|\<parameters\>\)') + &shiftwidth
endif
if prevline =~ '^\s*\<mutual\>\s*$'
return match(prevline, '\<mutual\>') + &shiftwidth
endif
let line = getline(v:lnum)
if (line =~ '^\s*}\s*' && prevline !~ '^\s*;')
return match(prevline, '\S') - &shiftwidth
endif
return match(prevline, '\S')
endfunction
endif

View File

@@ -1,84 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
" Vim indent file
" Language: Jinja HTML template
" Maintainer: Evan Hammer <evan@evanhammer.com>
" Last Change: 2013 Jan 26
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Use HTML formatting rules.
setl indentkeys=o,O,<Return>,<>>,!^F
runtime! indent/html.vim +setl nosmartindent
let b:did_indent = 1
" Indent within the jinja tags
" Made by Steve Losh <steve@stevelosh.com>
if &l:indentexpr == ''
if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)'
else
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
endif
endif
let b:html_indentexpr = &l:indentexpr
let b:did_indent = 1
setlocal indentexpr=GetDjangoIndent()
setlocal indentkeys=o,O,*<Return>,{,},o,O,!^F,<>>
" Only define the function once.
if exists("*GetDjangoIndent")
finish
endif
function! GetDjangoIndent(...)
if a:0 && a:1 == '.'
let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d'
let v:lnum = a:1
endif
let vcol = col('.')
call cursor(v:lnum,vcol)
exe "let ind = ".b:html_indentexpr
let lnum = prevnonblank(v:lnum-1)
let pnb = getline(lnum)
let cur = getline(v:lnum)
let tagstart = '.*' . '{%\s*'
let tagend = '.*%}' . '.*'
let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)'
let midtags = '\(empty\|else\|elif\)'
let pnb_blockstart = pnb =~# tagstart . blocktags . tagend
let pnb_blockend = pnb =~# tagstart . 'end' . blocktags . tagend
let pnb_blockmid = pnb =~# tagstart . midtags . tagend
let cur_blockstart = cur =~# tagstart . blocktags . tagend
let cur_blockend = cur =~# tagstart . 'end' . blocktags . tagend
let cur_blockmid = cur =~# tagstart . midtags . tagend
if pnb_blockstart && !pnb_blockend
let ind = ind + &sw
elseif pnb_blockmid && !pnb_blockend
let ind = ind + &sw
endif
if cur_blockend && !cur_blockstart
let ind = ind - &sw
elseif cur_blockmid
let ind = ind - &sw
endif
return ind
endfunction
endif

View File

@@ -1,13 +1,17 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
" Vim indent file " Vim indent file
" Language: LessCSS " Language: less
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de> " Maintainer: Alessandro Vioni <jenoma@gmail.com>
" Last Change: 2011 Sep 26 " URL: https://github.com/genoma/vim-less
" Last Change: 2014 November 24
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
runtime! indent/css.vim runtime! indent/css.vim
" vim:set sw=2:
endif endif

Some files were not shown because too many files have changed in this diff Show More