forked from aniani/vim
Update runtime files.
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
" Vim completion script
|
||||
" Language: All languages, uses existing syntax highlighting rules
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 13.0
|
||||
" Last Change: 2019 Aug 08
|
||||
" Version: 14.0
|
||||
" Last Change: 2020 Dec 30
|
||||
" Usage: For detailed help, ":help ft-syntax-omni"
|
||||
|
||||
" History
|
||||
"
|
||||
" Version 14.0
|
||||
" - Fixed issue with single quotes and is_keyword
|
||||
" https://github.com/vim/vim/issues/7463
|
||||
"
|
||||
" Version 13.0
|
||||
" - Extended the option omni_syntax_group_include_{filetype}
|
||||
" to accept a comma separated list of regex's rather than
|
||||
@@ -179,7 +183,8 @@ function! syntaxcomplete#Complete(findstart, base)
|
||||
endif
|
||||
|
||||
" let base = s:prepended . a:base
|
||||
let base = s:prepended
|
||||
" let base = s:prepended
|
||||
let base = substitute(s:prepended, "'", "''", 'g')
|
||||
|
||||
let filetype = substitute(&filetype, '\.', '_', 'g')
|
||||
let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
|
||||
@@ -548,7 +553,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' )
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*', "", '' )
|
||||
|
||||
" We only want the words for the lines begining with
|
||||
" We only want the words for the lines beginning with
|
||||
" containedin, but there could be other items.
|
||||
|
||||
" Tried to remove all lines that do not begin with contained
|
||||
|
||||
28
runtime/compiler/sml.vim
Normal file
28
runtime/compiler/sml.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
" 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,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Feb 11
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1699,7 +1699,8 @@ tag command action ~
|
||||
|:version| :ve[rsion] print version number and other info
|
||||
|:verbose| :verb[ose] execute command with 'verbose' set
|
||||
|:vertical| :vert[ical] make following command split vertically
|
||||
|:vim9script| :vim9[script] indicates Vim9 script file
|
||||
|:vim9cmd| :vim9[cmd] make following command use Vim9 script syntax
|
||||
|:vim9script| :vim9s[cript] indicates Vim9 script file
|
||||
|:vimgrep| :vim[grep] search for pattern in files
|
||||
|:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Jan 08
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Feb 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -229,7 +229,7 @@ This is like executing two search commands after each other, except that:
|
||||
*last-pattern*
|
||||
The last used pattern and offset are remembered. They can be used to repeat
|
||||
the search, possibly in another direction or with another count. Note that
|
||||
two patterns are remembered: One for 'normal' search commands and one for the
|
||||
two patterns are remembered: One for "normal" search commands and one for the
|
||||
substitute command ":s". Each time an empty pattern is given, the previously
|
||||
used pattern is used. However, if there is no previous search command, a
|
||||
previous substitute pattern is used, if possible.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*popup.txt* For Vim version 8.2. Last change: 2021 Feb 06
|
||||
*popup.txt* For Vim version 8.2. Last change: 2021 Feb 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -693,8 +693,8 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
the left.
|
||||
border List with numbers, defining the border thickness
|
||||
above/right/below/left of the popup (similar to CSS).
|
||||
Only values of zero and non-zero are recognized.
|
||||
An empty list uses a border all around.
|
||||
Only values of zero and non-zero are currently
|
||||
recognized. An empty list uses a border all around.
|
||||
borderhighlight List of highlight group names to use for the border.
|
||||
When one entry it is used for all borders, otherwise
|
||||
the highlight for the top/right/bottom/left border.
|
||||
@@ -742,10 +742,10 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
line or to another window.
|
||||
mousemoved Like "moved" but referring to the mouse pointer
|
||||
position
|
||||
cursorline non-zero: Highlight the cursor line. Also scrolls the
|
||||
text to show this line (only works properly
|
||||
when 'wrap' is off).
|
||||
zero: Do not highlight the cursor line.
|
||||
cursorline TRUE: Highlight the cursor line. Also scrolls the
|
||||
text to show this line (only works properly
|
||||
when 'wrap' is off).
|
||||
zero: Do not highlight the cursor line.
|
||||
Default is zero, except for |popup_menu()|.
|
||||
filter A callback that can filter typed characters, see
|
||||
|popup-filter|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Jan 23
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -879,7 +879,7 @@ DEFINING BREAKPOINTS
|
||||
valid in the script where it has been defined and if that
|
||||
script is called from several other scripts, this will stop
|
||||
whenever that particular variable will become visible or
|
||||
unaccessible again.
|
||||
inaccessible again.
|
||||
|
||||
The [lnum] is the line number of the breakpoint. Vim will stop at or after
|
||||
this line. When omitted line 1 is used.
|
||||
|
||||
@@ -3402,7 +3402,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:vie editing.txt /*:vie*
|
||||
:view editing.txt /*:view*
|
||||
:vim quickfix.txt /*:vim*
|
||||
:vim9 repeat.txt /*:vim9*
|
||||
:vim9 vim9.txt /*:vim9*
|
||||
:vim9cmd vim9.txt /*:vim9cmd*
|
||||
:vim9s repeat.txt /*:vim9s*
|
||||
:vim9script repeat.txt /*:vim9script*
|
||||
:vimgrep quickfix.txt /*:vimgrep*
|
||||
:vimgrepa quickfix.txt /*:vimgrepa*
|
||||
@@ -10126,6 +10128,7 @@ vim9-export vim9.txt /*vim9-export*
|
||||
vim9-final vim9.txt /*vim9-final*
|
||||
vim9-gotchas vim9.txt /*vim9-gotchas*
|
||||
vim9-import vim9.txt /*vim9-import*
|
||||
vim9-mix vim9.txt /*vim9-mix*
|
||||
vim9-namespace vim9.txt /*vim9-namespace*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
vim9-reload vim9.txt /*vim9-reload*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Feb 10
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -39,13 +39,8 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- Use ":vim9cmd" as a command modifier? Then make ":vim9" short for that.
|
||||
- Add a test for profiling with nested function calls and lambda.
|
||||
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
|
||||
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
|
||||
- Expand `=expr` in :mkspell
|
||||
- Unlet with range: "unlet list[a : b]"
|
||||
- Implement "export {one, two three}".
|
||||
- Disallow :open ?
|
||||
- ISN_CHECKTYPE could use check_argtype()
|
||||
- Using a script variable inside a :def function doesn't work if the variable
|
||||
is inside a block, see Test_nested_function(). Should it work?
|
||||
@@ -110,10 +105,11 @@ Vim9 - Make everything work:
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
- In the generic eval docs, point out the Vim9 syntax where it differs.
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
|
||||
Also for Vim9:
|
||||
- better implementation for partial and tests for that.
|
||||
@@ -198,8 +194,6 @@ Text properties:
|
||||
'incsearch' with :s:
|
||||
- :s/foo using CTRL-G moves to another line, should not happen, or use the
|
||||
correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345)
|
||||
- :s@pat/tern@ doesn't include "/" in the pattern. (Takahiro Yoshihara, #3637)
|
||||
pass delim to do_search() ?
|
||||
- Also support range: :/foo/,/bar/delete
|
||||
- Also support for user command, e.g. Cfilter
|
||||
- :%s/foo should take the first match below the cursor line, unless there
|
||||
@@ -269,7 +263,7 @@ Terminal emulator window:
|
||||
- When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
conversions.
|
||||
|
||||
Valgind reports memory leaks in test_options
|
||||
Valgrind reports memory leaks in test_options
|
||||
|
||||
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
|
||||
|
||||
@@ -770,8 +764,6 @@ Memory leaks in test_channel? (or is it because of fork())
|
||||
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
|
||||
19.
|
||||
|
||||
Should make 'listchars' global-local. Local to window or to buffer?
|
||||
Probably window. #5206
|
||||
Add something like 'fillchars' local to window, but allow for specifying a
|
||||
highlight name. Esp. for the statusline.
|
||||
And "extends" and "precedes" are also useful without 'list' set. Also in
|
||||
@@ -1241,6 +1233,8 @@ Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
|
||||
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
|
||||
no longer support.
|
||||
|
||||
Suppoert sort(l, 'F'), convert strings to float. (#7857)
|
||||
|
||||
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
4#1038)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_04.txt* For Vim version 8.2. Last change: 2019 Nov 21
|
||||
*usr_04.txt* For Vim version 8.2. Last change: 2021 Feb 22
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -464,9 +464,9 @@ of characters to replace. It will not continue on the next line.
|
||||
|
||||
You can switch between Insert mode and Replace mode with the <Insert> key.
|
||||
|
||||
When you use <BS> (backspace) to make correction, you will notice that the
|
||||
old text is put back. Thus it works like an undo command for the last typed
|
||||
character.
|
||||
When you use <BS> (backspace) to make a correction, you will notice that the
|
||||
old text is put back. Thus it works like an undo command for the previously
|
||||
typed character.
|
||||
|
||||
==============================================================================
|
||||
*04.10* Conclusion
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Feb 03
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -279,8 +279,8 @@ without any command. The same for global, window, tab, buffer and Vim
|
||||
variables, because they are not really declared. They can also be deleted
|
||||
with `:unlet`.
|
||||
|
||||
Variables and functions cannot shadow previously defined or imported variables
|
||||
and functions.
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
|
||||
Global variables and user defined functions must be prefixed with "g:", also
|
||||
@@ -307,14 +307,14 @@ Example: >
|
||||
const myList = [1, 2]
|
||||
myList = [3, 4] # Error!
|
||||
myList[0] = 9 # Error!
|
||||
muList->add(3) # Error!
|
||||
myList->add(3) # Error!
|
||||
< *:final*
|
||||
`:final` is used for making only the variable a constant, the value can be
|
||||
changed. This is well known from Java. Example: >
|
||||
final myList = [1, 2]
|
||||
myList = [3, 4] # Error!
|
||||
myList[0] = 9 # OK
|
||||
muList->add(3) # OK
|
||||
myList->add(3) # OK
|
||||
|
||||
It is common to write constants as ALL_CAPS, but you don't have to.
|
||||
|
||||
@@ -412,7 +412,7 @@ NOT IMPLEMENTED YET
|
||||
|
||||
*vim9-curly*
|
||||
To avoid the "{" of a dictionary literal to be recognized as a statement block
|
||||
wrap it in parenthesis: >
|
||||
wrap it in parentheses: >
|
||||
var Lambda = (arg) => ({key: 42})
|
||||
|
||||
Also when confused with the start of a command block: >
|
||||
@@ -1029,10 +1029,14 @@ an error, thus breaking backwards compatibility. For example:
|
||||
- Using a number where a string is expected. *E1024*
|
||||
|
||||
One consequence is that the item type of a list or dict given to map() must
|
||||
not change. This will give an error in compiled code: >
|
||||
not change. This will give an error in Vim9 script: >
|
||||
map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected list<number> but got list<string>
|
||||
Instead use |mapnew()|.
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew()|. If the item type was determined to be "any" it can
|
||||
change to a more specific type. E.g. when a list of mixed types gets changed
|
||||
to a list of numbers.
|
||||
Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
|flattennew()| instead.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1084,7 +1088,7 @@ There is one way to use both legacy and Vim9 syntax in one script file: >
|
||||
vim9script
|
||||
# Vim9 script commands go here
|
||||
This allows for writing a script that takes advantage of the Vim9 script
|
||||
syntax if possible, but will also work on an Vim version without it.
|
||||
syntax if possible, but will also work on a Vim version without it.
|
||||
|
||||
This can only work in two ways:
|
||||
1. The "if" statement evaluates to false, the commands up to `endif` are
|
||||
|
||||
@@ -14,13 +14,11 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setl comments=:;
|
||||
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|#
|
||||
setl define=^\\s*(def\\k*
|
||||
setl formatoptions-=t
|
||||
setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
|
||||
setl lisp
|
||||
setl commentstring=;%s
|
||||
|
||||
setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|#
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Feb 07
|
||||
" Last Change: 2021 Feb 20
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -54,7 +54,7 @@ if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
|
||||
" Comments starts with # in Vim9 script
|
||||
setlocal commentstring=#%s
|
||||
else
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,:\"
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
|
||||
" Comments starts with a double quote in legacy script
|
||||
setlocal commentstring=\"%s
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Vim script
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Feb 13
|
||||
" Last Change: 2021 Feb 18
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -160,9 +160,9 @@ function GetVimIndentIntern()
|
||||
endif
|
||||
|
||||
let ends_in_comment = has('syntax_items')
|
||||
\ && synIDattr(synID(lnum, col('$'), 1), "name") =~ '\(Comment\|String\)$'
|
||||
\ && synIDattr(synID(lnum, len(getline(lnum)), 1), "name") =~ '\(Comment\|String\)$'
|
||||
|
||||
" A line ending in "{"/"[} is most likely the start of a dict/list literal,
|
||||
" A line ending in "{" or "[" is most likely the start of a dict/list literal,
|
||||
" indent the next line more. Not for a continuation line or {{{.
|
||||
if !ends_in_comment && prev_text_end =~ '\s[{[]\s*$' && !found_cont
|
||||
let ind = ind + shiftwidth()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: HTML
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2020 Mar 17
|
||||
" Included patch from Florian Breisch to add the summary element
|
||||
" Last Change: 2021 Feb 25
|
||||
" Included patch #7900 to fix comments
|
||||
"
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -141,9 +141,21 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
if exists("html_wrong_comments")
|
||||
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
else
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
|
||||
" The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next >
|
||||
" Note: must stand first to get lesser :syn-priority
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
|
||||
" Normal comment opening <!-- ...>
|
||||
syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
|
||||
" Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
|
||||
syn match htmlComment "<!---\?>" contains=htmlCommentError
|
||||
" Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
|
||||
" Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
|
||||
syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
|
||||
" Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
|
||||
syn match htmlCommentNested contained "<!--[^>]"me=e-1
|
||||
syn match htmlCommentNested contained "<!--->"me=e-3
|
||||
syn match htmlCommentNested contained "<!---\?!>"me=e-4
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
endif
|
||||
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
|
||||
@@ -317,6 +329,7 @@ hi def link htmlStatement Statement
|
||||
hi def link htmlComment Comment
|
||||
hi def link htmlCommentPart Comment
|
||||
hi def link htmlValue String
|
||||
hi def link htmlCommentNested htmlCommentError
|
||||
hi def link htmlCommentError htmlError
|
||||
hi def link htmlTagError htmlError
|
||||
hi def link htmlEvent javaScript
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
" Vim syntax file
|
||||
" Language: Haskell with literate comments, Bird style,
|
||||
" TeX style and plain text surrounding
|
||||
" Markdown style, TeX style and plain text surrounding
|
||||
" \begin{code} \end{code} blocks
|
||||
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
|
||||
" Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl>
|
||||
" Last Change: 2010 Apr 11
|
||||
" Version: 1.04
|
||||
" Last Change: 2020 Feb 25
|
||||
" Version: 1.05
|
||||
"
|
||||
" Thanks to Ian Lynagh for thoughtful comments on initial versions and
|
||||
" for the inspiration for writing this in the first place.
|
||||
@@ -44,8 +44,8 @@ endif
|
||||
" First off, see if we can inherit a user preference for lhs_markup
|
||||
if !exists("b:lhs_markup")
|
||||
if exists("lhs_markup")
|
||||
if lhs_markup =~ '\<\%(tex\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|none\)\>')
|
||||
if lhs_markup =~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|md\|none\)\>')
|
||||
else
|
||||
echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None
|
||||
let b:lhs_markup = "unknown"
|
||||
@@ -54,7 +54,7 @@ if !exists("b:lhs_markup")
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
else
|
||||
if b:lhs_markup !~ '\<\%(tex\|none\)\>'
|
||||
if b:lhs_markup !~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
endif
|
||||
@@ -74,6 +74,8 @@ call cursor(1,1)
|
||||
if b:lhs_markup == "unknown"
|
||||
if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
|
||||
let b:lhs_markup = "tex"
|
||||
elseif search('```haskell','W') != 0
|
||||
let b:lhs_markup = "md"
|
||||
else
|
||||
let b:lhs_markup = "plain"
|
||||
endif
|
||||
@@ -86,6 +88,10 @@ if b:lhs_markup == "tex"
|
||||
" Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
|
||||
setlocal isk+=_
|
||||
syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
|
||||
elseif b:lhs_markup == "md"
|
||||
runtime! syntax/markdown.vim
|
||||
unlet b:current_syntax
|
||||
syntax cluster lhsTeXContainer contains=markdown.*
|
||||
else
|
||||
syntax cluster lhsTeXContainer contains=.*
|
||||
endif
|
||||
@@ -96,9 +102,12 @@ syntax include @haskellTop syntax/haskell.vim
|
||||
|
||||
syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellMDBlock start="^```haskell$" matchgroup=NONE end="^```$" keepend contains=@haskellTop,lhsMarkdownCode containedin=@lhsTeXContainer
|
||||
|
||||
syntax match lhsBirdTrack "^>" contained
|
||||
|
||||
syntax match lhsMarkdownCode "^\(```haskell\|^```\)$" contained
|
||||
|
||||
syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
|
||||
syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
@@ -107,6 +116,8 @@ syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
hi def link lhsBirdTrack Comment
|
||||
|
||||
hi def link lhsMarkdownCode Comment
|
||||
|
||||
hi def link beginCodeBegin texCmdName
|
||||
hi def link beginCodeCode texSection
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2016 Oct 29
|
||||
" Last Change: 2021 Feb 15
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
"
|
||||
@@ -71,30 +71,17 @@ endif
|
||||
|
||||
" Keep Python keywords in alphabetical order inside groups for easy
|
||||
" comparison with the table in the 'Python Language Reference'
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#keywords,
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#keywords.
|
||||
" https://docs.python.org/reference/lexical_analysis.html#keywords.
|
||||
" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
|
||||
" Exceptions come last at the end of each group (class and def below).
|
||||
"
|
||||
" Keywords 'with' and 'as' are new in Python 2.6
|
||||
" (use 'from __future__ import with_statement' in Python 2.5).
|
||||
" The list can be checked using:
|
||||
"
|
||||
" Some compromises had to be made to support both Python 3 and 2.
|
||||
" We include Python 3 features, but when a definition is duplicated,
|
||||
" the last definition takes precedence.
|
||||
"
|
||||
" - 'False', 'None', and 'True' are keywords in Python 3 but they are
|
||||
" built-ins in 2 and will be highlighted as built-ins below.
|
||||
" - 'exec' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below.
|
||||
" - 'nonlocal' is a keyword in Python 3 and will be highlighted.
|
||||
" - 'print' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below (use 'from __future__ import print_function' in 2)
|
||||
" - async and await were added in Python 3.5 and are soft keywords.
|
||||
" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist, compact=True)'
|
||||
"
|
||||
syn keyword pythonStatement False None True
|
||||
syn keyword pythonStatement as assert break continue del exec global
|
||||
syn keyword pythonStatement lambda nonlocal pass print return with yield
|
||||
syn keyword pythonStatement as assert break continue del global
|
||||
syn keyword pythonStatement lambda nonlocal pass return with yield
|
||||
syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
|
||||
syn keyword pythonConditional elif else if
|
||||
syn keyword pythonRepeat for while
|
||||
@@ -103,7 +90,7 @@ syn keyword pythonException except finally raise try
|
||||
syn keyword pythonInclude from import
|
||||
syn keyword pythonAsync async await
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
" Decorators
|
||||
" A dot must be allowed because of @MyClass.myfunc decorators.
|
||||
syn match pythonDecorator "@" display contained
|
||||
syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
|
||||
@@ -168,8 +155,7 @@ syn match pythonEscape "\\$"
|
||||
" - 08e0 or 08j are highlighted,
|
||||
"
|
||||
" and so on, as specified in the 'Python Language Reference'.
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/reference/lexical_analysis.html#numeric-literals
|
||||
if !exists("python_no_number_highlight")
|
||||
" numbers (including longs and complex)
|
||||
syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
|
||||
@@ -186,37 +172,37 @@ endif
|
||||
|
||||
" Group the built-ins in the order in the 'Python Library Reference' for
|
||||
" easier comparison.
|
||||
" https://docs.python.org/2/library/constants.html
|
||||
" https://docs.python.org/3/library/constants.html
|
||||
" http://docs.python.org/2/library/functions.html
|
||||
" http://docs.python.org/3/library/functions.html
|
||||
" http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
|
||||
" http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
|
||||
" https://docs.python.org/library/constants.html
|
||||
" http://docs.python.org/library/functions.html
|
||||
" Python built-in functions are in alphabetical order.
|
||||
"
|
||||
" The list can be checked using:
|
||||
"
|
||||
" python3 -c 'import builtins, pprint; pprint.pprint(dir(builtins), compact=True)'
|
||||
"
|
||||
" The constants added by the `site` module are not listed below because they
|
||||
" should not be used in programs, only in interactive interpreter.
|
||||
" Similarly for some other attributes and functions `__`-enclosed from the
|
||||
" output of the above command.
|
||||
"
|
||||
if !exists("python_no_builtin_highlight")
|
||||
" built-in constants
|
||||
" 'False', 'True', and 'None' are also reserved words in Python 3
|
||||
syn keyword pythonBuiltin False True None
|
||||
syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
|
||||
" constants added by the `site` module
|
||||
syn keyword pythonBuiltin quit exit copyright credits license
|
||||
" built-in functions
|
||||
syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
|
||||
syn keyword pythonBuiltin classmethod compile complex delattr dict dir
|
||||
syn keyword pythonBuiltin divmod enumerate eval filter float format
|
||||
syn keyword pythonBuiltin frozenset getattr globals hasattr hash
|
||||
syn keyword pythonBuiltin help hex id input int isinstance
|
||||
syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray
|
||||
syn keyword pythonBuiltin bytes callable chr classmethod compile complex
|
||||
syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec
|
||||
syn keyword pythonBuiltin filter float format frozenset getattr globals
|
||||
syn keyword pythonBuiltin hasattr hash help hex id input int isinstance
|
||||
syn keyword pythonBuiltin issubclass iter len list locals map max
|
||||
syn keyword pythonBuiltin memoryview min next object oct open ord pow
|
||||
syn keyword pythonBuiltin print property range repr reversed round set
|
||||
syn keyword pythonBuiltin setattr slice sorted staticmethod str
|
||||
syn keyword pythonBuiltin sum super tuple type vars zip __import__
|
||||
" Python 2 only
|
||||
syn keyword pythonBuiltin basestring cmp execfile file
|
||||
syn keyword pythonBuiltin long raw_input reduce reload unichr
|
||||
syn keyword pythonBuiltin unicode xrange
|
||||
" Python 3 only
|
||||
syn keyword pythonBuiltin ascii bytes exec
|
||||
" non-essential built-in functions; Python 2 only
|
||||
syn keyword pythonBuiltin apply buffer coerce intern
|
||||
syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super
|
||||
syn keyword pythonBuiltin tuple type vars zip __import__
|
||||
" avoid highlighting attributes as builtins
|
||||
syn match pythonAttribute /\.\h\w*/hs=s+1
|
||||
\ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync
|
||||
@@ -224,28 +210,27 @@ if !exists("python_no_builtin_highlight")
|
||||
endif
|
||||
|
||||
" From the 'Python Library Reference' class hierarchy at the bottom.
|
||||
" http://docs.python.org/2/library/exceptions.html
|
||||
" http://docs.python.org/3/library/exceptions.html
|
||||
" http://docs.python.org/library/exceptions.html
|
||||
if !exists("python_no_exception_highlight")
|
||||
" builtin base exceptions (used mostly as base classes for other exceptions)
|
||||
syn keyword pythonExceptions BaseException Exception
|
||||
syn keyword pythonExceptions ArithmeticError BufferError
|
||||
syn keyword pythonExceptions LookupError
|
||||
" builtin base exceptions removed in Python 3
|
||||
syn keyword pythonExceptions EnvironmentError StandardError
|
||||
syn keyword pythonExceptions ArithmeticError BufferError LookupError
|
||||
" builtin exceptions (actually raised)
|
||||
syn keyword pythonExceptions AssertionError AttributeError
|
||||
syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
|
||||
syn keyword pythonExceptions ImportError IndentationError
|
||||
syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
|
||||
syn keyword pythonExceptions MemoryError NameError NotImplementedError
|
||||
syn keyword pythonExceptions OSError OverflowError ReferenceError
|
||||
syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
|
||||
syn keyword pythonExceptions AssertionError AttributeError EOFError
|
||||
syn keyword pythonExceptions FloatingPointError GeneratorExit ImportError
|
||||
syn keyword pythonExceptions IndentationError IndexError KeyError
|
||||
syn keyword pythonExceptions KeyboardInterrupt MemoryError
|
||||
syn keyword pythonExceptions ModuleNotFoundError NameError
|
||||
syn keyword pythonExceptions NotImplementedError OSError OverflowError
|
||||
syn keyword pythonExceptions RecursionError ReferenceError RuntimeError
|
||||
syn keyword pythonExceptions StopAsyncIteration StopIteration SyntaxError
|
||||
syn keyword pythonExceptions SystemError SystemExit TabError TypeError
|
||||
syn keyword pythonExceptions UnboundLocalError UnicodeError
|
||||
syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
|
||||
syn keyword pythonExceptions UnboundLocalError UnicodeDecodeError
|
||||
syn keyword pythonExceptions UnicodeEncodeError UnicodeError
|
||||
syn keyword pythonExceptions UnicodeTranslateError ValueError
|
||||
syn keyword pythonExceptions ZeroDivisionError
|
||||
" builtin exception aliases for OSError
|
||||
syn keyword pythonExceptions EnvironmentError IOError WindowsError
|
||||
" builtin OS exceptions in Python 3
|
||||
syn keyword pythonExceptions BlockingIOError BrokenPipeError
|
||||
syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
|
||||
@@ -253,18 +238,13 @@ if !exists("python_no_exception_highlight")
|
||||
syn keyword pythonExceptions ConnectionResetError FileExistsError
|
||||
syn keyword pythonExceptions FileNotFoundError InterruptedError
|
||||
syn keyword pythonExceptions IsADirectoryError NotADirectoryError
|
||||
syn keyword pythonExceptions PermissionError ProcessLookupError
|
||||
syn keyword pythonExceptions RecursionError StopAsyncIteration
|
||||
syn keyword pythonExceptions TimeoutError
|
||||
" builtin exceptions deprecated/removed in Python 3
|
||||
syn keyword pythonExceptions IOError VMSError WindowsError
|
||||
syn keyword pythonExceptions PermissionError ProcessLookupError TimeoutError
|
||||
" builtin warnings
|
||||
syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
|
||||
syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
|
||||
syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
|
||||
syn keyword pythonExceptions ResourceWarning RuntimeWarning
|
||||
syn keyword pythonExceptions SyntaxWarning UnicodeWarning
|
||||
syn keyword pythonExceptions UserWarning Warning
|
||||
" builtin warnings in Python 3
|
||||
syn keyword pythonExceptions ResourceWarning
|
||||
endif
|
||||
|
||||
if exists("python_space_error_highlight")
|
||||
|
||||
Reference in New Issue
Block a user