mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Run a build and commit the results
This commit is contained in:
16
README.md
16
README.md
@@ -58,7 +58,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [bicep](https://github.com/carlsmedstad/vim-bicep) (Syntax highlighting for bicep files)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting for blade and blade.php files)
|
||||
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cxx and 18 more files)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cppm and 20 more files)
|
||||
- [caddyfile](https://github.com/isobit/vim-caddyfile)
|
||||
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx)
|
||||
@@ -80,7 +80,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [elm](https://github.com/andys8/vim-elm-syntax) (Elm syntax highlighting for elm files)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (EmberScript syntax highlighting for em and emberscript files)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (Syntax highlighting for emblem and em files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app.src, es, escript, hrl, xrl, yrl, app and yaws files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app, app.src, es, escript, hrl, xrl, yrl and yaws files)
|
||||
- [fennel](https://github.com/bakpakin/fennel.vim) (Syntax highlighting for fnl files)
|
||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (Syntax highlighting for ferm files)
|
||||
- [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files)
|
||||
@@ -89,7 +89,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
|
||||
- [gitignore](https://github.com/SirJson/fzf-gitignore)
|
||||
- [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 18 more files)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 19 more files)
|
||||
- [gmpl](https://github.com/maelvalais/gmpl.vim) (Syntax highlighting for mod files)
|
||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (Gnuplot syntax highlighting for gp, gnu, gnuplot, p, plot, plt and gpi files)
|
||||
- [go](https://github.com/fatih/vim-go) (Go syntax highlighting for go and tmpl files)
|
||||
@@ -120,7 +120,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files)
|
||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (Syntax highlighting for jsx files)
|
||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (Julia syntax highlighting for jl files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just) (Syntax highlighting for just files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just/tree/main) (Syntax highlighting for just files)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (Kotlin syntax highlighting for kt, ktm and kts files)
|
||||
- [ledger](https://github.com/ledger/vim-ledger) (Syntax highlighting for ldg, ledger and journal files)
|
||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond/tree/main) (LilyPond syntax highlighting for ly and ily files)
|
||||
@@ -147,12 +147,12 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files)
|
||||
- [openscad](https://github.com/sirtaj/vim-openscad) (Syntax highlighting for scad files)
|
||||
- [org](https://github.com/axvr/org.vim) (Syntax highlighting for org files)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more files)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 13 more files)
|
||||
- [pest](https://github.com/pest-parser/pest.vim) (Syntax highlighting for pest files)
|
||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
|
||||
- [pony](https://github.com/jakwings/vim-pony) (Pony syntax highlighting for pony files)
|
||||
- [pony](https://github.com/wsdjeg/vim-pony) (Pony syntax highlighting for pony files)
|
||||
- [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (Protocol Buffer syntax highlighting for proto files)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting for jade and pug files)
|
||||
@@ -160,7 +160,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting for purs files)
|
||||
- [python-compiler](https://github.com/aliev/vim-compiler-python)
|
||||
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 14 more files)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 13 more files)
|
||||
- [qmake](https://github.com/artoj/qmake-syntax-vim) (QMake syntax highlighting for pro and pri files)
|
||||
- [qml](https://github.com/peterhoeg/vim-qml) (QML syntax highlighting for qml and qbs files)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting for r, rsx, s, S and rd files)
|
||||
@@ -206,7 +206,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files)
|
||||
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 97 more files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 99 more files)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
|
||||
- [yard](https://github.com/noprompt/vim-yardoc)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/compiler/tex.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: TeX
|
||||
" Maintainer: Artem Chuprina <ran@ran.pp.ru>
|
||||
" Last Change: 2012 Apr 30
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" If makefile exists and we are not asked to ignore it, we use standard make
|
||||
" (do not redefine makeprg)
|
||||
if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
|
||||
\(!filereadable('Makefile') && !filereadable('makefile'))
|
||||
" If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
|
||||
" otherwise the same for global variable with same name, else it will be
|
||||
" LaTeX
|
||||
if exists("b:tex_flavor")
|
||||
let current_compiler = b:tex_flavor
|
||||
elseif exists("g:tex_flavor")
|
||||
let current_compiler = g:tex_flavor
|
||||
else
|
||||
let current_compiler = "latex"
|
||||
endif
|
||||
let &l:makeprg=current_compiler.' -interaction=nonstopmode'
|
||||
else
|
||||
let current_compiler = 'make'
|
||||
endif
|
||||
|
||||
" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
|
||||
" addition from Srinath Avadhanula <srinath@fastmail.fm>
|
||||
CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
|
||||
\%E!\ %m,
|
||||
\%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
|
||||
\%+W%.%#\ at\ lines\ %l--%*\\d,
|
||||
\%WLaTeX\ %.%#Warning:\ %m,
|
||||
\%Cl.%l\ %m,
|
||||
\%+C\ \ %m.,
|
||||
\%+C%.%#-%.%#,
|
||||
\%+C%.%#[]%.%#,
|
||||
\%+C[]%.%#,
|
||||
\%+C%.%#%[{}\\]%.%#,
|
||||
\%+C<%.%#>%.%#,
|
||||
\%C\ \ %m,
|
||||
\%-GSee\ the\ LaTeX%m,
|
||||
\%-GType\ \ H\ <return>%m,
|
||||
\%-G\ ...%.%#,
|
||||
\%-G%.%#\ (C)\ %.%#,
|
||||
\%-G(see\ the\ transcript%.%#),
|
||||
\%-G\\s%#,
|
||||
\%+O(%*[^()])%r,
|
||||
\%+O%*[^()](%*[^()])%r,
|
||||
\%+P(%f%r,
|
||||
\%+P\ %\\=(%f%r,
|
||||
\%+P%*[^()](%f%r,
|
||||
\%+P[%\\d%[^()]%#(%f%r,
|
||||
\%+Q)%r,
|
||||
\%+Q%*[^()])%r,
|
||||
\%+Q[%\\d%*[^()])%r
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
@@ -1,11 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'after/ftplugin/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2021 May 19
|
||||
|
||||
setlocal iskeyword+=-
|
||||
@@ -1,50 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/ftplugin/tex.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" LaTeX filetype plugin
|
||||
" Language: LaTeX (ft=tex)
|
||||
" Maintainer: Benji Fisher, Ph.D. <benji@member.AMS.org>
|
||||
" Version: 1.4
|
||||
" Last Change: Wed 19 Apr 2006
|
||||
" URL: http://www.vim.org/script.php?script_id=411
|
||||
|
||||
" Only do this when not done yet for this buffer.
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Start with plain TeX. This will also define b:did_ftplugin .
|
||||
source $VIMRUNTIME/ftplugin/plaintex.vim
|
||||
|
||||
" Avoid problems if running in 'compatible' mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin .= "| setl inex<"
|
||||
|
||||
" Allow "[d" to be used to find a macro definition:
|
||||
" Recognize plain TeX \def as well as LaTeX \newcommand and \renewcommand .
|
||||
" I may as well add the AMS-LaTeX DeclareMathOperator as well.
|
||||
let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'
|
||||
\ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\='
|
||||
\ . '\|DeclareMathOperator\s*{\=\s*'
|
||||
|
||||
" Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :
|
||||
let &l:include .= '\|\\include{'
|
||||
" On some file systems, "{" and "}" are included in 'isfname'. In case the
|
||||
" TeX file has \include{fname} (LaTeX only), strip everything except "fname".
|
||||
let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"
|
||||
|
||||
" The following lines enable the macros/matchit.vim plugin for
|
||||
" extended matching with the % key.
|
||||
" ftplugin/plaintex.vim already defines b:match_skip and b:match_ignorecase
|
||||
" and matches \(, \), \[, \], \{, and \} .
|
||||
if exists("loaded_matchit")
|
||||
let b:match_words .= ',\\begin\s*\({\a\+\*\=}\):\\end\s*\1'
|
||||
endif " exists("loaded_matchit")
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:sts=2:sw=2:
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/php.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -1,427 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/indent/tex.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim indent file
|
||||
" Language: LaTeX
|
||||
" Maintainer: Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" Created: Sat, 16 Feb 2002 16:50:19 +0100
|
||||
" Version: 1.0.0
|
||||
" Please email me if you found something I can do. Comments, bug report and
|
||||
" feature request are welcome.
|
||||
|
||||
" Last Update: {{{
|
||||
" 25th Sep 2002, by LH :
|
||||
" (*) better support for the option
|
||||
" (*) use some regex instead of several '||'.
|
||||
" Oct 9th, 2003, by JT:
|
||||
" (*) don't change indentation of lines starting with '%'
|
||||
" 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il>
|
||||
" (*) New variables:
|
||||
" g:tex_items, g:tex_itemize_env, g:tex_noindent_env
|
||||
" 2011/3/6, by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Don't change indentation of lines starting with '%'
|
||||
" I don't see any code with '%' and it doesn't work properly
|
||||
" so I add some code.
|
||||
" (*) New features: Add smartindent-like indent for "{}" and "[]".
|
||||
" (*) New variables: g:tex_indent_brace
|
||||
" 2011/9/25, by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: smartindent-like indent for "[]"
|
||||
" (*) New features: Align with "&".
|
||||
" (*) New variable: g:tex_indent_and.
|
||||
" 2011/10/23 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: improve the smartindent-like indent for "{}" and
|
||||
" "[]".
|
||||
" 2012/02/27 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: support default folding marker.
|
||||
" (*) Indent with "&" is not very handy. Make it not enable by
|
||||
" default.
|
||||
" 2012/03/06 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify "&" behavior and make it default again. Now "&"
|
||||
" won't align when there are more then one "&" in the previous
|
||||
" line.
|
||||
" (*) Add indent "\left(" and "\right)"
|
||||
" (*) Trust user when in "verbatim" and "lstlisting"
|
||||
" 2012/03/11 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify "&" so that only indent when current line start with
|
||||
" "&".
|
||||
" 2012/03/12 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify indentkeys.
|
||||
" 2012/03/18 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Add &cpo
|
||||
" 2013/05/02 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk
|
||||
" for reporting this.
|
||||
" 2014/06/23 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Remove the feature g:tex_indent_and because it is buggy.
|
||||
" (*) If there is not any obvious indentation hints, we do not
|
||||
" alert our user's current indentation.
|
||||
" (*) g:tex_indent_brace now only works if the open brace is the
|
||||
" last character of that line.
|
||||
" 2014/08/03 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Indent current line if last line has larger indentation
|
||||
" 2016/11/08 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix problems for \[ and \]. Thanks Bruno for reporting.
|
||||
" 2017/04/30 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix a bug between g:tex_noindent_env and g:tex_indent_items
|
||||
" Now g:tex_noindent_env='document\|verbatim\|itemize' (Emacs
|
||||
" style) is supported. Thanks Miles Wheeler for reporting.
|
||||
" 2018/02/07 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Make indentation more smart in the normal mode
|
||||
" 2020/04/26 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix a bug related to \[ & \]. Thanks Manuel Boni for
|
||||
" reporting.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Document: {{{
|
||||
"
|
||||
" For proper latex experience, please put
|
||||
" let g:tex_flavor = "latex"
|
||||
" into your vimrc.
|
||||
"
|
||||
" * g:tex_indent_brace
|
||||
"
|
||||
" If this variable is unset or non-zero, it will use smartindent-like style
|
||||
" for "{}" and "[]". Now this only works if the open brace is the last
|
||||
" character of that line.
|
||||
"
|
||||
" % Example 1
|
||||
" \usetikzlibrary{
|
||||
" external
|
||||
" }
|
||||
"
|
||||
" % Example 2
|
||||
" \tikzexternalize[
|
||||
" prefix=tikz]
|
||||
"
|
||||
" * g:tex_indent_items
|
||||
"
|
||||
" If this variable is set, item-environments are indented like Emacs does
|
||||
" it, i.e., continuation lines are indented with a shiftwidth.
|
||||
"
|
||||
" set unset
|
||||
" ------------------------------------------------------
|
||||
" \begin{itemize} \begin{itemize}
|
||||
" \item blablabla \item blablabla
|
||||
" bla bla bla bla bla bla
|
||||
" \item blablabla \item blablabla
|
||||
" bla bla bla bla bla bla
|
||||
" \end{itemize} \end{itemize}
|
||||
"
|
||||
"
|
||||
" * g:tex_items
|
||||
"
|
||||
" A list of tokens to be considered as commands for the beginning of an item
|
||||
" command. The tokens should be separated with '\|'. The initial '\' should
|
||||
" be escaped. The default is '\\bibitem\|\\item'.
|
||||
"
|
||||
" * g:tex_itemize_env
|
||||
"
|
||||
" A list of environment names, separated with '\|', where the items (item
|
||||
" commands matching g:tex_items) may appear. The default is
|
||||
" 'itemize\|description\|enumerate\|thebibliography'.
|
||||
"
|
||||
" * g:tex_noindent_env
|
||||
"
|
||||
" A list of environment names. separated with '\|', where no indentation is
|
||||
" required. The default is 'document\|verbatim'.
|
||||
" }}}
|
||||
|
||||
" Only define the function once
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Define global variable {{{
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
if !exists("g:tex_indent_items")
|
||||
let g:tex_indent_items = 1
|
||||
endif
|
||||
if !exists("g:tex_indent_brace")
|
||||
let g:tex_indent_brace = 1
|
||||
endif
|
||||
if !exists("g:tex_max_scan_line")
|
||||
let g:tex_max_scan_line = 60
|
||||
endif
|
||||
if g:tex_indent_items
|
||||
if !exists("g:tex_itemize_env")
|
||||
let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
|
||||
endif
|
||||
if !exists('g:tex_items')
|
||||
let g:tex_items = '\\bibitem\|\\item'
|
||||
endif
|
||||
else
|
||||
let g:tex_items = ''
|
||||
endif
|
||||
|
||||
if !exists("g:tex_noindent_env")
|
||||
let g:tex_noindent_env = 'document\|verbatim\|lstlisting'
|
||||
endif "}}}
|
||||
|
||||
" VIM Setting " {{{
|
||||
setlocal autoindent
|
||||
setlocal nosmartindent
|
||||
setlocal indentexpr=GetTeXIndent()
|
||||
setlocal indentkeys&
|
||||
exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g')
|
||||
let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '')
|
||||
" }}}
|
||||
|
||||
function! GetTeXIndent() " {{{
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
let cnum = v:lnum
|
||||
|
||||
" Comment line is not what we need.
|
||||
while lnum != 0 && getline(lnum) =~ '^\s*%'
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let line = substitute(getline(lnum), '\s*%.*', '','g') " last line
|
||||
let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line
|
||||
|
||||
let ccol = 1
|
||||
while cline[ccol] =~ '\s'
|
||||
let ccol += 1
|
||||
endwhile
|
||||
|
||||
" We are in verbatim, so do what our user what.
|
||||
if synIDattr(synID(v:lnum, ccol, 1), "name") == "texZone"
|
||||
if empty(cline)
|
||||
return indent(lnum)
|
||||
else
|
||||
return indent(v:lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(lnum)
|
||||
let stay = 1
|
||||
|
||||
" New code for comment: retain the indent of current line
|
||||
if cline =~ '^\s*%'
|
||||
return indent(v:lnum)
|
||||
endif
|
||||
|
||||
" Add a 'shiftwidth' after beginning of environments.
|
||||
" Don't add it for \begin{document} and \begin{verbatim}
|
||||
" if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
|
||||
" LH modification : \begin does not always start a line
|
||||
" ZYC modification : \end after \begin won't cause wrong indent anymore
|
||||
if line =~ '\\begin{.*}'
|
||||
if line !~ g:tex_noindent_env
|
||||
let ind = ind + shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
if g:tex_indent_items
|
||||
" Add another sw for item-environments
|
||||
if line =~ g:tex_itemize_env
|
||||
let ind = ind + shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if cline =~ '\\end{.*}'
|
||||
let retn = s:GetEndIndentation(v:lnum)
|
||||
if retn != -1
|
||||
return retn
|
||||
endif
|
||||
end
|
||||
" Subtract a 'shiftwidth' when an environment ends
|
||||
if cline =~ '\\end{.*}'
|
||||
\ && cline !~ g:tex_noindent_env
|
||||
\ && cline !~ '\\begin{.*}.*\\end{.*}'
|
||||
if g:tex_indent_items
|
||||
" Remove another sw for item-environments
|
||||
if cline =~ g:tex_itemize_env
|
||||
let ind = ind - shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
let ind = ind - shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
if g:tex_indent_brace
|
||||
if line =~ '[[{]$'
|
||||
let ind += shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, ccol)
|
||||
let ind -= shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
if line !~ '^\s*\\\?[\]}]'
|
||||
for i in range(1, strlen(line)-1)
|
||||
let char = line[i]
|
||||
if char == ']' || char == '}'
|
||||
if s:CheckPairedIsLastCharacter(lnum, i)
|
||||
let ind -= shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
" Special treatment for 'item'
|
||||
" ----------------------------
|
||||
|
||||
if g:tex_indent_items
|
||||
" '\item' or '\bibitem' itself:
|
||||
if cline =~ g:tex_items
|
||||
let ind = ind - shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
" lines following to '\item' are indented once again:
|
||||
if line =~ g:tex_items
|
||||
let ind = ind + shiftwidth()
|
||||
let stay = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
if stay && mode() == 'i'
|
||||
" If there is no obvious indentation hint, and indentation is triggered
|
||||
" in insert mode, we trust our user.
|
||||
if empty(cline)
|
||||
return ind
|
||||
else
|
||||
return max([indent(v:lnum), s:GetLastBeginIndentation(v:lnum)])
|
||||
endif
|
||||
else
|
||||
return ind
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
function! s:GetLastBeginIndentation(lnum) " {{{
|
||||
let matchend = 1
|
||||
for lnum in range(a:lnum-1, max([a:lnum - g:tex_max_scan_line, 1]), -1)
|
||||
let line = getline(lnum)
|
||||
if line =~ '\\end{.*}'
|
||||
let matchend += 1
|
||||
endif
|
||||
if line =~ '\\begin{.*}'
|
||||
let matchend -= 1
|
||||
endif
|
||||
if matchend == 0
|
||||
if line =~ g:tex_noindent_env
|
||||
return indent(lnum)
|
||||
endif
|
||||
if line =~ g:tex_itemize_env
|
||||
return indent(lnum) + 2 * shiftwidth()
|
||||
endif
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
endfor
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:GetEndIndentation(lnum) " {{{
|
||||
if getline(a:lnum) =~ '\\begin{.*}.*\\end{.*}'
|
||||
return -1
|
||||
endif
|
||||
|
||||
let min_indent = 100
|
||||
let matchend = 1
|
||||
for lnum in range(a:lnum-1, max([a:lnum-g:tex_max_scan_line, 1]), -1)
|
||||
let line = getline(lnum)
|
||||
if line =~ '\\end{.*}'
|
||||
let matchend += 1
|
||||
endif
|
||||
if line =~ '\\begin{.*}'
|
||||
let matchend -= 1
|
||||
endif
|
||||
if matchend == 0
|
||||
return indent(lnum)
|
||||
endif
|
||||
if !empty(line)
|
||||
let min_indent = min([min_indent, indent(lnum)])
|
||||
endif
|
||||
endfor
|
||||
return min_indent - shiftwidth()
|
||||
endfunction
|
||||
|
||||
" Most of the code is from matchparen.vim
|
||||
function! s:CheckPairedIsLastCharacter(lnum, col) "{{{
|
||||
let c_lnum = a:lnum
|
||||
let c_col = a:col+1
|
||||
|
||||
let line = getline(c_lnum)
|
||||
if line[c_col-1] == '\'
|
||||
let c_col = c_col + 1
|
||||
endif
|
||||
let c = line[c_col-1]
|
||||
|
||||
let plist = split(&matchpairs, '.\zs[:,]')
|
||||
let i = index(plist, c)
|
||||
if i < 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Figure out the arguments for searchpairpos().
|
||||
if i % 2 == 0
|
||||
let s_flags = 'nW'
|
||||
let c2 = plist[i + 1]
|
||||
else
|
||||
let s_flags = 'nbW'
|
||||
let c2 = c
|
||||
let c = plist[i - 1]
|
||||
endif
|
||||
if c == '['
|
||||
let c = '\['
|
||||
let c2 = '\]'
|
||||
endif
|
||||
|
||||
" Find the match. When it was just before the cursor move it there for a
|
||||
" moment.
|
||||
let save_cursor = winsaveview()
|
||||
call cursor(c_lnum, c_col)
|
||||
|
||||
" When not in a string or comment ignore matches inside them.
|
||||
" We match "escape" for special items, such as lispEscapeSpecial.
|
||||
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||
\ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
|
||||
execute 'if' s_skip '| let s_skip = 0 | endif'
|
||||
|
||||
let stopline = max([0, c_lnum - g:tex_max_scan_line])
|
||||
|
||||
" Limit the search time to 300 msec to avoid a hang on very long lines.
|
||||
" This fails when a timeout is not supported.
|
||||
try
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 100)
|
||||
catch /E118/
|
||||
endtry
|
||||
|
||||
call winrestview(save_cursor)
|
||||
|
||||
if m_lnum > 0
|
||||
let line = getline(m_lnum)
|
||||
return strlen(line) == m_col
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction "}}}
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sw=4 textwidth=80:
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/php/g
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/reaso
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/rescr
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
1344
after/syntax/tex.vim
1344
after/syntax/tex.vim
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
641
autoload/ada.vim
641
autoload/ada.vim
@@ -1,641 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ada', 'autoload/ada.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" 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 standard 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 standard 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
|
||||
" backwards 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
|
||||
@@ -1,24 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/coc/source/requirements.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
function! coc#source#requirements#init() abort
|
||||
return {
|
||||
\ 'shortcut': 'pip',
|
||||
\ 'priority': 9,
|
||||
\ 'filetypes': ['requirements'],
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
"
|
||||
" Completion pip option and PYPI package names.
|
||||
" Note: completion PYPI package names need install pip-cache from PYPI,
|
||||
" and run `pip-cache update` first to generate cache.
|
||||
function! coc#source#requirements#complete(opt, cb) abort
|
||||
call a:cb(g:requirements#items)
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -224,11 +224,11 @@ endfu
|
||||
|
||||
fu! csv#RemoveAutoHighlight() "{{{3
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au! CursorMoved <buffer=".bufnr('').">"
|
||||
exe "au! "
|
||||
aug end
|
||||
exe "aug! CSV_HI".bufnr('')
|
||||
" Remove any existing highlighting
|
||||
HiColumn!
|
||||
call csv#HiCol('', 1)
|
||||
endfu
|
||||
|
||||
fu! csv#DoAutoCommands() "{{{3
|
||||
@@ -246,9 +246,8 @@ fu! csv#DoAutoCommands() "{{{3
|
||||
endif
|
||||
" undo autocommand:
|
||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI'.bufnr('').' CursorMoved <buffer> "'
|
||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI'.bufnr('').'"'
|
||||
let b:undo_ftplugin .= '| call csv#RemoveAutoHighlight()'
|
||||
let b:undo_ftplugin = 'exe "sil! HiColumn!" |' . b:undo_ftplugin
|
||||
|
||||
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
||||
augroup CSV_Menu
|
||||
au!
|
||||
@@ -443,10 +442,14 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
if exists("s:matchid")
|
||||
" ignore errors, that come from already deleted matches
|
||||
sil! call matchdelete(s:matchid)
|
||||
if a:bang
|
||||
unlet! s:matchid
|
||||
return
|
||||
endif
|
||||
endif
|
||||
" Additionally, filter all matches, that could have been used earlier
|
||||
let matchlist=getmatches()
|
||||
call filter(matchlist, 'v:val["group"] !~ s:hiGroup')
|
||||
call filter(matchlist, 'v:val["group"] !~? s:hiGroup')
|
||||
call setmatches(matchlist)
|
||||
if a:bang
|
||||
return
|
||||
@@ -455,6 +458,10 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
elseif !a:bang
|
||||
exe ":2match " . s:hiGroup . ' /' . pat . '/'
|
||||
endif
|
||||
" Remove Highlighting once switching away from the buffer
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au BufWinLeave <buffer=".bufnr('')."> call csv#RemoveAutoHighlight()"
|
||||
aug end
|
||||
endfu
|
||||
fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" This depends on the locale. Hopefully it works
|
||||
@@ -482,12 +489,16 @@ fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" :silent :s does not work with lazyredraw
|
||||
let _lz = &lz
|
||||
set nolz
|
||||
" substitute without output when cmdheight=0
|
||||
let _cmdheight = &cmdheight
|
||||
set cmdheight=1
|
||||
for i in values(Delim)
|
||||
redir => temp[i]
|
||||
" use very non-magic
|
||||
exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
|
||||
redir END
|
||||
endfor
|
||||
let &cmdheight = _cmdheight
|
||||
let &lz = _lz
|
||||
let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")')
|
||||
let Delim = filter(temp, 'v:val=~''\d''')
|
||||
@@ -779,7 +790,11 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" does not work with fixed width columns
|
||||
" row for the row for which to calculate the width
|
||||
let b:col_width=[]
|
||||
let vts_save=""
|
||||
if has( 'vartabs' ) && b:delimiter == "\t"
|
||||
if &l:vts
|
||||
let vts_save=&vts
|
||||
endif
|
||||
setlocal vts=
|
||||
endif
|
||||
try
|
||||
@@ -800,6 +815,9 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" delete buffer content in variable b:csv_list,
|
||||
" this was only necessary for calculating the max width
|
||||
unlet! b:csv_list s:columnize_count s:decimal_column
|
||||
if vts_save
|
||||
let &l:vts=vts_save
|
||||
endif
|
||||
endfu
|
||||
fu! csv#Columnize(field) "{{{3
|
||||
" Internal function, not called from external,
|
||||
|
||||
@@ -153,5 +153,5 @@ function! fish#Complete(findstart, base)
|
||||
endfunction
|
||||
|
||||
function! fish#errorformat()
|
||||
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
||||
return '%E%f (line %l):%m,%C%p^%.%#,%-C%.%#'
|
||||
endfunction
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'freebasic', 'autoload/freebasic.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
" Dialects can be one of fb, qb, fblite, or deprecated
|
||||
" Precedence is forcelang > #lang > lang
|
||||
function! freebasic#GetDialect() abort
|
||||
if exists("g:freebasic_forcelang")
|
||||
return g:freebasic_forcelang
|
||||
endif
|
||||
|
||||
if exists("g:freebasic_lang")
|
||||
let dialect = g:freebasic_lang
|
||||
else
|
||||
let dialect = "fb"
|
||||
endif
|
||||
|
||||
" override with #lang directive or metacommand
|
||||
|
||||
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
|
||||
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
||||
|
||||
let save_cursor = getcurpos()
|
||||
call cursor(1, 1)
|
||||
let lnum = search(pat, 'n', '', '', skip)
|
||||
call setpos('.', save_cursor)
|
||||
|
||||
if lnum
|
||||
let word = matchlist(getline(lnum), pat)[1]
|
||||
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
||||
let dialect = word
|
||||
else
|
||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
return dialect
|
||||
endfunction
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
@@ -238,7 +238,7 @@ function! fsharp#loadConfig()
|
||||
endif
|
||||
|
||||
if !exists('g:fsharp#fsautocomplete_command')
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete', '--background-service-enabled']
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete']
|
||||
endif
|
||||
if !exists('g:fsharp#use_recommended_server_config')
|
||||
let g:fsharp#use_recommended_server_config = 1
|
||||
@@ -584,7 +584,7 @@ function! fsharp#openFsi(returnFocus)
|
||||
if a:returnFocus | call s:win_gotoid_safe(current_win) | endif
|
||||
return s:fsi_buffer
|
||||
else
|
||||
echom "[FSAC] Your (neo)vim does not support terminal".
|
||||
echom "[FSAC] Your (neo)vim does not support terminal."
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'autoload/graphql.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
30
autoload/jq.vim
Normal file
30
autoload/jq.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'autoload/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
""
|
||||
" Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
|
||||
function! jq#shebang() abort
|
||||
let s:line1 = getline(1)
|
||||
|
||||
if s:line1 =~# "^#!"
|
||||
if s:line1 =~# '^#!\s*\S*\<env\s'
|
||||
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
|
||||
let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
if s:line1 =~# '^#!\s*\a:[/\\]'
|
||||
let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!.*\<env\>'
|
||||
let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
|
||||
let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
|
||||
else
|
||||
let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
|
||||
endif
|
||||
if s:name =~# '^jq'
|
||||
set ft=jq
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -109,9 +109,11 @@ function! jsonnet#Format()
|
||||
call setfperm(expand('%'), l:originalFPerm)
|
||||
endif
|
||||
" the file has been changed outside of vim, enable reedit
|
||||
mkview
|
||||
silent edit!
|
||||
let &fileformat = l:originalFileFormat
|
||||
let &syntax = &syntax
|
||||
silent loadview
|
||||
elseif g:jsonnet_fmt_fail_silently == 0
|
||||
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and
|
||||
" give immediate feedback to the user at every save time.
|
||||
@@ -126,4 +128,63 @@ function! jsonnet#Format()
|
||||
call winrestview(l:curw)
|
||||
endfunction
|
||||
|
||||
function! jsonnet#GetVisualSelection()
|
||||
" Source: https://stackoverflow.com/a/6271254
|
||||
" Why is this not a built-in Vim script function?!
|
||||
let [line_start, column_start] = getpos("'<")[1:2]
|
||||
let [line_end, column_end] = getpos("'>")[1:2]
|
||||
let lines = getline(line_start, line_end)
|
||||
if len(lines) == 0
|
||||
return ''
|
||||
endif
|
||||
let lines[-1] = lines[-1][: column_end - (&selection == 'inclusive' ? 1 : 2)]
|
||||
let lines[0] = lines[0][column_start - 1:]
|
||||
return join(lines, "\n")
|
||||
endfun
|
||||
|
||||
" Format calls `jsonnetfmt ... ` on a Visual selection
|
||||
function! jsonnet#FormatVisual()
|
||||
" Get current visual selection
|
||||
let l:selection = jsonnet#GetVisualSelection()
|
||||
|
||||
" Get the command first so we can test it
|
||||
let l:binName = g:jsonnet_fmt_command
|
||||
|
||||
" Check if the user has installed command binary.
|
||||
let l:binPath = jsonnet#CheckBinPath(l:binName)
|
||||
if empty(l:binPath)
|
||||
return
|
||||
endif
|
||||
|
||||
" Populate the final command.
|
||||
let l:command = l:binPath
|
||||
let l:command = l:command . ' -e '
|
||||
let l:command = l:command . g:jsonnet_fmt_options
|
||||
|
||||
" Execute the compiled jsonnetfmt command and save the return value
|
||||
let l:out = jsonnet#System(l:command . " \"" . l:selection . "\"")
|
||||
let l:errorCode = v:shell_error
|
||||
|
||||
" Save register contents
|
||||
let reg = '"'
|
||||
let save_cb = &cb
|
||||
let regInfo = getreginfo(reg)
|
||||
try
|
||||
" Set register to formatted output
|
||||
call setreg(reg,l:out)
|
||||
" Paste formatted output
|
||||
silent exe 'norm! gv'.(reg == '"' ? '' : '"' . reg).'p`['
|
||||
finally
|
||||
" Restore register contents
|
||||
let &cb = save_cb
|
||||
call setreg(reg, regInfo)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Evaluate jsonnet into vsplit
|
||||
function! jsonnet#Eval()
|
||||
let output = system(g:jsonnet_command . ' ' . shellescape(expand('%')))
|
||||
vnew
|
||||
setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile ft=jsonnet
|
||||
put! = output
|
||||
endfunction
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'julia', 'autoload/julia_latex
|
||||
endif
|
||||
|
||||
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
||||
" The symbols are based on Julia version 1.9.0-DEV.16
|
||||
" The symbols are based on Julia version 1.11.0-DEV.14
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -17,6 +17,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\copyright': '©',
|
||||
\ '\:copyright:': '©',
|
||||
\ '\ordfeminine': 'ª',
|
||||
\ '\guillemotleft': '«',
|
||||
\ '\neg': '¬',
|
||||
\ '\circledR': '®',
|
||||
\ '\:registered:': '®',
|
||||
@@ -29,6 +30,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\cdotp': '·',
|
||||
\ '\^1': '¹',
|
||||
\ '\ordmasculine': 'º',
|
||||
\ '\guillemotright': '»',
|
||||
\ '\1/4': '¼',
|
||||
\ '\1/2': '½',
|
||||
\ '\3/4': '¾',
|
||||
@@ -659,6 +661,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\measeq': '≞',
|
||||
\ '\questeq': '≟',
|
||||
\ '\ne': '≠',
|
||||
\ '\neq': '≠',
|
||||
\ '\equiv': '≡',
|
||||
\ '\nequiv': '≢',
|
||||
\ '\Equiv': '≣',
|
||||
@@ -804,7 +807,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\nsqsubseteq': '⋢',
|
||||
\ '\nsqsupseteq': '⋣',
|
||||
\ '\sqsubsetneq': '⋤',
|
||||
\ '\sqspne': '⋥',
|
||||
\ '\sqsupsetneq': '⋥',
|
||||
\ '\lnsim': '⋦',
|
||||
\ '\gnsim': '⋧',
|
||||
\ '\precnsim': '⋨',
|
||||
@@ -1151,6 +1154,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\threedangle': '⟀',
|
||||
\ '\whiteinwhitetriangle': '⟁',
|
||||
\ '\perp': '⟂',
|
||||
\ '\veedot': '⟇',
|
||||
\ '\bsolhsub': '⟈',
|
||||
\ '\suphsol': '⟉',
|
||||
\ '\wedgedot': '⟑',
|
||||
@@ -1273,6 +1277,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\UpEquilibrium': '⥮',
|
||||
\ '\ReverseUpEquilibrium': '⥯',
|
||||
\ '\RoundImplies': '⥰',
|
||||
\ '\leftarrowless': '⥷',
|
||||
\ '\leftarrowsubset': '⥺',
|
||||
\ '\Vvert': '⦀',
|
||||
\ '\Elroang': '⦆',
|
||||
\ '\ddfnc': '⦙',
|
||||
|
||||
@@ -3,6 +3,11 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ledger', 'autoload/ledger.vim
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
" vim:ts=2:sw=2:sts=2:foldmethod=marker
|
||||
function! ledger#transaction_state_toggle(lnum, ...) abort
|
||||
if a:0 == 1
|
||||
@@ -643,7 +648,7 @@ endf
|
||||
" Build a ledger command to process the given file.
|
||||
function! s:ledger_cmd(file, args) abort
|
||||
let l:options = g:ledger_extra_options
|
||||
if len(g:ledger_date_format) > 0 && !g:ledger_is_hledger
|
||||
if len(g:ledger_date_format) > 0 && !b:is_hledger
|
||||
let l:options = join([l:options, '--date-format', g:ledger_date_format,
|
||||
\ '--input-date-format', g:ledger_date_format])
|
||||
endif
|
||||
|
||||
18
autoload/neomake/makers/ft/pony.vim
Normal file
18
autoload/neomake/makers/ft/pony.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'autoload/neomake/makers/ft/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! neomake#makers#ft#pony#EnabledMakers()
|
||||
return ['ponyc']
|
||||
endfunction
|
||||
|
||||
function! neomake#makers#ft#pony#ponyc()
|
||||
" This is currently a hack. Ponyc itself uses the project directory as
|
||||
" the target to build. Using %:p:h like this fetches the parent
|
||||
" directory of the current file which might cause supurious errors on
|
||||
" package imports if the current file is nested under a sub-directory.
|
||||
return {
|
||||
\ 'args': ['--pass=expr', '%:p:h'],
|
||||
\ 'errorformat': '%f:%l:%c: %m'
|
||||
\ }
|
||||
endfunction
|
||||
27
autoload/nix.vim
Normal file
27
autoload/nix.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'nix', 'autoload/nix.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! nix#find_drv_position()
|
||||
let line = search("description")
|
||||
if line == 0
|
||||
let line = search("name")
|
||||
endif
|
||||
if line == 0
|
||||
echo "error: could not find derivation"
|
||||
return
|
||||
endif
|
||||
|
||||
return expand("%") . ":" . line
|
||||
endfunction
|
||||
|
||||
function! nix#edit(attr)
|
||||
let output = system("nix-instantiate --eval ./. -A " . a:attr . ".meta.position")
|
||||
if match(output, "^error:") == -1
|
||||
let position = split(split(output, '"')[0], ":")
|
||||
execute "edit " . position[0]
|
||||
execute position[1]
|
||||
" Update default command to nix-build.
|
||||
let b:dispatch = 'nix-build --no-out-link -A ' . a:attr
|
||||
endif
|
||||
endfunction
|
||||
@@ -169,6 +169,14 @@ let did_load_filetypes = 1
|
||||
|
||||
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
" Filename and path matchers for natively-supported filetypes not in packages.yaml
|
||||
au BufNewFile,BufRead cfengine.conf setf cfengine
|
||||
au BufNewFile,BufRead cm3.cfg setf m3quake
|
||||
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
|
||||
au BufNewFile,BufRead cabal.project,cabal.project.* setf cabalproject
|
||||
au BufNewFile,BufRead $HOME/.cabal/config,cabal.config setf cabalconfig
|
||||
au BufNewFile,BufRead */i3/config,*/sway/config,*/.i3/config,*/.sway/config setf i3config
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'bicep')
|
||||
au BufNewFile,BufRead *.bicep setf bicep
|
||||
endif
|
||||
@@ -1771,11 +1779,11 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prolog')
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap setf prolog
|
||||
au BufNewFile,BufRead *.pdb,*.plt,*.pro,*.prolog,*.yap setf prolog
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'bzl')
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel setf bzl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
@@ -1783,7 +1791,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'dosini')
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,buildozer.spec,pylintrc setf dosini
|
||||
au BufNewFile,BufRead *.cnf,*.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc setf dosini
|
||||
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||
endif
|
||||
@@ -1794,7 +1802,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'visual-basic')
|
||||
au! BufNewFile,BufRead,BufWritePost *.bas call polyglot#detect#Bas()
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.frx,*.sba,*.vba,*.vbs setf vb
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.sba,*.vba,*.vbs setf vb
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'basic')
|
||||
@@ -1891,7 +1899,7 @@ if !has_key(g:polyglot_is_disabled, 'tptp')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'toml')
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock setf toml
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Gopkg.lock,Pipfile,pdm.lock,poetry.lock setf toml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'tmux')
|
||||
@@ -1957,7 +1965,7 @@ if !has_key(g:polyglot_is_disabled, 'slim')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'sh')
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_functions,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh
|
||||
au BufNewFile,BufRead *.zsh,*/etc/zprofile,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh
|
||||
au BufNewFile,BufRead .zsh* call s:StarSetf('zsh')
|
||||
au BufNewFile,BufRead .zlog* call s:StarSetf('zsh')
|
||||
@@ -2033,7 +2041,7 @@ if !has_key(g:polyglot_is_disabled, 'requirements')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'python')
|
||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,Snakefile,wscript setf python
|
||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,wscript setf python
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'purescript')
|
||||
@@ -2216,8 +2224,9 @@ if !has_key(g:polyglot_is_disabled, 'perl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T()
|
||||
au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm()
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl
|
||||
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,{.,}latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,latexmkrc setf perl
|
||||
au BufNewFile,BufRead *.pod setf pod
|
||||
au! BufNewFile,BufRead,BufWritePost *.html call polyglot#detect#Html()
|
||||
au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason
|
||||
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
|
||||
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
|
||||
@@ -2233,7 +2242,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json')
|
||||
au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json
|
||||
au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}all-contributorsrc,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,flake.lock,mcmod.info setf json
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json5')
|
||||
@@ -2347,7 +2356,7 @@ endif
|
||||
if !has_key(g:polyglot_is_disabled, 'glsl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag()
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader setf glsl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'git')
|
||||
@@ -2538,7 +2547,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'c/c++')
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp setf cpp
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cppm,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp,*.txx setf cpp
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c
|
||||
endif
|
||||
@@ -2579,7 +2588,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.sw,*.targets,*.tml,*.tpm,*.typ,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||
@@ -2673,6 +2682,43 @@ if !has_key(g:polyglot_is_disabled, '8th')
|
||||
au BufNewFile,BufRead *.8th setf 8th
|
||||
endif
|
||||
|
||||
" Extension matchers for natively-supported filetypes not in packages.yaml
|
||||
au BufNewFile,BufRead *.beancount setf beancount
|
||||
au BufNewFile,BufRead *.quake setf m3quake
|
||||
au BufNewFile,BufRead *.factor setf factor
|
||||
au BufNewFile,BufRead *.fusion setf fusion
|
||||
au BufNewFile,BufRead *.gd setf gdscript
|
||||
au BufNewFile,BufRead *.tscn,*.tres setf gdresource
|
||||
au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
|
||||
au BufNewFile,BufRead *.gift setf gift
|
||||
au BufNewFile,BufRead *.hack,*.hackpartial setf hack
|
||||
au BufNewFile,BufRead *.hbs setf handlebars
|
||||
au BufNewFile,BufRead *.heex setf heex
|
||||
au BufNewFile,BufRead *.htt,*.htb setf httest
|
||||
au BufNewFile,BufRead *.man setf man
|
||||
au BufNewFile,BufRead *.map setf map
|
||||
au BufNewFile,BufRead *.fpc setf fpcmake
|
||||
au BufNewFile,BufRead *.pcmk setf pcmk
|
||||
au BufNewFile,BufRead *.prisma setf prisma
|
||||
au BufNewFile,BufRead *.epp setf epuppet
|
||||
au BufNewFile,BufRead *.pc setf proc
|
||||
au BufNewFile,BufRead *.psl setf psl
|
||||
au BufNewFile,BufRead *.pbtxt setf pbtxt
|
||||
au BufNewFile,BufRead *.pk setf poke
|
||||
au BufNewFile,BufRead *.arr setf pyret
|
||||
au BufNewFile,BufRead *.ql,*.qll setf ql
|
||||
au BufNewFile,BufRead *.rsc setf routeros
|
||||
au BufNewFile,BufRead *.rbs setf rbs
|
||||
au BufNewFile,BufRead *.scd setf scdoc
|
||||
au BufNewFile,BufRead *.rq,*.sparql setf sparql
|
||||
au BufNewFile,BufRead *.sln setf solution
|
||||
au BufNewFile,BufRead *.nut setf squirrel
|
||||
au BufNewFile,BufRead *.sface setf surface
|
||||
au BufNewFile,BufRead *.tl setf teal
|
||||
au BufNewFile,BufRead *.tla setf tla
|
||||
au BufNewFile,BufRead *.twig setf twig
|
||||
au BufNewFile,BufRead *.yang setf yang
|
||||
au BufNewFile,BufRead *.zut setf zimbutempl
|
||||
|
||||
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
|
||||
@@ -487,6 +487,7 @@ let s:interpreters = {
|
||||
\ 'julia': 'julia',
|
||||
\ 'lua': 'lua',
|
||||
\ 'moon': 'moon',
|
||||
\ 'nft': 'nftables',
|
||||
\ 'ocaml': 'ocaml',
|
||||
\ 'ocamlrun': 'ocaml',
|
||||
\ 'ocamlscript': 'ocaml',
|
||||
@@ -499,6 +500,9 @@ let s:interpreters = {
|
||||
\ 'python': 'python',
|
||||
\ 'python2': 'python',
|
||||
\ 'python3': 'python',
|
||||
\ 'py': 'python',
|
||||
\ 'pypy': 'python',
|
||||
\ 'pypy3': 'python',
|
||||
\ 'qmake': 'qmake',
|
||||
\ 'Rscript': 'r',
|
||||
\ 'racket': 'racket',
|
||||
@@ -510,6 +514,7 @@ let s:interpreters = {
|
||||
\ 'rake': 'ruby',
|
||||
\ 'jruby': 'ruby',
|
||||
\ 'rbx': 'ruby',
|
||||
\ 'rust-script': 'rust',
|
||||
\ 'scala': 'scala',
|
||||
\ 'ash': 'sh',
|
||||
\ 'bash': 'sh',
|
||||
|
||||
@@ -55,7 +55,7 @@ let s:globs = {
|
||||
\ 'brewfile': 'Brewfile',
|
||||
\ 'bsdl': '*.bsdl,*bsd',
|
||||
\ 'bst': '*.bst',
|
||||
\ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE',
|
||||
\ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel',
|
||||
\ 'bzr': 'bzr_log.*',
|
||||
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
||||
\ 'cabal': '*.cabal',
|
||||
@@ -86,7 +86,7 @@ let s:globs = {
|
||||
\ 'conf': '*.conf,auto.master,config',
|
||||
\ 'config': 'configure.in,configure.ac,Pipfile',
|
||||
\ 'context': '*.mkii,*.mkiv,*.mkvi',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.moc,*.tlh',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cppm,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.txx,*.moc,*.tlh',
|
||||
\ 'cql': '*.cql',
|
||||
\ 'crm': '*.crm',
|
||||
\ 'crontab': 'crontab,crontab.*',
|
||||
@@ -130,7 +130,7 @@ let s:globs = {
|
||||
\ 'dnsmasq': '',
|
||||
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||
\ 'dosbatch': '*.bat,*.sys',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,buildozer.spec,pylintrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dosini': '*.wrap,*.ini,*.cnf,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dot': '*.dot,*.gv',
|
||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
@@ -153,7 +153,7 @@ let s:globs = {
|
||||
\ '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',
|
||||
\ 'erlang': '*.erl,*.app,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'eruby': '*.erb,*.erb.deface,*.rhtml',
|
||||
\ 'esmtprc': '*esmtprc',
|
||||
\ 'esqlc': '*.ec,*.EC',
|
||||
@@ -190,7 +190,7 @@ let s:globs = {
|
||||
\ 'gitsendemail': '.gitsendemail.*',
|
||||
\ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?',
|
||||
\ 'gleam': '*.gleam',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader,*.comp',
|
||||
\ 'gmpl': '*.mod',
|
||||
\ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc',
|
||||
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
|
||||
@@ -262,7 +262,7 @@ let s:globs = {
|
||||
\ 'jovial': '*.jov,*.j73,*.jovial',
|
||||
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
||||
\ 'jq': '*.jq,.jqrc,.jqrc*',
|
||||
\ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info',
|
||||
\ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.all-contributorsrc,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,flake.lock,mcmod.info',
|
||||
\ 'json5': '*.json5',
|
||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
@@ -322,7 +322,7 @@ let s:globs = {
|
||||
\ 'maple': '*.mv,*.mpl,*.mws',
|
||||
\ 'markdown': '*.md,*.livemd,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr',
|
||||
\ 'markdown.mdx': '*.mdx',
|
||||
\ 'mason': '*.mason,*.mhtml,*.comp',
|
||||
\ 'mason': '*.mason,*.mhtml,*.comp,*.html',
|
||||
\ 'master': '*.mas,*.master',
|
||||
\ 'mel': '*.mel',
|
||||
\ 'mermaid': '*.mermaid,*.mm,*.mmd',
|
||||
@@ -393,7 +393,7 @@ let s:globs = {
|
||||
\ 'passwd': '',
|
||||
\ 'pccts': '*.g',
|
||||
\ 'pdf': '*.pdf',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,.latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,latexmkrc,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'pest': '*.pest',
|
||||
\ 'pf': 'pf.conf',
|
||||
\ 'pfmain': 'main.cf',
|
||||
@@ -417,7 +417,7 @@ let s:globs = {
|
||||
\ 'ppwiz': '*.it,*.ih',
|
||||
\ 'privoxy': '*.action',
|
||||
\ 'procmail': '.procmail,.procmailrc',
|
||||
\ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'prolog': '*.pl,*.plt,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'promela': '*.pml',
|
||||
\ 'proto': '*.proto',
|
||||
\ 'protocols': '',
|
||||
@@ -428,7 +428,7 @@ let s:globs = {
|
||||
\ 'puppet': '*.pp,Modulefile',
|
||||
\ 'purescript': '*.purs',
|
||||
\ 'pyrex': '*.pyx,*.pxd',
|
||||
\ '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',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,wscript,.pythonrc,.pythonstartup',
|
||||
\ 'qmake': '*.pro,*.pri',
|
||||
\ 'qml': '*.qml,*.qbs',
|
||||
\ 'quake': '',
|
||||
@@ -482,7 +482,7 @@ let s:globs = {
|
||||
\ 'services': '',
|
||||
\ 'setserial': '',
|
||||
\ 'sexplib': '*.sexp',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.zsh-theme,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,.bash_aliases,.bash_functions,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile',
|
||||
\ 'sieve': '*.siv,*.sieve',
|
||||
\ 'sil': '*.sil',
|
||||
\ 'simula': '*.sim',
|
||||
@@ -554,7 +554,7 @@ let s:globs = {
|
||||
\ 'tilde': '*.t.html',
|
||||
\ 'tli': '*.tli',
|
||||
\ 'tmux': '.tmux*.conf',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,pdm.lock,poetry.lock',
|
||||
\ 'tpp': '*.tpp',
|
||||
\ 'tptp': '*.p,*.tptp,*.ax',
|
||||
\ 'trasys': '*.inp',
|
||||
@@ -582,7 +582,7 @@ let s:globs = {
|
||||
\ 'usserverlog': '*.usserver.log\c,usserver.log\c,usserver.*.log\c',
|
||||
\ 'usw2kagtlog': '*.usw2kagt.log\c,usw2kagt.log\c,usw2kagt.*.log\c',
|
||||
\ 'vala': '*.vala,*.vapi,*.valadoc',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vbnet': '*.vb,*.vbhtml',
|
||||
\ 'vcl': '*.vcl',
|
||||
\ 'velocity': '*.vm',
|
||||
@@ -613,7 +613,7 @@ let s:globs = {
|
||||
\ 'xhtml': '*.xhtml,*.xht',
|
||||
\ 'xinetd': '',
|
||||
\ 'xmath': '*.msc,*.msf',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.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,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.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,*.xmp,*.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': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.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,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.sw,*.targets,*.tml,*.typ,*.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,*.xmp,*.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',
|
||||
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
||||
\ 'xpm': '*.xpm,*.pm',
|
||||
|
||||
@@ -3,46 +3,31 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requ
|
||||
endif
|
||||
|
||||
""
|
||||
" @section Introduction, intro
|
||||
" @library
|
||||
" <doc/@plugin(name).txt> is generated by <https://github.com/google/vimdoc>.
|
||||
" See <README.md> for more information about installation and screenshots.
|
||||
" Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
|
||||
"
|
||||
" When a file's shebang is "pip install -r" or "pip-compile",
|
||||
" set its filetype to |requirements|.
|
||||
function! requirements#shebang() abort
|
||||
let s:line1 = getline(1)
|
||||
|
||||
""
|
||||
" Update cache.
|
||||
function! requirements#update_cache() abort
|
||||
let s:items = []
|
||||
let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip'))
|
||||
let l:pypi_items = split(system('pip-cache pkgnames'))
|
||||
for l:item in l:pip_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pip'}]
|
||||
endfor
|
||||
for l:item in l:pypi_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pypi'}]
|
||||
endfor
|
||||
call writefile([json_encode(s:items)], s:cache)
|
||||
endfunction
|
||||
|
||||
if exists('*stdpath')
|
||||
let s:cache_dir_home = stdpath('cache')
|
||||
else
|
||||
let s:cache_dir_home = $HOME . '/.cache/nvim'
|
||||
if s:line1 =~# "^#!"
|
||||
if s:line1 =~# '^#!\s*\S*\<env\s'
|
||||
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
|
||||
let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
let s:cache_dir = s:cache_dir_home . '/requirements.vim'
|
||||
call mkdir(s:cache_dir, 'p')
|
||||
""
|
||||
" Completion cache path.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#cache',
|
||||
\ s:cache_dir . '/requirements.json'
|
||||
\ )
|
||||
let s:cache = g:requirements#cache
|
||||
try
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
catch /\v^Vim%(\(\a+\))?:E(684|484|491):/
|
||||
call requirements#update_cache()
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
endtry
|
||||
""
|
||||
" Completion cache contents. For program.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#items', s:items)
|
||||
if s:line1 =~# '^#!\s*\a:[/\\]'
|
||||
let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!.*\<env\>'
|
||||
let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
|
||||
let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
|
||||
else
|
||||
let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
|
||||
endif
|
||||
if s:name =~# '^pip'
|
||||
set ft=requirements
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requirements/utils.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
""
|
||||
" @section Configuration, config
|
||||
|
||||
function! s:Flag(name, default) abort
|
||||
let l:scope = get(split(a:name, ':'), 0, 'g:')
|
||||
let l:name = get(split(a:name, ':'), -1)
|
||||
let {l:scope}:{l:name} = get({l:scope}:, l:name, a:default)
|
||||
endfunction
|
||||
|
||||
let g:requirements#utils#plugin = {'Flag': funcref('s:Flag')}
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Ruby
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@@ -493,7 +492,7 @@ class VimRubyCompletion
|
||||
trail = "%s%s" % [ dir, sub ]
|
||||
tcfg = "%sconfig" % trail
|
||||
|
||||
if File.exists?( tcfg )
|
||||
if File.exist?( tcfg )
|
||||
rails_base = trail
|
||||
break
|
||||
end
|
||||
@@ -506,7 +505,7 @@ class VimRubyCompletion
|
||||
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
if File.exist?( bootfile ) && File.exist?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
require envfile
|
||||
|
||||
@@ -3,14 +3,17 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'smt2', 'autoload/smt2/formatt
|
||||
endif
|
||||
|
||||
" Formatting requires a rather recent Vim version
|
||||
if !((v:version > 802) || (v:version == 802 && has("patch2725")))
|
||||
if (v:version < 802) || (v:version == 802 && !has("patch2725"))
|
||||
const s:errmsg_oldvim = "Vim >= 8.2.2725 required for auto-formatting"
|
||||
|
||||
"Dummies
|
||||
function! smt2#formatter#FormatCurrentParagraph()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatAllParagraphs()
|
||||
function! smt2#formatter#FormatOutermostSExpr()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatFile()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
|
||||
@@ -88,55 +91,75 @@ def Format(ast: dict<any>, indent = 0): string
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n")
|
||||
elseif ast.kind ==# 'File'
|
||||
var formatted = []
|
||||
for child in ast.value
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n\n")
|
||||
endif
|
||||
throw 'Cannot format AST node: ' .. string(ast)
|
||||
return '' # Unreachable
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
def FormatInCurrentBuffer(ast: dict<any>)
|
||||
const cursor = getpos('.')
|
||||
|
||||
# Format lines and potential surrounding text on them
|
||||
const formatted_lines = split(Format(ast), '\n')
|
||||
const ast_coords = ast.CalcCoords()
|
||||
const ws_mask = " \n\r\t"
|
||||
const first_line_part_to_keep = getline(ast_coords[0].line)
|
||||
->strcharpart(0, ast_coords[0].col - 2)
|
||||
->trim(ws_mask, 2)
|
||||
const last_line_part_to_keep = getline(ast_coords[1].line)
|
||||
->strcharpart(ast_coords[1].col - 1)
|
||||
->trim(ws_mask, 1)
|
||||
|
||||
# If section of AST has trailing whitespace until the file end, remove it
|
||||
cursor(ast_coords[1].line, ast_coords[1].col)
|
||||
if search('\m\C\S', 'W') == 0
|
||||
deletebufline('%', ast_coords[1].line + 1, line('$'))
|
||||
endif
|
||||
|
||||
# Replace section of AST by formatted lines (w/o killing surrounding text)
|
||||
deletebufline('%', ast_coords[0].line, ast_coords[1].line)
|
||||
if !empty(last_line_part_to_keep)
|
||||
last_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
formatted_lines->append(ast_coords[0].line - 1)
|
||||
if !empty(first_line_part_to_keep)
|
||||
first_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
|
||||
# If section of AST has leading whitespace until the file start, remove it
|
||||
cursor(ast_coords[0].line, ast_coords[0].col)
|
||||
if search('\m\C\S', 'bW') == 0
|
||||
deletebufline('%', 1, ast_coords[0].line - 1)
|
||||
endif
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#formatter#FormatCurrentParagraph()
|
||||
const cursor = getpos('.')
|
||||
const ast = smt2#parser#ParseCurrentParagraph()
|
||||
|
||||
# Identify on which end of the buffer we are (to fix newlines later)
|
||||
silent! normal! {
|
||||
const is_first_paragraph = line('.') == 1
|
||||
silent! normal! }
|
||||
const is_last_paragraph = line('.') == line('$')
|
||||
|
||||
# Replace paragraph by formatted lines
|
||||
const lines = split(Format(ast), '\n')
|
||||
silent! normal! {d}
|
||||
if is_last_paragraph && !is_first_paragraph
|
||||
call append('.', [''] + lines)
|
||||
else
|
||||
call append('.', lines + [''])
|
||||
endif
|
||||
|
||||
# Remove potentially introduced first empty line
|
||||
if is_first_paragraph | silent! :1delete | endif
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
def smt2#formatter#FormatAllParagraphs()
|
||||
const cursor = getpos('.')
|
||||
const asts = smt2#parser#ParseAllParagraphs()
|
||||
|
||||
# Clear buffer & insert formatted paragraphs
|
||||
silent! :1,$delete
|
||||
for ast in asts
|
||||
const lines = split(Format(ast), '\n') + ['']
|
||||
call append('$', lines)
|
||||
endfor
|
||||
|
||||
# Remove first & trailing empty lines
|
||||
silent! :1delete
|
||||
silent! :$delete
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
def smt2#formatter#FormatOutermostSExpr()
|
||||
const ast = smt2#parser#ParseOutermostSExpr()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
def smt2#formatter#FormatFile()
|
||||
const ast = smt2#parser#ParseFile()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
@@ -11,17 +11,37 @@ set maxfuncdepth=100000000 # SMT files tend to be highly nested
|
||||
# TODO: Change Ast.kind type from string to enum/number?
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# AST nodes -- essentially named token wrappers
|
||||
# AST nodes
|
||||
#
|
||||
# Note: pos_from, pos_to and contains_comment were only introduced to allow for
|
||||
# a fast FitsOneLine(ast) function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens
|
||||
# Note: pos_from, pos_to and contains_comment allow for a fast FitsOneLine(ast)
|
||||
# function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens.
|
||||
# ------------------------------------------------------------------------------
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool): dict<any>
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment}
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool, scanner: dict<any>): dict<any>
|
||||
# User-facing functionality wants start/end line and column -- not positions
|
||||
def CalcCoords(): list<dict<number>>
|
||||
const from = scanner.calcCoord(pos_from)
|
||||
# If expression ends at end of line, pos_to will be in next line.
|
||||
# That's undesired. Stay in the actual last line.
|
||||
var to = scanner.calcCoord(pos_to - 1)
|
||||
to.col += 1
|
||||
return [from, to]
|
||||
enddef
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment, CalcCoords: CalcCoords}
|
||||
enddef
|
||||
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
def FileAst(paragraphs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for paragraph in paragraphs
|
||||
if paragraph.contains_comment
|
||||
contains_comment = true
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('File', paragraphs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -29,10 +49,10 @@ def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment)
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -40,15 +60,22 @@ def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment)
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def AtomAst(token: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8)
|
||||
def AtomAst(token: dict<any>, scanner: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8, scanner)
|
||||
enddef
|
||||
|
||||
def PrintAst(ast: dict<any>, indent = 0)
|
||||
echo repeat(' ', indent * 2) .. '[' .. ast.kind .. '] '
|
||||
const coords = ast.CalcCoords()
|
||||
|
||||
echo printf("[%5d-%-5d) [%4d:%-3d-%4d:%-3d) %s[%s] ",
|
||||
ast.pos_from, ast.pos_to,
|
||||
coords[0].line, coords[0].col,
|
||||
coords[1].line, coords[1].col,
|
||||
repeat(' ', indent * 2),
|
||||
ast.kind)
|
||||
|
||||
if ast.kind ==# 'Atom'
|
||||
echon ast.value.lexeme
|
||||
@@ -60,13 +87,18 @@ def PrintAst(ast: dict<any>, indent = 0)
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
elseif ast.kind ==# 'File'
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Grammar
|
||||
# ------------------------------------------------------------------------------
|
||||
# Paragraph ::= Expr+
|
||||
# File ::= Paragraph+
|
||||
# Paragraph ::= Expr+ EndOfParagraph
|
||||
# Expr ::= SExpr | Atom
|
||||
# SExpr ::= '(' Expr* ')'
|
||||
|
||||
@@ -77,14 +109,16 @@ def AtStartOfLParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 0 # token_lparen
|
||||
enddef
|
||||
|
||||
def ParseLParen(scanner: dict<any>) # consumes token; no return
|
||||
def ParseLParen(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfLParen(),
|
||||
"ParseLParen called but not at start of LParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -94,14 +128,16 @@ def AtStartOfRParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 1 # token_rparen
|
||||
enddef
|
||||
|
||||
def ParseRParen(scanner: dict<any>) # consumes token; no return
|
||||
def ParseRParen(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
"ParseRParen called but not at start of RParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -118,7 +154,7 @@ def ParseAtom(scanner: dict<any>): dict<any>
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const ast = AtomAst(scanner.cur_token)
|
||||
const ast = AtomAst(scanner.cur_token, scanner)
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return ast
|
||||
enddef
|
||||
@@ -129,6 +165,7 @@ enddef
|
||||
def AtStartOfExpr(scanner: dict<any>): bool
|
||||
return scanner->AtStartOfSExpr() || scanner->AtStartOfAtom()
|
||||
enddef
|
||||
|
||||
def ParseExpr(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfExpr(),
|
||||
@@ -146,6 +183,7 @@ enddef
|
||||
# SExpr
|
||||
# ------------------------------------------------------------------------------
|
||||
const AtStartOfSExpr = funcref(AtStartOfLParen)
|
||||
|
||||
def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
@@ -165,10 +203,10 @@ def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
printf("Expected RParen but got %s", scanner.cur_token.kind->smt2#scanner#TokenKind2Str()),
|
||||
scanner.cur_token.pos)
|
||||
scanner->ParseRParen()
|
||||
const end_token = scanner->ParseRParen()
|
||||
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return SExprAst(exprs, pos_from, pos_to)
|
||||
const pos_to = end_token.pos + 1
|
||||
return SExprAst(exprs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -187,41 +225,132 @@ def ParseParagraph(scanner: dict<any>): dict<any>
|
||||
exprs->add(scanner->ParseExpr())
|
||||
endwhile
|
||||
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return ParagraphAst(exprs, pos_from, pos_to)
|
||||
const pos_to = exprs[-1].pos_to
|
||||
return ParagraphAst(exprs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# File
|
||||
# ------------------------------------------------------------------------------
|
||||
def ParseFile(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
var paragraphs = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
paragraphs->add(ast)
|
||||
endwhile
|
||||
|
||||
const pos_to = empty(paragraphs) ? pos_from : paragraphs[-1].pos_to
|
||||
return FileAst(paragraphs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
#
|
||||
# TODO: MoveTo* functions rely on local search instead of proper (but slow)
|
||||
# scanning of the whole file and may be incorrect in corner cases.
|
||||
# Consider tweaking.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Returns true if successful, i.e. on move to '(' of outermost SExpr
|
||||
def MoveToOutermostSExpr(): bool
|
||||
var cur_pos = getpos('.')
|
||||
while true
|
||||
silent! normal! [(
|
||||
const new_pos = getpos('.')
|
||||
if cur_pos == new_pos
|
||||
break
|
||||
else
|
||||
cur_pos = new_pos
|
||||
endif
|
||||
endwhile
|
||||
|
||||
const cur_char = getline('.')[charcol('.') - 1]
|
||||
return cur_char == '('
|
||||
enddef
|
||||
|
||||
def CursorInSExpr(): bool
|
||||
const cursor = getpos('.')
|
||||
silent! normal! [(
|
||||
const res = cursor != getpos('.')
|
||||
call setpos('.', cursor)
|
||||
return res
|
||||
enddef
|
||||
|
||||
def MoveToStartOfCurrentParagraph()
|
||||
# Empty (or whitespace) lines outside of S-expressions separate paragraphs.
|
||||
# Nothing to do if cursor is already at such a line.
|
||||
if !(getline('.')->trim()->empty() && !CursorInSExpr())
|
||||
# Move backwards until an empty line that is not in an SExpr is found,
|
||||
# or -- if there is none -- to the first line of the file
|
||||
while true
|
||||
const empty_line = search('\m\C^\s*$', 'b', 1)
|
||||
if !CursorInSExpr()
|
||||
break
|
||||
elseif empty_line == 0
|
||||
cursor(1, 1)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#parser#ParseCurrentParagraph(): dict<any>
|
||||
# source = [start of current paragraph, EOF]
|
||||
# Note: This is needed since `silent! normal! {y}` may not yank full paragraphs
|
||||
# in the context of multiline expressions
|
||||
const cursor = getpos('.')
|
||||
silent! normal! {
|
||||
const line_offset = line('.')
|
||||
const source = join(getline('.', '$'), "\n")
|
||||
MoveToStartOfCurrentParagraph()
|
||||
const from = getpos('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, line_offset)
|
||||
# source = [paragraph of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! {` is not guaranteed to jump
|
||||
# to the start of the paragraph, e.g. if newlines occur in between.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
const ast = scanner->ParseParagraph()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseAllParagraphs(): list<dict<any>>
|
||||
# source = current buffer
|
||||
const source = join(getline(1, '$'), "\n")
|
||||
def smt2#parser#ParseOutermostSExpr(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
if ! MoveToOutermostSExpr()
|
||||
throw "Cursor is not in an S-expression!"
|
||||
endif
|
||||
const from = getpos('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source)
|
||||
var asts = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
asts->add(ast)
|
||||
# source = [start of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! %` is not guaranteed to jump
|
||||
# to the matching ')', e.g. if an unmatched '(' occurs in a comment.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
const ast = scanner->ParseSExpr()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
endwhile
|
||||
return asts
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseFile(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
cursor(1, 1)
|
||||
const first_non_empty_line = search('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
# source = [first non-empty line, EOF]
|
||||
const source = join(getline(first_non_empty_line, '$'), "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, first_non_empty_line)
|
||||
const ast = scanner->ParseFile()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
@@ -56,7 +56,7 @@ enddef
|
||||
|
||||
def PrettyPrint(scanner: dict<any>, token: dict<any>)
|
||||
const coord = scanner->Pos2Coord(token.pos)
|
||||
echo printf("%4d:%-3d (%5d) %8s %s", coord.line, coord.col, token.pos, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
echo printf("%5d %4d:%-3d %8s %s", token.pos, coord.line, coord.col, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -72,12 +72,14 @@ enddef
|
||||
# TODO: Enforce restriction to ASCII? We should if we use the lookup table below
|
||||
# TODO: Do not take a string but a character stream (or just buffer and pos)?
|
||||
|
||||
def smt2#scanner#Scanner(source: string, line_offset = 1): dict<any>
|
||||
def smt2#scanner#Scanner(source: string, start_line = 1, start_col = 1): dict<any>
|
||||
var scanner = {
|
||||
chars: source->trim(" \t\n\r", 2)->split('\zs'),
|
||||
line_offset: line_offset, # start line of source string in buffer
|
||||
pos: 0, # pos in source string -- not column in line
|
||||
at_new_paragraph: false}
|
||||
chars: source->trim(" \n\r\t", 2)->split('\zs'),
|
||||
line_offset: start_line, # start line of source string in buffer
|
||||
pos: start_col - 1, # pos in source string -- not column in line
|
||||
at_new_paragraph: false,
|
||||
}
|
||||
scanner.calcCoord = (pos: number): dict<number> => Pos2Coord(scanner, pos)
|
||||
|
||||
if scanner.chars->empty()
|
||||
scanner.at_eof = true
|
||||
|
||||
@@ -9,6 +9,11 @@ set cpoptions&vim
|
||||
let $TF_CLI_ARGS_fmt=''
|
||||
|
||||
function! terraform#fmt() abort
|
||||
silent execute 'w !'.g:terraform_binary_path.' fmt -check -'
|
||||
if v:shell_error == 0
|
||||
return
|
||||
endif
|
||||
|
||||
" Save the view.
|
||||
let curw = winsaveview()
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'unison', 'autoload/unison.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Unison functionality for Vim, including type/term omnicompletion.
|
||||
"
|
||||
" Maintainer: Unison Computing
|
||||
" Original Author: Cody Allen (ceedubs)
|
||||
|
||||
if exists('g:autoloaded_unison')
|
||||
finish
|
||||
endif
|
||||
let g:autoloaded_unison = 1
|
||||
|
||||
let s:required_config_value = "!REQUIRED!"
|
||||
|
||||
" adapted from https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/autoload/rust.vim#L9-L18
|
||||
function! s:config(name, default) abort
|
||||
let name = 'unison_' . a:name
|
||||
" Local buffer variable with same name takes predeence over global
|
||||
if has_key(b:, name)
|
||||
return get(b:, name)
|
||||
elseif has_key(g:, name)
|
||||
return get(g:, name)
|
||||
elseif a:default == s:required_config_value
|
||||
throw 'Missing required configuration value: ' . name
|
||||
else
|
||||
return a:default
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:curl_path() abort
|
||||
return s:config('curl_path', "curl")
|
||||
endfunction
|
||||
|
||||
function! s:jq_path() abort
|
||||
return s:config('jq_path', "jq")
|
||||
endfunction
|
||||
|
||||
function! unison#SetBufferDefaults() abort
|
||||
if s:config('set_buffer_defaults', 1)
|
||||
" Since Unison completion is fuzzy and not prefix-based, 'longest' doesn't
|
||||
" work well, and 'noinsert' behaves a little better.
|
||||
setlocal completeopt=menuone,noinsert,preview
|
||||
|
||||
setlocal omnifunc=unison#Complete
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Unison completion satisfying the standard vim completion signature, such
|
||||
" that it can be assigned to omnifunc.
|
||||
" vim will first call this to find the base input that should be completed,
|
||||
" and then will call it again with the base input.
|
||||
function! unison#Complete(findstart, base) abort
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
" Examples of where we want to count the start of a word:
|
||||
"
|
||||
" foo List.fold<cursor>
|
||||
" ^
|
||||
"
|
||||
" {Abor<cursor>
|
||||
" ^
|
||||
"
|
||||
" (List.fol<cursor>
|
||||
" ^
|
||||
while start > 0 && line[start - 1] !~ '\v\s|[!(){}\[\]]'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
return unison#CompleteForBase(a:base)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Return an array of completion items for the provided base input. For example
|
||||
" base could be 'List.foldL', in which case the top result would probably be
|
||||
" 'List.foldLeft'.
|
||||
function! unison#CompleteForBase(base) abort
|
||||
let resultLimit = s:config('complete_result_limit', 20)
|
||||
let apiHost = s:config('api_host', 'localhost')
|
||||
let apiPort = s:config('api_port', s:required_config_value)
|
||||
let apiToken = s:config('api_token', s:required_config_value)
|
||||
let apiUri = 'http://' . apiHost . ':' . apiPort . '/' . apiToken . '/api/find'
|
||||
|
||||
let curlCommand = s:curl_path() . " -Gfs
|
||||
\ --data-urlencode 'limit=" . resultLimit . "'
|
||||
\ --data-urlencode 'query=" . a:base . "' "
|
||||
\ . apiUri
|
||||
|
||||
let jqFilter = '
|
||||
\ def prettyTermType: .termType|[(.[] | .segment)]|add;
|
||||
\ def prettyTypeDef: if .tag == "BuiltinObject" then "builtin type " else "" end + (.contents|[(.[] | .segment)]|add);
|
||||
\ def termToMatch: {
|
||||
\ word: .bestFoundTermName,
|
||||
\ info: (.namedTerm.termName + " : " + (.namedTerm|prettyTermType)),
|
||||
\ menu: .namedTerm|prettyTermType
|
||||
\ };
|
||||
\ def typeToMatch: {
|
||||
\ word: .bestFoundTypeName,
|
||||
\ info: (.namedType.typeName + " : " + (.typeDef|prettyTypeDef)),
|
||||
\ menu: .typeDef|prettyTypeDef
|
||||
\ };
|
||||
\ .[][1]|(
|
||||
\ (select(.tag == "FoundTermResult")|.contents|termToMatch),
|
||||
\ (select(.tag == "FoundTypeResult")|.contents|typeToMatch)
|
||||
\ )'
|
||||
|
||||
let command = curlCommand . " | " . s:jq_path() . " -c '" . jqFilter . "'"
|
||||
let lines = system(command)
|
||||
let resultObjects = split(lines, "\n")
|
||||
call map(resultObjects, {_, val -> json_decode(val)})
|
||||
return resultObjects
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=2 sts=2 ts=2:
|
||||
@@ -1,134 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'xsd', 'autoload/xml/xsd.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Author: Thomas Barthel
|
||||
" Last change: 2007 May 8
|
||||
let g:xmldata_xsd = {
|
||||
\ 'schema': [
|
||||
\ [ 'include', 'import', 'redefine', 'annotation', 'simpleType', 'complexType', 'element', 'attribute', 'attributeGroup', 'group', 'notation', 'annotation'],
|
||||
\ { 'targetNamespace' : [], 'version' : [], 'xmlns' : [], 'finalDefault' : [], 'blockDefault' : [], 'id' : [], 'elementFormDefault' : [], 'attributeFormDefault' : [], 'xml:lang' : [] }],
|
||||
\ 'redefine' : [
|
||||
\ ['annotation', 'simpleType', 'complexType', 'attributeGroup', 'group'],
|
||||
\ {'schemaLocation' : [], 'id' : []} ],
|
||||
\ 'include' : [
|
||||
\ ['annotation'],
|
||||
\ {'namespace' : [], 'id' : []} ],
|
||||
\ 'import' : [
|
||||
\ ['annotation'],
|
||||
\ {'namespace' : [], 'schemaLocation' : [], 'id' : []} ],
|
||||
\ 'complexType' : [
|
||||
\ ['annotation', 'simpleContent', 'complexContent', 'all', 'choice', 'sequence', 'group', 'attribute', 'attributeGroup', 'anyAttribute'],
|
||||
\ {'name' : [], 'id' : [], 'abstract' : [], 'final' : [], 'block' : [], 'mixed' : []} ],
|
||||
\ 'complexContent' : [
|
||||
\ ['annotation', 'restriction', 'extension'],
|
||||
\ {'mixed' : [], 'id' : [] } ],
|
||||
\ 'simpleType' : [
|
||||
\ ['annotation', 'restriction', 'list', 'union'],
|
||||
\ {'name' : [], 'final' : [], 'id' : []} ],
|
||||
\ 'simpleContent' : [
|
||||
\ ['annotation', 'restriction', 'extension'],
|
||||
\ {'id' : []} ],
|
||||
\ 'element' : [
|
||||
\ ['annotation', 'complexType', 'simpleType', 'unique', 'key', 'keyref'],
|
||||
\ {'name' : [], 'id' : [], 'ref' : [], 'type' : [], 'minOccurs' : [], 'maxOccurs' : [], 'nillable' : [], 'substitutionGroup' : [], 'abstract' : [], 'final' : [], 'block' : [], 'default' : [], 'fixed' : [], 'form' : []} ],
|
||||
\ 'attribute' : [
|
||||
\ ['annotation', 'simpleType'],
|
||||
\ {'name' : [], 'id' : [], 'ref' : [], 'type' : [], 'use' : [], 'default' : [], 'fixed' : [], 'form' : []} ],
|
||||
\ 'group' : [
|
||||
\ ['annotation', 'all', 'choice', 'sequence'],
|
||||
\ {'name' : [], 'ref' : [], 'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
|
||||
\ 'choice' : [
|
||||
\ ['annotation', 'element', 'group', 'choice', 'sequence', 'any'],
|
||||
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
|
||||
\ 'sequence' : [
|
||||
\ ['annotation', 'element', 'group', 'choice', 'sequence', 'any'],
|
||||
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
|
||||
\ 'all' : [
|
||||
\ ['annotation', 'element'],
|
||||
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
|
||||
\ 'any' : [
|
||||
\ ['annotation'],
|
||||
\ {'namespace' : [], 'processContents' : [], 'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
|
||||
\ 'unique' : [
|
||||
\ ['annotation', 'selector', 'field'],
|
||||
\ {'name' : [], 'id' : []} ],
|
||||
\ 'key' : [
|
||||
\ ['annotation', 'selector', 'field'],
|
||||
\ {'name' : [], 'id' : []} ],
|
||||
\ 'keyref' : [
|
||||
\ ['annotation', 'selector', 'field'],
|
||||
\ {'name' : [], 'refer' : [], 'id' : []} ],
|
||||
\ 'selector' : [
|
||||
\ ['annotation'],
|
||||
\ {'xpath' : [], 'id' : []} ],
|
||||
\ 'field' : [
|
||||
\ ['annotation'],
|
||||
\ {'xpath' : [], 'id' : []} ],
|
||||
\ 'restriction' : [
|
||||
\ ['annotation', 'simpleType', 'minExclusive', 'maxExclusive', 'minInclusive', 'maxInclusive', 'totalDigits', 'fractionDigits', 'length', 'minLength', 'maxLength', 'enumeration', 'whiteSpace', 'pattern'],
|
||||
\ {'base' : [], 'id' : []} ],
|
||||
\ 'minExclusive' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'maxExclusive' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'minInclusive' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'maxInclusive' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'totalDigits' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'fractionDigits' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'length' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'minLength' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'maxLength' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'enumeration' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : []}],
|
||||
\ 'whiteSpace' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : [], 'fixed' : []}],
|
||||
\ 'pattern' : [
|
||||
\ ['annotation'],
|
||||
\ {'value' : [], 'id' : []}],
|
||||
\ 'extension' : [
|
||||
\ ['annotation', 'all', 'choice', 'sequence', 'group', 'attribute', 'attributeGroup', 'anyAttribute'],
|
||||
\ {'base' : [], 'id' : []} ],
|
||||
\ 'attributeGroup' : [
|
||||
\ ['annotation', 'attribute', 'attributeGroup', 'anyAttribute'],
|
||||
\ {'name' : [], 'id' : [], 'ref' : []} ],
|
||||
\ 'anyAttribute' : [
|
||||
\ ['annotation'],
|
||||
\ {'namespace' : [], 'processContents' : [], 'id' : []} ],
|
||||
\ 'list' : [
|
||||
\ ['annotation', 'simpleType'],
|
||||
\ {'itemType' : [], 'id' : []} ],
|
||||
\ 'union' : [
|
||||
\ ['annotation', 'simpleType'],
|
||||
\ {'id' : [], 'memberTypes' : []} ],
|
||||
\ 'notation' : [
|
||||
\ ['annotation'],
|
||||
\ {'name' : [], 'id' : [], 'public' : [], 'system' : []} ],
|
||||
\ 'annotation' : [
|
||||
\ ['appinfo', 'documentation'],
|
||||
\ {} ],
|
||||
\ 'appinfo' : [
|
||||
\ [],
|
||||
\ {'source' : [], 'id' : []} ],
|
||||
\ 'documentation' : [
|
||||
\ [],
|
||||
\ {'source' : [], 'id' : [], 'xml' : []} ]
|
||||
\ }
|
||||
@@ -1,42 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ant', 'compiler/ant.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,26 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bdf', 'compiler/bdf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: BDF to PCF Conversion
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "bdf"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal makeprg=bdftopcf\ $*
|
||||
|
||||
setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
|
||||
\%-Z%p^,
|
||||
\%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,30 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cs', 'compiler/cs.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Microsoft Visual Studio C#
|
||||
" Maintainer: Yichao Zhou (broken.zhou@gmail.com)
|
||||
" Previous Maintainer: Joseph H. Yao (hyao@sina.com)
|
||||
" Last Change: Jul 22, 2019
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "cs"
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet errorformat&
|
||||
CompilerSet errorformat+=%f(%l\\,%v):\ %t%*[^:]:\ %m,
|
||||
\%trror%*[^:]:\ %m,
|
||||
\%tarning%*[^:]:\ %m
|
||||
|
||||
CompilerSet makeprg=csc\ %:S
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
@@ -1,19 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dot', 'compiler/dot.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: ATT dot
|
||||
" Maintainer: Marcos Macedo <bar4ka@bol.com.br>
|
||||
" Last Change: 2004 May 16
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "dot"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=dot\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\"
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
26
compiler/jq.vim
Normal file
26
compiler/jq.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'compiler/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('b:current_compiler')
|
||||
finish
|
||||
endif
|
||||
let b:current_compiler = 'jq'
|
||||
|
||||
let s:save_cpoptions = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
if has('unix')
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ /dev/null
|
||||
else
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ nul
|
||||
endif
|
||||
CompilerSet errorformat=%E%m\ at\ \\<%o\\>\\,\ line\ %l:,
|
||||
\%Z,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpoptions = s:save_cpoptions
|
||||
unlet s:save_cpoptions
|
||||
@@ -23,7 +23,11 @@ if !exists('g:ledger_main')
|
||||
let g:ledger_main = '%'
|
||||
endif
|
||||
|
||||
if !g:ledger_is_hledger
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
if !b:is_hledger
|
||||
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
||||
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
||||
" Capture Ledger warnings:
|
||||
|
||||
@@ -7,7 +7,7 @@ endif
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" License: This file is part of LilyPond, the GNU music typesetter.
|
||||
"
|
||||
" Copyright (C) 2004, 2007 Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Copyright (C) 2004--2022 Heikki Junes <hjunes@cc.hut.fi>
|
||||
"
|
||||
" LilyPond is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'compiler/pip_
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.7.1
|
||||
" Version: 1.8.0
|
||||
" Author: raimon <raimon49@hotmail.com>
|
||||
" License: MIT LICENSE
|
||||
" The MIT License (MIT)
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Rake
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: RSpec
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -7,7 +7,6 @@ endif
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sass', 'compiler/sass.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Sass
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "sass"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=sass
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%f:%l:%m\ (Sass::Syntax%trror),
|
||||
\%ESyntax\ %trror:%m,
|
||||
\%C%\\s%\\+on\ line\ %l\ of\ %f,
|
||||
\%Z%.%#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set sw=2 sts=2:
|
||||
@@ -1,32 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sml', 'compiler/sml.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: SML/NJ Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Feb 10
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "sml"
|
||||
|
||||
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=sml
|
||||
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
|
||||
\%f:%l.%c\ %trror:\ %m,
|
||||
\%trror:\ %m
|
||||
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
|
||||
\%f:%l.%c\ %tarning:\ %m,
|
||||
\%tarning:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,21 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tcl', 'compiler/tcl.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: tcl
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2004 Nov 27
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "tcl"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=tcl
|
||||
|
||||
CompilerSet errorformat=%EError:\ %m,%+Z\ %\\{4}(file\ \"%f\"\ line\ %l),%-G%.%#
|
||||
@@ -1,30 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tidy', 'compiler/tidy.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: HTML Tidy
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "tidy"
|
||||
|
||||
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=tidy\ -quiet\ -errors\ --gnu-emacs\ yes
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m,
|
||||
\%f:%l:%c:\ %tarning:\ %m,
|
||||
\%f:%l:%c:\ %tnfo:\ %m,
|
||||
\%f:%l:%c:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -22,4 +22,4 @@ endif
|
||||
|
||||
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||
|
||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
CompilerSet errorformat+=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), '8th', 'ftplugin/8th.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: 8th
|
||||
" Version: any
|
||||
" Last Change: 2021 Sep 20
|
||||
" Last Change: 2021/09/20
|
||||
" 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 8th plugin for this buffer
|
||||
let b:did_8thplugin = 1
|
||||
|
||||
setlocal ts=2 sts=2 sw=2 et
|
||||
setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\
|
||||
setlocal fo=tcrqol
|
||||
setlocal matchpairs+=\::;
|
||||
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
setlocal suffixesadd=.8th
|
||||
let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<"
|
||||
@@ -1,24 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'a2ps', 'ftplugin/a2ps.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,36 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'aap', 'ftplugin/aap.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Aap recipe
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Nov 14
|
||||
|
||||
" 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', 'commentstring' and 'expandtab' to undo
|
||||
" this plugin.
|
||||
let b:undo_ftplugin = "setl fo< com< cms< 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:-
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
" Expand tabs to spaces to avoid trouble.
|
||||
setlocal expandtab
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||
endif
|
||||
@@ -1,33 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'abap', 'ftplugin/abap.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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 :
|
||||
@@ -1,101 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'abaqus', 'ftplugin/abaqus.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
215
ftplugin/ada.vim
215
ftplugin/ada.vim
@@ -1,215 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ada', 'ftplugin/ada.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" 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
|
||||
if !exists(':AdaTagFile')
|
||||
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'')')
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'alsaconf', 'ftplugin/alsaconf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,48 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ant', 'ftplugin/ant.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'arch', 'ftplugin/arch.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,19 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'art', 'ftplugin/art.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,64 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'aspvbs', 'ftplugin/aspvbs.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,20 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'automake', 'ftplugin/automake.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,60 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'awk', 'ftplugin/awk.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2020 Sep 28
|
||||
|
||||
" This plugin was prepared by Mark Sikora
|
||||
" This plugin was updated as proposed by Doug Kearns
|
||||
|
||||
" 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 s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal define=function
|
||||
setlocal suffixesadd+=.awk
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< def< sua<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
" TODO: set this in scripts.vim?
|
||||
if exists("g:awk_is_gawk")
|
||||
setlocal include=@include
|
||||
setlocal suffixesadd+=.gawk
|
||||
if has("unix") || has("win32unix")
|
||||
setlocal formatprg=gawk\ -f-\ -o/dev/stdout
|
||||
let b:undo_ftplugin .= " | setl fp<"
|
||||
endif
|
||||
|
||||
let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'")
|
||||
let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd
|
||||
let path = substitute(path, ':', ',', 'g')
|
||||
|
||||
let &l:path = path
|
||||
let b:undo_ftplugin .= " | setl inc< path<"
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8
|
||||
@@ -1,60 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'basic', 'ftplugin/basic.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: BASIC (QuickBASIC 4.5)
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:'
|
||||
setlocal commentstring='\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
" TODO: support exit ... as middle matches?
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let s:line_start = '\%(^\s*\)\@<='
|
||||
let s:not_end = '\%(end\s\+\)\@<!'
|
||||
let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!'
|
||||
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words =
|
||||
\ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' ..
|
||||
\ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' ..
|
||||
\ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' ..
|
||||
\ s:not_end .. '\<type\>:\<end\s\+type\>,' ..
|
||||
\ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..
|
||||
\ '\<do\>:\<loop\>,' ..
|
||||
\ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' ..
|
||||
\ '\<while\>:\<wend\>,' ..
|
||||
\ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' ..
|
||||
\ '\<lock\>:\<unlock\>'
|
||||
|
||||
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' ..
|
||||
\ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"'
|
||||
|
||||
unlet s:line_start s:not_end s:not_end_or_exit
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..
|
||||
\ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<" ..
|
||||
\ " | unlet! b:match_ignorecase b:match_skip b:match_words" ..
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
@@ -1,24 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bdf', 'ftplugin/bdf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: BDF font definition
|
||||
" 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=b:COMMENT commentstring=COMMENT\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,19 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bst', 'ftplugin/bst.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: bst
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id: bst.vim,v 1.1 2007/05/05 17:37:57 vimboss Exp $
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal commentstring=%\ %s
|
||||
setlocal comments=:%
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
let b:undo_ftplugin = "setlocal com< cms< fo<"
|
||||
100
ftplugin/bzl.vim
100
ftplugin/bzl.vim
@@ -1,100 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bzl', 'ftplugin/bzl.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
""
|
||||
" @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')
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
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
|
||||
@@ -1,24 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'calendar', 'ftplugin/calendar.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: calendar(1) input 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=s1:/*,mb:*,ex:*/ commentstring& include&
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,22 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cdrdaoconf', 'ftplugin/cdrdaoconf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2007-12-04
|
||||
|
||||
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
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cfg', 'ftplugin/cfg.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Configuration File
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Latest Revision: 2018-12-24
|
||||
|
||||
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 cms< fo<"
|
||||
|
||||
setlocal commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,21 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ch', 'ftplugin/ch.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Ch
|
||||
" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
|
||||
" URL: http://www.softintegration.com/download/vim/ftplugin/ch.vim
|
||||
" Last change: 2004 May 16
|
||||
" Created based on cpp.vim
|
||||
"
|
||||
" Ch is a C/C++ interpreter with many high level extensions
|
||||
"
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Behaves just like C
|
||||
runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
|
||||
@@ -1,273 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cobol', 'ftplugin/cobol.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: cobol
|
||||
" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
|
||||
" (formerly Tim Pope <vimNOSPAM@tpope.info>)
|
||||
" Last Update: By Ankit Jain (add gtk support) on 15.08.2020
|
||||
|
||||
" Insert mode mappings: <C-T> <C-D> <Tab>
|
||||
" Normal mode mappings: < > << >> [[ ]] [] ][
|
||||
" Visual mode mappings: < >
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal commentstring=\ \ \ \ \ \ *%s
|
||||
setlocal comments=:*
|
||||
setlocal fo+=croqlt
|
||||
setlocal expandtab
|
||||
setlocal textwidth=72
|
||||
|
||||
" matchit support
|
||||
if exists("loaded_matchit")
|
||||
let s:ordot = '\|\ze\.\%( \@=\|$\)'
|
||||
let b:match_ignorecase=1
|
||||
"let b:match_skip = 'getline(".") =~ "^.\\{6\\}[*/C]"'
|
||||
let b:match_words=
|
||||
\ '\$if\>:$else\>:\$endif\>,' .
|
||||
\ '[$-]\@<!\<if\>:\<\%(then\|else\)\>:\<end-if\>'.s:ordot.',' .
|
||||
\ '-\@<!\<perform\s\+\%(\d\+\s\+times\|until\|varying\|with\s\+test\)\>:\<end-perform\>'.s:ordot . ',' .
|
||||
\ '-\@<!\<\%(search\|evaluate\)\>:\<\%(when\)\>:\<end-\%(search\|evaluate\)\>' .s:ordot . ',' .
|
||||
\ '-\@<!\<\%(add\|compute\|divide\|multiply\|subtract\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+size\s\+error\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=on\s\+size\s\+error\>:\<end-\%(add\|compute\|divide\|multiply\|subtract\)\>' .s:ordot . ',' .
|
||||
\ '-\@<!\<\%(string\|unstring\|accept\|display\|call\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+\%(overflow\|exception\)\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=on\s\+\%(overflow\|exception\)\>:\<end-\%(string\|unstring\|accept\|display\|call\)\>' .s:ordot . ',' .
|
||||
\ '-\@<!\<\%(delete\|rewrite\|start\|write\|read\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>:\<end-\%(delete\|rewrite\|start\|write\|read\)\>' .s:ordot
|
||||
endif
|
||||
|
||||
" add gtk support
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n".
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setlocal com< cms< fo< et< tw<" .
|
||||
\ " | unlet! b:browsefilter b:match_words b:match_ignorecase b:match_skip"
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps")
|
||||
let b:undo_ftplugin = b:undo_ftplugin .
|
||||
\ " | sil! exe 'nunmap <buffer> <'" .
|
||||
\ " | sil! exe 'nunmap <buffer> >'" .
|
||||
\ " | sil! exe 'nunmap <buffer> <<'" .
|
||||
\ " | sil! exe 'nunmap <buffer> >>'" .
|
||||
\ " | sil! exe 'vunmap <buffer> <'" .
|
||||
\ " | sil! exe 'vunmap <buffer> >'" .
|
||||
\ " | sil! exe 'iunmap <buffer> <C-D>'" .
|
||||
\ " | sil! exe 'iunmap <buffer> <C-T>'" .
|
||||
\ " | sil! exe 'iunmap <buffer> <Tab>'" .
|
||||
\ " | sil! exe 'nunmap <buffer> <Plug>Traditional'" .
|
||||
\ " | sil! exe 'nunmap <buffer> <Plug>Comment'" .
|
||||
\ " | sil! exe 'nunmap <buffer> <Plug>DeComment'" .
|
||||
\ " | sil! exe 'vunmap <buffer> <Plug>VisualTraditional'" .
|
||||
\ " | sil! exe 'vunmap <buffer> <Plug>VisualComment'" .
|
||||
\ " | sil! exe 'iunmap <buffer> <Plug>VisualDeComment'" .
|
||||
\ " | sil! exe 'unmap <buffer> [['" .
|
||||
\ " | sil! exe 'unmap <buffer> ]]'" .
|
||||
\ " | sil! exe 'unmap <buffer> []'" .
|
||||
\ " | sil! exe 'unmap <buffer> ]['"
|
||||
endif
|
||||
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps")
|
||||
if version >= 700
|
||||
nnoremap <silent> <buffer> > :set opfunc=<SID>IncreaseFunc<CR>g@
|
||||
nnoremap <silent> <buffer> < :set opfunc=<SID>DecreaseFunc<CR>g@
|
||||
endif
|
||||
nnoremap <silent> <buffer> >> :call CobolIndentBlock(1)<CR>
|
||||
nnoremap <silent> <buffer> << :call CobolIndentBlock(-1)<CR>
|
||||
vnoremap <silent> <buffer> > :call CobolIndentBlock(v:count1)<CR>
|
||||
vnoremap <silent> <buffer> < :call CobolIndentBlock(-v:count1)<CR>
|
||||
inoremap <silent> <buffer> <C-T> <C-R>=<SID>IncreaseIndent()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
|
||||
inoremap <silent> <buffer> <C-D> <C-R>=<SID>DecreaseIndent()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
|
||||
if !maparg("<Tab>","i")
|
||||
inoremap <silent> <buffer> <Tab> <C-R>=<SID>Tab()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
|
||||
endif
|
||||
noremap <silent> <buffer> [[ m':call search('\c^\%(\s*\<Bar>.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\<Bar>section\)\s*\.','bW')<CR>
|
||||
noremap <silent> <buffer> ]] m':call search('\c^\%(\s*\<Bar>.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\<Bar>section\)\.','W')<CR>
|
||||
noremap <silent> <buffer> [] m':call <SID>toend('b')<CR>
|
||||
noremap <silent> <buffer> ][ m':call <SID>toend('')<CR>
|
||||
" For EnhancedCommentify
|
||||
noremap <silent> <buffer> <Plug>Traditional :call <SID>Comment('t')<CR>
|
||||
noremap <silent> <buffer> <Plug>Comment :call <SID>Comment('c')<CR>
|
||||
noremap <silent> <buffer> <Plug>DeComment :call <SID>Comment('u')<CR>
|
||||
noremap <silent> <buffer> <Plug>VisualTraditional :'<,'>call <SID>Comment('t')<CR>
|
||||
noremap <silent> <buffer> <Plug>VisualComment :'<,'>call <SID>Comment('c')<CR>
|
||||
noremap <silent> <buffer> <Plug>VisualDeComment :'<,'>call <SID>Comment('u')<CR>
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
if exists("g:did_cobol_ftplugin_functions")
|
||||
finish
|
||||
endif
|
||||
let g:did_cobol_ftplugin_functions = 1
|
||||
|
||||
function! s:repeat(str,count)
|
||||
let i = 0
|
||||
let ret = ""
|
||||
while i < a:count
|
||||
let ret = ret . a:str
|
||||
let i = i + 1
|
||||
endwhile
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
function! s:increase(...)
|
||||
let lnum = '.'
|
||||
let sw = shiftwidth()
|
||||
let i = a:0 ? a:1 : indent(lnum)
|
||||
if i >= 11
|
||||
return sw - (i - 11) % sw
|
||||
elseif i >= 7
|
||||
return 11-i
|
||||
elseif i == 6
|
||||
return 1
|
||||
else
|
||||
return 6-i
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:decrease(...)
|
||||
let lnum = '.'
|
||||
let sw = shiftwidth()
|
||||
let i = indent(a:0 ? a:1 : lnum)
|
||||
if i >= 11 + sw
|
||||
return 1 + (i + 12) % sw
|
||||
elseif i > 11
|
||||
return i-11
|
||||
elseif i > 7
|
||||
return i-7
|
||||
elseif i == 7
|
||||
return 1
|
||||
else
|
||||
return i
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! CobolIndentBlock(shift)
|
||||
let head = strpart(getline('.'),0,7)
|
||||
let tail = strpart(getline('.'),7)
|
||||
let indent = match(tail,'[^ ]')
|
||||
let sw = shiftwidth()
|
||||
let shift = a:shift
|
||||
if shift > 0
|
||||
if indent < 4
|
||||
let tail = s:repeat(" ",4-indent).tail
|
||||
let shift = shift - 1
|
||||
endif
|
||||
let tail = s:repeat(" ",shift*sw).tail
|
||||
let shift = 0
|
||||
elseif shift < 0
|
||||
if (indent-4) > -shift * sw
|
||||
let tail = strpart(tail,-shift * sw)
|
||||
elseif (indent-4) > (-shift-1) * sw
|
||||
let tail = strpart(tail,indent - 4)
|
||||
else
|
||||
let tail = strpart(tail,indent)
|
||||
endif
|
||||
endif
|
||||
call setline('.',head.tail)
|
||||
endfunction
|
||||
|
||||
function! s:IncreaseFunc(type)
|
||||
'[,']call CobolIndentBlock(1)
|
||||
endfunction
|
||||
|
||||
function! s:DecreaseFunc(type)
|
||||
'[,']call CobolIndentBlock(-1)
|
||||
endfunction
|
||||
|
||||
function! s:IncreaseIndent()
|
||||
let c = "\<C-T>"
|
||||
if exists("*InsertCtrlTWrapper")
|
||||
let key = InsertCtrlTWrapper()
|
||||
if key != c
|
||||
return key
|
||||
endif
|
||||
endif
|
||||
let interval = s:increase()
|
||||
let b:cobol_shiftwidth = &shiftwidth
|
||||
let &shiftwidth = 1
|
||||
let lastchar = strpart(getline('.'),col('.')-2,1)
|
||||
if lastchar == '0' || lastchar == '^'
|
||||
return "\<BS>".lastchar.c
|
||||
else
|
||||
return s:repeat(c,interval)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:DecreaseIndent()
|
||||
let c = "\<C-D>"
|
||||
if exists("*InsertCtrlDWrapper")
|
||||
" I hack Ctrl-D to delete when not at the end of the line.
|
||||
let key = InsertCtrlDWrapper()
|
||||
if key != c
|
||||
return key
|
||||
endif
|
||||
endif
|
||||
let interval = s:decrease()
|
||||
let b:cobol_shiftwidth = &shiftwidth
|
||||
let &shiftwidth = 1
|
||||
return s:repeat(c,interval)
|
||||
endfunction
|
||||
|
||||
function! s:RestoreShiftwidth()
|
||||
if exists("b:cobol_shiftwidth")
|
||||
let &shiftwidth=b:cobol_shiftwidth
|
||||
unlet b:cobol_shiftwidth
|
||||
endif
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
function! s:Tab()
|
||||
if (strpart(getline('.'),0,col('.')-1) =~ '^\s*$' && &sta)
|
||||
return s:IncreaseIndent()
|
||||
" &softtabstop < 0: &softtabstop follows &shiftwidth
|
||||
elseif (&sts < 0 || &sts == shiftwidth()) && &sts != 8 && &et
|
||||
return s:repeat(" ",s:increase(col('.')-1))
|
||||
else
|
||||
return "\<Tab>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Comment(arg)
|
||||
" For EnhancedCommentify
|
||||
let line = getline('.')
|
||||
if (line =~ '^.\{6\}[*/C]' || a:arg == 'c') && a:arg != 'u'
|
||||
let line = substitute(line,'^.\{6\}\zs.',' ','')
|
||||
else
|
||||
let line = substitute(line,'^.\{6\}\zs.','*','')
|
||||
endif
|
||||
call setline('.',line)
|
||||
endfunction
|
||||
|
||||
function! s:toend(direction)
|
||||
let ignore = '^\(\s*\|.\{6\}\)\%([*/]\|\s*$\)'
|
||||
let keep = line('.')
|
||||
keepjumps +
|
||||
while line('.') < line('$') && getline('.') =~ ignore
|
||||
keepjumps +
|
||||
endwhile
|
||||
let res = search('\c^\%(\s*\|.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\|section\)\s*\.',a:direction.'W')
|
||||
if a:direction != 'b' && !res
|
||||
let res = line('$')
|
||||
keepjumps $
|
||||
elseif res
|
||||
keepjumps -
|
||||
endif
|
||||
if res
|
||||
while line('.') > 1 && getline('.') =~ ignore
|
||||
keepjumps -
|
||||
endwhile
|
||||
if line('.') == 1 && getline('.') =~ ignore
|
||||
exe "keepjumps ".keep
|
||||
endif
|
||||
else
|
||||
exe "keepjumps ".keep
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'conf', 'ftplugin/conf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" 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
|
||||
@@ -1,46 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'config', 'ftplugin/config.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: config
|
||||
" 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 = "Bourne Shell Files (*.sh)\t*.sh\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let s:match_words = ""
|
||||
|
||||
runtime! ftplugin/sh.vim ftplugin/sh_*.vim ftplugin/sh/*.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 configure-related files.
|
||||
if has("gui_win32")
|
||||
let b:browsefilter="Configure Scripts (configure.*, config.*)\tconfigure*;config.*\n" .
|
||||
\ s:browsefilter
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "unlet! b:browsefilter | " . b:undo_ftplugin
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'crm', 'ftplugin/crm.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: CRM114
|
||||
" 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
|
||||
@@ -62,7 +62,7 @@ if exists('g:loaded_matchit') && !exists('b:match_words')
|
||||
let b:match_ignorecase = 0
|
||||
|
||||
let b:match_words =
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|\%(abstract\s\+\)\@<!def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ ':' .
|
||||
\ '\<\%(else\|elsif\|ensure\|when\|in\|rescue\|break\|next\)\>' .
|
||||
\ ':' .
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cs', 'ftplugin/cs.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: C#
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Tue, 09 Mar 2004 14:09:33 CET
|
||||
|
||||
" 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 s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 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=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
||||
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "C# Source Files (*.cs)\t*.cs\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
@@ -1,31 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'csc', 'ftplugin/csc.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: csc
|
||||
" 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
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_words=
|
||||
\ '\<fix\>:\<endfix\>,' .
|
||||
\ '\<if\>:\<else\%(if\)\=\>:\<endif\>,' .
|
||||
\ '\<!loopondimensions\>\|\<!looponselected\>:\<!endloop\>'
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "unlet! b:match_words"
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -1,29 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'css', 'ftplugin/css.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: CSS
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Last Change: 2020 Dec 21
|
||||
|
||||
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< ofu< isk<"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/ commentstring&
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
setlocal omnifunc=csscomplete#CompleteCSS
|
||||
setlocal iskeyword+=-
|
||||
|
||||
let &l:include = '^\s*@import\s\+\%(url(\)\='
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cvsrc', 'ftplugin/cvsrc.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: cvs(1) RC 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= formatoptions-=tcroql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,387 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'debchangelog', 'ftplugin/debchangelog.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file (GUI menu, folding and completion)
|
||||
" Language: Debian Changelog
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
|
||||
" Stefano Zacchiroli <zack@debian.org>
|
||||
" Last Change: 2018-01-28
|
||||
" License: Vim License
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim
|
||||
|
||||
" Bug completion requires apt-listbugs installed for Debian packages or
|
||||
" python-launchpadlib installed for Ubuntu packages
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin=1
|
||||
|
||||
" {{{1 Local settings (do on every load)
|
||||
if exists('g:debchangelog_fold_enable')
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=DebGetChangelogFold(v:lnum)
|
||||
setlocal foldtext=DebChangelogFoldText()
|
||||
endif
|
||||
|
||||
" Debian changelogs are not supposed to have any other text width,
|
||||
" so the user cannot override this setting
|
||||
setlocal tw=78
|
||||
setlocal comments=f:*
|
||||
|
||||
" Clean unloading
|
||||
let b:undo_ftplugin = 'setlocal tw< comments< foldmethod< foldexpr< foldtext<'
|
||||
" }}}1
|
||||
|
||||
if exists('g:did_changelog_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin (this is global)
|
||||
let g:did_changelog_ftplugin = 1
|
||||
|
||||
" {{{1 GUI menu
|
||||
|
||||
" Helper functions returning various data.
|
||||
" Returns full name, either from $DEBFULLNAME or debianfullname.
|
||||
" TODO Is there a way to determine name from anywhere else?
|
||||
function <SID>FullName()
|
||||
if exists('$DEBFULLNAME')
|
||||
return $DEBFULLNAME
|
||||
elseif exists('g:debianfullname')
|
||||
return g:debianfullname
|
||||
else
|
||||
return 'Your Name'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Returns email address, from $DEBEMAIL, $EMAIL or debianemail.
|
||||
function <SID>Email()
|
||||
if exists('$DEBEMAIL')
|
||||
return $DEBEMAIL
|
||||
elseif exists('$EMAIL')
|
||||
return $EMAIL
|
||||
elseif exists('g:debianemail')
|
||||
return g:debianemail
|
||||
else
|
||||
return 'your@email.address'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Returns date in RFC822 format.
|
||||
function <SID>Date()
|
||||
let savelang = v:lc_time
|
||||
execute 'language time C'
|
||||
let dateandtime = strftime('%a, %d %b %Y %X %z')
|
||||
execute 'language time ' . savelang
|
||||
return dateandtime
|
||||
endfunction
|
||||
|
||||
function <SID>WarnIfNotUnfinalised()
|
||||
if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
|
||||
echohl WarningMsg
|
||||
echo 'The entry has not been unfinalised before editing.'
|
||||
echohl None
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function <SID>Finalised()
|
||||
let savelinenum = line('.')
|
||||
1
|
||||
call search('^ -- ')
|
||||
if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
|
||||
let returnvalue = 1
|
||||
else
|
||||
let returnvalue = 0
|
||||
endif
|
||||
execute savelinenum
|
||||
return returnvalue
|
||||
endfunction
|
||||
|
||||
" These functions implement the menus
|
||||
function NewVersion()
|
||||
" The new entry is unfinalised and shall be changed
|
||||
amenu disable Changelog.New\ Version
|
||||
amenu enable Changelog.Add\ Entry
|
||||
amenu enable Changelog.Close\ Bug
|
||||
amenu enable Changelog.Set\ Distribution
|
||||
amenu enable Changelog.Set\ Urgency
|
||||
amenu disable Changelog.Unfinalise
|
||||
amenu enable Changelog.Finalise
|
||||
call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', ''))
|
||||
call append(1, '')
|
||||
call append(2, '')
|
||||
call append(3, ' -- ')
|
||||
call append(4, '')
|
||||
call Urgency('low')
|
||||
normal! 1G0
|
||||
call search(')')
|
||||
normal! h
|
||||
normal!
|
||||
call setline(1, substitute(getline(1), '-\$\$', '-', ''))
|
||||
if exists('g:debchangelog_fold_enable')
|
||||
foldopen
|
||||
endif
|
||||
call AddEntry()
|
||||
endfunction
|
||||
|
||||
function AddEntry()
|
||||
1
|
||||
call search('^ -- ')
|
||||
.-2
|
||||
call append('.', ' * ')
|
||||
.+3
|
||||
let warn=<SID>WarnIfNotUnfinalised()
|
||||
.-2
|
||||
if warn
|
||||
echohl MoreMsg
|
||||
call input('Hit ENTER')
|
||||
echohl None
|
||||
endif
|
||||
startinsert!
|
||||
endfunction
|
||||
|
||||
function CloseBug()
|
||||
1
|
||||
call search('^ -- ')
|
||||
let warn=<SID>WarnIfNotUnfinalised()
|
||||
.-2
|
||||
call append('.', ' * (closes: #' . input('Bug number to close: ') . ')')
|
||||
normal! j^ll
|
||||
startinsert
|
||||
endfunction
|
||||
|
||||
function Distribution(dist)
|
||||
call setline(1, substitute(getline(1), ') *\%(UNRELEASED\|\l\+\);', ') ' . a:dist . ';', ''))
|
||||
endfunction
|
||||
|
||||
function Urgency(urg)
|
||||
call setline(1, substitute(getline(1), 'urgency=.*$', 'urgency=' . a:urg, ''))
|
||||
endfunction
|
||||
|
||||
function <SID>UnfinaliseMenu()
|
||||
" This means the entry shall be changed
|
||||
amenu disable Changelog.New\ Version
|
||||
amenu enable Changelog.Add\ Entry
|
||||
amenu enable Changelog.Close\ Bug
|
||||
amenu enable Changelog.Set\ Distribution
|
||||
amenu enable Changelog.Set\ Urgency
|
||||
amenu disable Changelog.Unfinalise
|
||||
amenu enable Changelog.Finalise
|
||||
endfunction
|
||||
|
||||
function Unfinalise()
|
||||
call <SID>UnfinaliseMenu()
|
||||
1
|
||||
call search('^ -- ')
|
||||
call setline('.', ' -- ')
|
||||
endfunction
|
||||
|
||||
function <SID>FinaliseMenu()
|
||||
" This means the entry should not be changed anymore
|
||||
amenu enable Changelog.New\ Version
|
||||
amenu disable Changelog.Add\ Entry
|
||||
amenu disable Changelog.Close\ Bug
|
||||
amenu disable Changelog.Set\ Distribution
|
||||
amenu disable Changelog.Set\ Urgency
|
||||
amenu enable Changelog.Unfinalise
|
||||
amenu disable Changelog.Finalise
|
||||
endfunction
|
||||
|
||||
function Finalise()
|
||||
call <SID>FinaliseMenu()
|
||||
1
|
||||
call search('^ -- ')
|
||||
call setline('.', ' -- ' . <SID>FullName() . ' <' . <SID>Email() . '> ' . <SID>Date())
|
||||
endfunction
|
||||
|
||||
|
||||
function <SID>MakeMenu()
|
||||
amenu &Changelog.&New\ Version :call NewVersion()<CR>
|
||||
amenu Changelog.&Add\ Entry :call AddEntry()<CR>
|
||||
amenu Changelog.&Close\ Bug :call CloseBug()<CR>
|
||||
menu Changelog.-sep- <nul>
|
||||
|
||||
amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR>
|
||||
amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR>
|
||||
amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR>
|
||||
menu Changelog.Set\ Distribution.-sep- <nul>
|
||||
amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR>
|
||||
amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR>
|
||||
amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR>
|
||||
amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR>
|
||||
|
||||
amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR>
|
||||
amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR>
|
||||
amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR>
|
||||
|
||||
menu Changelog.-sep- <nul>
|
||||
amenu Changelog.U&nfinalise :call Unfinalise()<CR>
|
||||
amenu Changelog.&Finalise :call Finalise()<CR>
|
||||
|
||||
if <SID>Finalised()
|
||||
call <SID>FinaliseMenu()
|
||||
else
|
||||
call <SID>UnfinaliseMenu()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
augroup changelogMenu
|
||||
au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif
|
||||
au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif
|
||||
augroup END
|
||||
|
||||
" }}}
|
||||
" {{{1 folding
|
||||
|
||||
" look for an author name in the [zonestart zoneend] lines searching backward
|
||||
function! s:getAuthor(zonestart, zoneend)
|
||||
let linepos = a:zoneend
|
||||
while linepos >= a:zonestart
|
||||
let line = getline(linepos)
|
||||
if line =~# '^ --'
|
||||
return substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '')
|
||||
endif
|
||||
let linepos -= 1
|
||||
endwhile
|
||||
return '[unknown]'
|
||||
endfunction
|
||||
|
||||
" Look for a package source name searching backward from the givenline and
|
||||
" returns it. Return the empty string if the package name can't be found
|
||||
function! DebGetPkgSrcName(lineno)
|
||||
let lineidx = a:lineno
|
||||
let pkgname = ''
|
||||
while lineidx > 0
|
||||
let curline = getline(lineidx)
|
||||
if curline =~# '^\S'
|
||||
let pkgname = matchlist(curline, '^\(\S\+\).*$')[1]
|
||||
break
|
||||
endif
|
||||
let lineidx = lineidx - 1
|
||||
endwhile
|
||||
return pkgname
|
||||
endfunction
|
||||
|
||||
function! DebChangelogFoldText()
|
||||
if v:folddashes ==# '-' " changelog entry fold
|
||||
return foldtext() . ' -- ' . s:getAuthor(v:foldstart, v:foldend) . ' '
|
||||
endif
|
||||
return foldtext()
|
||||
endfunction
|
||||
|
||||
function! DebGetChangelogFold(lnum)
|
||||
let line = getline(a:lnum)
|
||||
if line =~# '^\w\+'
|
||||
return '>1' " beginning of a changelog entry
|
||||
endif
|
||||
if line =~# '^\s\+\[.*\]'
|
||||
return '>2' " beginning of an author-specific chunk
|
||||
endif
|
||||
if line =~# '^ --'
|
||||
return '1'
|
||||
endif
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
if exists('g:debchangelog_fold_enable')
|
||||
silent! foldopen! " unfold the entry the cursor is on (usually the first one)
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
" {{{1 omnicompletion for Closes: #
|
||||
|
||||
if !exists('g:debchangelog_listbugs_severities')
|
||||
let g:debchangelog_listbugs_severities = 'critical,grave,serious,important,normal,minor,wishlist'
|
||||
endif
|
||||
|
||||
fun! DebCompleteBugs(findstart, base)
|
||||
if a:findstart
|
||||
let line = getline('.')
|
||||
|
||||
" try to detect whether this is closes: or lp:
|
||||
let g:debchangelog_complete_mode = 'debbugs'
|
||||
let try_colidx = col('.') - 1
|
||||
let colidx = -1 " default to no-completion-possible
|
||||
|
||||
while try_colidx > 0 && line[try_colidx - 1] =~# '\s\|\d\|#\|,\|:'
|
||||
let try_colidx = try_colidx - 1
|
||||
if line[try_colidx] ==# '#' && colidx == -1
|
||||
" found hash, where we complete from:
|
||||
let colidx = try_colidx
|
||||
elseif line[try_colidx] ==# ':'
|
||||
if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~? '\clp:'
|
||||
let g:debchangelog_complete_mode = 'lp'
|
||||
endif
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return colidx
|
||||
else " return matches:
|
||||
let bug_lines = []
|
||||
if g:debchangelog_complete_mode ==? 'lp'
|
||||
if ! has('python')
|
||||
echoerr 'vim must be built with Python support to use LP bug completion'
|
||||
return
|
||||
endif
|
||||
let pkgsrc = DebGetPkgSrcName(line('.'))
|
||||
python << EOF
|
||||
import vim
|
||||
try:
|
||||
from launchpadlib.launchpad import Launchpad
|
||||
from lazr.restfulclient.errors import HTTPError
|
||||
# login anonymously
|
||||
lp = Launchpad.login_anonymously('debchangelog.vim', 'production')
|
||||
ubuntu = lp.distributions['ubuntu']
|
||||
try:
|
||||
sp = ubuntu.getSourcePackage(name=vim.eval('pkgsrc'))
|
||||
status = ('New', 'Incomplete', 'Confirmed', 'Triaged',
|
||||
'In Progress', 'Fix Committed')
|
||||
tasklist = sp.searchTasks(status=status, order_by='id')
|
||||
liststr = '['
|
||||
for task in tasklist:
|
||||
bug = task.bug
|
||||
liststr += "'#%d - %s'," % (bug.id, bug.title.replace('\'', '\'\''))
|
||||
liststr += ']'
|
||||
vim.command('silent let bug_lines = %s' % liststr.encode('utf-8'))
|
||||
except HTTPError:
|
||||
pass
|
||||
except ImportError:
|
||||
vim.command('echoerr \'python-launchpadlib >= 1.5.4 needs to be installed to use Launchpad bug completion\'')
|
||||
EOF
|
||||
else
|
||||
if ! filereadable('/usr/sbin/apt-listbugs')
|
||||
echoerr 'apt-listbugs not found, you should install it to use Closes bug completion'
|
||||
return
|
||||
endif
|
||||
let pkgsrc = DebGetPkgSrcName(line('.'))
|
||||
let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
|
||||
let bug_lines = split(listbugs_output, '\n')
|
||||
endif
|
||||
let completions = []
|
||||
for line in bug_lines
|
||||
let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$')
|
||||
" filter only those which match a:base:
|
||||
if parts[1] !~ '^' . a:base
|
||||
continue
|
||||
endif
|
||||
let completion = {}
|
||||
let completion['word'] = parts[1]
|
||||
let completion['menu'] = parts[2]
|
||||
let completion['info'] = parts[0]
|
||||
let completions += [completion]
|
||||
endfor
|
||||
return completions
|
||||
endif
|
||||
endfun
|
||||
|
||||
setlocal omnifunc=DebCompleteBugs
|
||||
|
||||
" }}}
|
||||
|
||||
" vim: set foldmethod=marker:
|
||||
@@ -1,74 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'debcontrol', 'ftplugin/debcontrol.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file (GUI menu and folding)
|
||||
" Language: Debian control files
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Pierre Habouzit <madcoder@debian.org>
|
||||
" Last Change: 2018-01-28
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debcontrol.vim
|
||||
|
||||
" Do these settings once per buffer
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin=1
|
||||
|
||||
" {{{1 Local settings (do on every load)
|
||||
if exists('g:debcontrol_fold_enable')
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=DebControlFold(v:lnum)
|
||||
setlocal foldtext=DebControlFoldText()
|
||||
endif
|
||||
setlocal textwidth=0
|
||||
|
||||
" Clean unloading
|
||||
let b:undo_ftplugin = 'setlocal tw< foldmethod< foldexpr< foldtext<'
|
||||
|
||||
" }}}1
|
||||
|
||||
" {{{1 folding
|
||||
|
||||
function! s:getField(f, lnum)
|
||||
let line = getline(a:lnum)
|
||||
let fwdsteps = 0
|
||||
while line !~ '^'.a:f.':'
|
||||
let fwdsteps += 1
|
||||
let line = getline(a:lnum + fwdsteps)
|
||||
if line ==# ''
|
||||
return 'unknown'
|
||||
endif
|
||||
endwhile
|
||||
return substitute(line, '^'.a:f.': *', '', '')
|
||||
endfunction
|
||||
|
||||
function! DebControlFoldText()
|
||||
if v:folddashes ==# '-' " debcontrol entry fold
|
||||
let type = substitute(getline(v:foldstart), ':.*', '', '')
|
||||
if type ==# 'Source'
|
||||
let ftext = substitute(foldtext(), ' *Source: *', ' ', '')
|
||||
return ftext . ' -- ' . s:getField('Maintainer', v:foldstart) . ' '
|
||||
endif
|
||||
let arch = s:getField('Architecture', v:foldstart)
|
||||
let ftext = substitute(foldtext(), ' *Package: *', ' [' . arch . '] ', '')
|
||||
return ftext . ': ' . s:getField('Description', v:foldstart) . ' '
|
||||
endif
|
||||
return foldtext()
|
||||
endfunction
|
||||
|
||||
function! DebControlFold(l)
|
||||
|
||||
" This is for not merging blank lines around folds to them
|
||||
if getline(a:l) =~# '^Source:'
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
if getline(a:l) =~# '^Package:'
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
@@ -1,22 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'denyhosts', 'ftplugin/denyhosts.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2007-12-04
|
||||
|
||||
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
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dictconf', 'ftplugin/dictconf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: dict(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< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dictdconf', 'ftplugin/dictdconf.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: dictd(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
|
||||
@@ -1,27 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'diff', 'ftplugin/diff.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Diff
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Nov 14
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl modeline< commentstring<"
|
||||
|
||||
" Don't use modelines in a diff, they apply to the diffed file
|
||||
setlocal nomodeline
|
||||
|
||||
" If there are comments they start with #
|
||||
let &l:commentstring = "# %s"
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||
endif
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dircolors', 'ftplugin/dircolors.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: dircolors(1) input 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
|
||||
@@ -1,20 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dockerfile', 'ftplugin/dockerfile.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: Dockerfile
|
||||
" Maintainer: Honza Pokorny <http://honza.ca>
|
||||
" Last Change: 2014 Aug 29
|
||||
|
||||
" 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
|
||||
@@ -1,44 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dosbatch', 'ftplugin/dosbatch.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: MS-DOS .bat files
|
||||
" Maintainer: Mike Williams <mrw@eandem.co.uk>
|
||||
" Last Change: 7th May 2020
|
||||
|
||||
" 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 s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" BAT comment formatting
|
||||
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
|
||||
setlocal commentstring=::\ %s
|
||||
setlocal formatoptions-=t formatoptions+=rol
|
||||
|
||||
" Lookup DOS keywords using Windows command help.
|
||||
if executable('help.exe')
|
||||
if has('terminal')
|
||||
setlocal keywordprg=:term\ help.exe
|
||||
else
|
||||
setlocal keywordprg=help.exe
|
||||
endif
|
||||
endif
|
||||
|
||||
" Define patterns for the browse file filter
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
|
||||
\ . "| unlet! b:browsefiler"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dosini', 'ftplugin/dosini.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Configuration File (ini file) for MS-DOS/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
|
||||
@@ -1,44 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dtd', 'ftplugin/dtd.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: dtd
|
||||
" 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
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal commentstring=<!--%s-->
|
||||
setlocal comments=s:<!--,m:\ \ \ \ \ ,e:-->
|
||||
|
||||
setlocal formatoptions-=t
|
||||
if !exists("g:ft_dtd_autocomment") || (g:ft_dtd_autocomment == 1)
|
||||
setlocal formatoptions+=croql
|
||||
endif
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_words = '<!--:-->,<!:>'
|
||||
endif
|
||||
|
||||
" Change the :browse e filter to primarily show Java-related files.
|
||||
if has("gui_win32")
|
||||
let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" .
|
||||
\ "XML Files (*.xml)\t*.xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" .
|
||||
\ " | unlet! b:matchwords b:browsefilter"
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -1,23 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'elinks', 'ftplugin/elinks.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: elinks(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< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user