vim-patch:4c295027a426

Update runtime files
4c295027a4
This commit is contained in:
Jan Edmund Lazo
2021-05-02 12:55:08 -04:00
parent d19ede86ea
commit ad6bb386be
14 changed files with 333 additions and 118 deletions

View File

@ -1,12 +1,16 @@
" Vim completion script " Vim completion script
" Language: All languages, uses existing syntax highlighting rules " Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 14.0 " Version: 15.0
" Last Change: 2020 Dec 30 " Last Change: 2021 Apr 27
" Usage: For detailed help, ":help ft-syntax-omni" " Usage: For detailed help, ":help ft-syntax-omni"
" History " History
" "
" Version 15.0
" - SyntaxComplete ignored all buffer specific overrides, always used global
" https://github.com/vim/vim/issues/8153
"
" Version 14.0 " Version 14.0
" - Fixed issue with single quotes and is_keyword " - Fixed issue with single quotes and is_keyword
" https://github.com/vim/vim/issues/7463 " https://github.com/vim/vim/issues/7463
@ -42,7 +46,7 @@
" let g:omni_syntax_use_single_byte = 1 " let g:omni_syntax_use_single_byte = 1
" - This by default will only allow single byte ASCII " - This by default will only allow single byte ASCII
" characters to be added and an additional check to ensure " characters to be added and an additional check to ensure
" the charater is printable (see documentation for isprint). " the character is printable (see documentation for isprint).
" "
" Version 9.0 " Version 9.0
" - Add the check for cpo. " - Add the check for cpo.
@ -90,7 +94,7 @@ endif
if exists('g:loaded_syntax_completion') if exists('g:loaded_syntax_completion')
finish finish
endif endif
let g:loaded_syntax_completion = 130 let g:loaded_syntax_completion = 150
" Turn on support for line continuations when creating the script " Turn on support for line continuations when creating the script
let s:cpo_save = &cpo let s:cpo_save = &cpo
@ -145,14 +149,10 @@ let s:prepended = ''
" This function is used for the 'omnifunc' option. " This function is used for the 'omnifunc' option.
function! syntaxcomplete#Complete(findstart, base) function! syntaxcomplete#Complete(findstart, base)
" Only display items in the completion window that are at least " Allow user to override ignorecase per buffer
" this many characters in length let l:omni_syntax_ignorecase = g:omni_syntax_ignorecase
if !exists('b:omni_syntax_ignorecase') if exists('b:omni_syntax_ignorecase')
if exists('g:omni_syntax_ignorecase') let l:omni_syntax_ignorecase = b:omni_syntax_ignorecase
let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
else
let b:omni_syntax_ignorecase = &ignorecase
endif
endif endif
if a:findstart if a:findstart
@ -183,7 +183,6 @@ function! syntaxcomplete#Complete(findstart, base)
endif endif
" let base = s:prepended . a:base " let base = s:prepended . a:base
" let base = s:prepended
let base = substitute(s:prepended, "'", "''", 'g') let base = substitute(s:prepended, "'", "''", 'g')
let filetype = substitute(&filetype, '\.', '_', 'g') let filetype = substitute(&filetype, '\.', '_', 'g')
@ -200,13 +199,13 @@ function! syntaxcomplete#Complete(findstart, base)
if base != '' if base != ''
" let compstr = join(compl_list, ' ') " let compstr = join(compl_list, ' ')
" let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' " let expr = (l:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let compstr = substitute(compstr, expr, '', 'g') " let compstr = substitute(compstr, expr, '', 'g')
" let compl_list = split(compstr, '\s\+') " let compl_list = split(compstr, '\s\+')
" Filter the list based on the first few characters the user " Filter the list based on the first few characters the user
" entered " entered
let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'" let expr = 'v:val '.(l:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let compl_list = filter(deepcopy(compl_list), expr) let compl_list = filter(deepcopy(compl_list), expr)
endif endif
@ -227,6 +226,26 @@ function! syntaxcomplete#OmniSyntaxList(...)
endif endif
endfunc endfunc
function! syntaxcomplete#OmniSyntaxClearCache()
let s:cache_name = []
let s:cache_list = []
endfunction
" To retrieve all syntax items regardless of syntax group:
" echo OmniSyntaxList( [] )
"
" To retrieve only the syntax items for the sqlOperator syntax group:
" echo OmniSyntaxList( ['sqlOperator'] )
"
" To retrieve all syntax items for both the sqlOperator and sqlType groups:
" echo OmniSyntaxList( ['sqlOperator', 'sqlType'] )
"
" A regular expression can also be used:
" echo OmniSyntaxList( ['sql\w\+'] )
"
" From within a plugin, you would typically assign the output to a List: >
" let myKeywords = []
" let myKeywords = OmniSyntaxList( ['sqlKeyword'] )
function! OmniSyntaxList(...) function! OmniSyntaxList(...)
let list_parms = [] let list_parms = []
if a:0 > 0 if a:0 > 0
@ -244,37 +263,25 @@ function! OmniSyntaxList(...)
" let use_dictionary = a:1 " let use_dictionary = a:1
" endif " endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_use_iskeyword')
if exists('g:omni_syntax_use_iskeyword')
let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
else
let b:omni_syntax_use_iskeyword = 1
endif
endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_minimum_length')
if exists('g:omni_syntax_minimum_length')
let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
else
let b:omni_syntax_minimum_length = 0
endif
endif
let saveL = @l let saveL = @l
let filetype = substitute(&filetype, '\.', '_', 'g') let filetype = substitute(&filetype, '\.', '_', 'g')
if empty(list_parms) if empty(list_parms)
" Allow user to override per buffer
if exists('g:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = g:omni_syntax_group_include_{filetype}
endif
if exists('b:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = b:omni_syntax_group_include_{filetype}
endif
" Default the include group to include the requested syntax group " Default the include group to include the requested syntax group
let syntax_group_include_{filetype} = '' let syntax_group_include_{filetype} = ''
" Check if there are any overrides specified for this filetype " Check if there are any overrides specified for this filetype
if exists('g:omni_syntax_group_include_'.filetype) if exists('l:omni_syntax_group_include_'.filetype)
let syntax_group_include_{filetype} = let syntax_group_include_{filetype} =
\ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g') \ substitute( l:omni_syntax_group_include_{filetype},'\s\+','','g')
let list_parms = split(g:omni_syntax_group_include_{filetype}, ',') let list_parms = split(l:omni_syntax_group_include_{filetype}, ',')
if syntax_group_include_{filetype} =~ '\w' if syntax_group_include_{filetype} =~ '\w'
let syntax_group_include_{filetype} = let syntax_group_include_{filetype} =
\ substitute( syntax_group_include_{filetype}, \ substitute( syntax_group_include_{filetype},
@ -329,11 +336,20 @@ function! OmniSyntaxList(...)
else else
" Default the exclude group to nothing " Default the exclude group to nothing
let syntax_group_exclude_{filetype} = '' let syntax_group_exclude_{filetype} = ''
" Check if there are any overrides specified for this filetype
" Allow user to override per buffer
if exists('g:omni_syntax_group_exclude_'.filetype) if exists('g:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = g:omni_syntax_group_exclude_{filetype}
endif
if exists('b:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = b:omni_syntax_group_exclude_{filetype}
endif
" Check if there are any overrides specified for this filetype
if exists('l:omni_syntax_group_exclude_'.filetype)
let syntax_group_exclude_{filetype} = let syntax_group_exclude_{filetype} =
\ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g') \ substitute( l:omni_syntax_group_exclude_{filetype},'\s\+','','g')
let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',') let list_exclude_groups = split(l:omni_syntax_group_exclude_{filetype}, ',')
if syntax_group_exclude_{filetype} =~ '\w' if syntax_group_exclude_{filetype} =~ '\w'
let syntax_group_exclude_{filetype} = let syntax_group_exclude_{filetype} =
\ substitute( syntax_group_exclude_{filetype}, \ substitute( syntax_group_exclude_{filetype},
@ -529,6 +545,30 @@ endfunction
function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" Allow user to override iskeyword per buffer
let l:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
if exists('b:omni_syntax_use_iskeyword')
let l:omni_syntax_use_iskeyword = b:omni_syntax_use_iskeyword
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_iskeyword_numeric = g:omni_syntax_use_iskeyword_numeric
if exists('b:omni_syntax_use_iskeyword_numeric')
let l:omni_syntax_use_iskeyword_numeric = b:omni_syntax_use_iskeyword_numeric
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_single_byte = g:omni_syntax_use_single_byte
if exists('b:omni_syntax_use_single_byte')
let l:omni_syntax_use_single_byte = b:omni_syntax_use_single_byte
endif
" Allow user to override minimum_length per buffer
let l:omni_syntax_minimum_length = g:omni_syntax_minimum_length
if exists('b:omni_syntax_minimum_length')
let l:omni_syntax_minimum_length = b:omni_syntax_minimum_length
endif
let syn_list = "" let syn_list = ""
" From the full syntax listing, strip out the portion for the " From the full syntax listing, strip out the portion for the
@ -647,14 +687,23 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
\ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)' \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)'
\ , "", 'g' \ , "", 'g'
\ ) \ )
if b:omni_syntax_use_iskeyword == 0 if l:omni_syntax_use_iskeyword == 0
" There are a number of items which have non-word characters in " There are a number of items which have non-word characters in
" them, *'T_F1'*. vim.vim is one such file. " them, *'T_F1'*. vim.vim is one such file.
" This will replace non-word characters with spaces. " This will replace non-word characters with spaces.
" setlocal filetype=forth
" let g:omni_syntax_use_iskeyword = 1
" let g:omni_syntax_use_iskeyword_numeric = 1
" You will see entries like
" #>>
" (.local)
" These were found doing a grep in vim82\syntax
" grep iskeyword *
" forth.vim:setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' ) let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
else else
if g:omni_syntax_use_iskeyword_numeric == 1 if l:omni_syntax_use_iskeyword_numeric == 1
" iskeyword can contain value like this " iskeyword can contain value like this
" 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 " 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
" Numeric values convert to their ASCII equivalent using the " Numeric values convert to their ASCII equivalent using the
@ -674,7 +723,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" cycle through each character within the range " cycle through each character within the range
let [b:start, b:end] = split(item, '-') let [b:start, b:end] = split(item, '-')
for range_item in range( b:start, b:end ) for range_item in range( b:start, b:end )
if range_item <= 127 || g:omni_syntax_use_single_byte == 0 if range_item <= 127 || l:omni_syntax_use_single_byte == 0
if nr2char(range_item) =~ '\p' if nr2char(range_item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(range_item) let accepted_chars = accepted_chars . nr2char(range_item)
endif endif
@ -682,13 +731,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endfor endfor
elseif item =~ '^\d\+$' elseif item =~ '^\d\+$'
" Only numeric, translate to a character " Only numeric, translate to a character
if item < 127 || g:omni_syntax_use_single_byte == 0 if item < 127 || l:omni_syntax_use_single_byte == 0
if nr2char(item) =~ '\p' if nr2char(item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(item) let accepted_chars = accepted_chars . nr2char(item)
endif endif
endif endif
else else
if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0 if char2nr(item) < 127 || l:omni_syntax_use_single_byte == 0
if item =~ '\p' if item =~ '\p'
let accepted_chars = accepted_chars . item let accepted_chars = accepted_chars . item
endif endif
@ -724,9 +773,9 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endif endif
endif endif
if b:omni_syntax_minimum_length > 0 if l:omni_syntax_minimum_length > 0
" If the user specified a minimum length, enforce it " If the user specified a minimum length, enforce it
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g') let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.l:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
endif endif
else else
let syn_list = '' let syn_list = ''
@ -756,5 +805,6 @@ function! OmniSyntaxShowChars(spec)
endfor endfor
return join(map(result, 'nr2char(v:val)'), ', ') return join(map(result, 'nr2char(v:val)'), ', ')
endfunction endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

@ -1272,7 +1272,14 @@ option will not cause any commands to be executed.
loaded buffer. The current buffer is done last. loaded buffer. The current buffer is done last.
Note that [fname] is used to select the autocommands, Note that [fname] is used to select the autocommands,
not the buffers to which they are applied. not the buffers to which they are applied. Example: >
augroup mine
autocmd!
autocmd FileType * echo expand('<amatch>')
augroup END
doautoall mine FileType Loaded-Buffer
< Sourcing this script, you'll see as many
"Loaded-Buffer" echoed as there are loaded buffers.
Careful: Don't use this for autocommands that delete a Careful: Don't use this for autocommands that delete a
buffer, change to another buffer or change the buffer, change to another buffer or change the

View File

@ -1677,6 +1677,9 @@ v:fcs_choice What should happen after a |FileChangedShell| event was
The default is empty. If another (invalid) value is used then The default is empty. If another (invalid) value is used then
Vim behaves like it is empty, there is no warning message. Vim behaves like it is empty, there is no warning message.
*v:fname* *fname-variable*
v:fname The file name set by 'includeexpr'. Empty otherwise.
*v:fname_in* *fname_in-variable* *v:fname_in* *fname_in-variable*
v:fname_in The name of the input file. Valid while evaluating: v:fname_in The name of the input file. Valid while evaluating:
option used for ~ option used for ~

View File

@ -247,6 +247,11 @@ expression register: >
:amenu Insert.foobar "='foobar'<CR>P :amenu Insert.foobar "='foobar'<CR>P
The special text <Cmd> begins a "command menu", it executes the command
directly without changing modes. Where you might use ":...<CR>" you can
instead use "<Cmd>...<CR>". See |<Cmd>| for more info. Example: >
anoremenu File.Next <Cmd>next<CR>
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
is Vi compatible. Use CTRL-C to quit Cmdline mode. is Vi compatible. Use CTRL-C to quit Cmdline mode.

View File

@ -223,9 +223,12 @@ have a look at |maparg()|.
If the first argument to one of these commands is "<expr>" and it is used to If the first argument to one of these commands is "<expr>" and it is used to
define a new mapping or abbreviation, the argument is an expression. The define a new mapping or abbreviation, the argument is an expression. The
expression is evaluated to obtain the {rhs} that is used. Example: > expression is evaluated to obtain the {rhs} that is used. Example: >
:inoremap <expr> . InsertDot() :inoremap <expr> . <SID>InsertDot()
The result of the InsertDot() function will be inserted. It could check the The result of the s:InsertDot() function will be inserted. It could check the
text before the cursor and start omni completion when some condition is met. text before the cursor and start omni completion when some condition is met.
Using a script-local function is preferred, to avoid polluting the global
namespace. Use <SID> in the RHS so that the script that the mapping was
defined in can be found.
For abbreviations |v:char| is set to the character that was typed to trigger For abbreviations |v:char| is set to the character that was typed to trigger
the abbreviation. You can use this to decide how to expand the {lhs}. You the abbreviation. You can use this to decide how to expand the {lhs}. You

View File

@ -3429,7 +3429,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Keywords are used in searching and recognizing with many commands: Keywords are used in searching and recognizing with many commands:
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
'isfname' for a description of the format of this option. For '@' 'isfname' for a description of the format of this option. For '@'
characters above 255 check the "word" character class. characters above 255 check the "word" character class (any character
that is not white space or punctuation).
For C programs you could use "a-z,A-Z,48-57,_,.,-,>". For C programs you could use "a-z,A-Z,48-57,_,.,-,>".
For a help file it is set to all non-blank printable characters except For a help file it is set to all non-blank printable characters except
'*', '"' and '|' (so that CTRL-] on a command finds the help for that '*', '"' and '|' (so that CTRL-] on a command finds the help for that

View File

@ -994,8 +994,6 @@ commands can be combined to create a NewGrep command: >
the error list to the matches. Files matching the error list to the matches. Files matching
'wildignore' are ignored; files in 'suffixes' are 'wildignore' are ignored; files in 'suffixes' are
searched last. searched last.
Without the 'g' flag each line is added only once.
With 'g' every match is added.
{pattern} is a Vim search pattern. Instead of {pattern} is a Vim search pattern. Instead of
enclosing it in / any non-ID character (see enclosing it in / any non-ID character (see
@ -1007,6 +1005,22 @@ commands can be combined to create a NewGrep command: >
If {pattern} is empty (e.g. // is specified), the last If {pattern} is empty (e.g. // is specified), the last
used search pattern is used. |last-pattern| used search pattern is used. |last-pattern|
Flags:
'g' Without the 'g' flag each line is added only
once. With 'g' every match is added.
'j' Without the 'j' flag Vim jumps to the first
match. With 'j' only the quickfix list is
updated. With the [!] any changes in the current
buffer are abandoned.
'f' When the 'f' flag is specified, fuzzy string
matching is used to find matching lines. In this
case, {pattern} is treated as a literal string
instead of a regular expression. See
|matchfuzzy()| for more info about fuzzy
matching.
|QuickFixCmdPre| and |QuickFixCmdPost| are triggered. |QuickFixCmdPre| and |QuickFixCmdPost| are triggered.
A file that is opened for matching may use a buffer A file that is opened for matching may use a buffer
number, but it is reused if possible to avoid number, but it is reused if possible to avoid
@ -1019,11 +1033,6 @@ commands can be combined to create a NewGrep command: >
Useful if you only want to check if there is a match Useful if you only want to check if there is a match
and quit quickly when it's found. and quit quickly when it's found.
Without the 'j' flag Vim jumps to the first match.
With 'j' only the quickfix list is updated.
With the [!] any changes in the current buffer are
abandoned.
Every second or so the searched file name is displayed Every second or so the searched file name is displayed
to give you an idea of the progress made. to give you an idea of the progress made.
Examples: > Examples: >

View File

@ -522,7 +522,7 @@ Summary: *help-summary* >
< for the corresponding flag of the 'cpoptions' settings, substitute <letter> < for the corresponding flag of the 'cpoptions' settings, substitute <letter>
by a specific flag, e.g.: > by a specific flag, e.g.: >
:help cpo-; :help cpo-;
< And for the guioption flags: > < And for the 'guioptions' flags: >
:help go-<letter> :help go-<letter>
4) Normal mode commands do not have a prefix. To go to the help page for the 4) Normal mode commands do not have a prefix. To go to the help page for the

View File

@ -0,0 +1,25 @@
" Vim filetype plugin file
" Language: Free Pascal Makefile Generator
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Apr 23
if exists("b:did_ftplugin")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
runtime! ftplugin/make.vim
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Free Pascal Makefile Definition Files (*.fpc)\t*.fpc\n" ..
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = b:undo_ftplugin .. " | unlet! b:browsefilter"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet:

View File

@ -1,20 +1,50 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: pascal " Language: Pascal
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Changed: 11 Apr 2011 " Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin " Last Change: 2021 Apr 23
if exists("b:did_ftplugin") | finish | endif if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
if exists("loaded_matchit") let s:cpo_save = &cpo
let b:match_ignorecase = 1 " (pascal is case-insensitive) set cpo&vim
let b:match_words = '\<\%(begin\|case\|record\|object\|try\)\>' set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:}
let b:match_words .= ':\<^\s*\%(except\|finally\)\>:\<end\>' set commentstring={%s}
let b:match_words .= ',\<repeat\>:\<until\>'
let b:match_words .= ',\<if\>:\<else\>' if exists("pascal_delphi")
set comments+=:///
endif endif
" Undo the stuff we changed. if !exists("pascal_traditional")
let b:undo_ftplugin = "unlet! b:match_words" set commentstring=//\ %s
set comments+=://
endif
setlocal formatoptions-=t formatoptions+=croql
if exists("loaded_matchit")
let b:match_ignorecase = 1 " (Pascal is case-insensitive)
let b:match_words = '\<\%(asm\|begin\|case\|\%(\%(=\|packed\)\s*\)\@<=\%(class\|object\)\|\%(=\s*\)\@<=interface\|record\|try\)\>'
let b:match_words .= ':\%(^\s*\)\@<=\%(except\|finally\|else\|otherwise\)\>'
let b:match_words .= ':\<end\>\.\@!'
let b:match_words .= ',\<repeat\>:\<until\>'
" let b:match_words .= ',\<if\>:\<else\>' " FIXME - else clashing with middle else. It seems like a debatable use anyway.
let b:match_words .= ',\<unit\>:\<\%(\%(^\s*\)\@<=interface\|implementation\|initialization\|finalization\)\>:\<end\.'
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Pascal Source Files (*.pas *.pp *.inc)\t*.pas;*.pp;*.inc\n" .
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = "setl fo< cms< com< " ..
\ "| unlet! b:browsefilter b:match_words b:match_ignorecase"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet:

View File

@ -20,8 +20,8 @@ let s:comment_rx = '^\s*#'
let s:rule_rx = '^[^ \t#:][^#:]*:\{1,2}\%([^=:]\|$\)' let s:rule_rx = '^[^ \t#:][^#:]*:\{1,2}\%([^=:]\|$\)'
let s:continued_rule_rx = '^[^#:]*:\{1,2}\%([^=:]\|$\)' let s:continued_rule_rx = '^[^#:]*:\{1,2}\%([^=:]\|$\)'
let s:continuation_rx = '\\$' let s:continuation_rx = '\\$'
let s:assignment_rx = '^\s*\h\w*\s*[+?]\==\s*\zs.*\\$' let s:assignment_rx = '^\s*\h\w*\s*[+:?]\==\s*\zs.*\\$'
let s:folded_assignment_rx = '^\s*\h\w*\s*[+?]\==' let s:folded_assignment_rx = '^\s*\h\w*\s*[+:?]\=='
" TODO: This needs to be a lot more restrictive in what it matches. " TODO: This needs to be a lot more restrictive in what it matches.
let s:just_inserted_rule_rx = '^\s*[^#:]\+:\{1,2}$' let s:just_inserted_rule_rx = '^\s*[^#:]\+:\{1,2}$'
let s:conditional_directive_rx = '^ *\%(ifn\=\%(eq\|def\)\|else\)\>' let s:conditional_directive_rx = '^ *\%(ifn\=\%(eq\|def\)\|else\)\>'

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: generic configure file " Language: generic configure file
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jun 20 " Last Change: 2021 May 01
" Quit when a (custom) syntax file was already loaded " Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -10,8 +10,8 @@ endif
syn keyword confTodo contained TODO FIXME XXX syn keyword confTodo contained TODO FIXME XXX
" Avoid matching "text#text", used in /etc/disktab and /etc/gettytab " Avoid matching "text#text", used in /etc/disktab and /etc/gettytab
syn match confComment "^#.*" contains=confTodo syn match confComment "^#.*" contains=confTodo,@Spell
syn match confComment "\s#.*"ms=s+1 contains=confTodo syn match confComment "\s#.*"ms=s+1 contains=confTodo,@Spell
syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline

View File

@ -0,0 +1,58 @@
" Vim syntax file
" Language: Free Pascal Makefile Definition Files
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Apr 23
if exists("b:current_syntax")
finish
endif
runtime! syntax/make.vim
" NOTE: using start-of-line anchored syn-match groups is simpler than other
" alternatives when interacting with the sourced make.vim syntax groups
" Sections
syn region fpcmakeSection matchgroup=fpcmakeSectionDelimiter start="^\s*\[" end="]" contains=fpcmakeSectionName
syn keyword fpcmakeSectionName contained clean compiler default dist install
syn keyword fpcmakeSectionName contained lib package prerules require rules
syn keyword fpcmakeSectionName contained shared target
" [clean]
syn match fpcmakeRule "^\s*\(units\|files\)\>"
" [compiler]
syn match fpcmakeRule "^\s*\(options\|version\|unitdir\|librarydir\|objectdir\)\>"
syn match fpcmakeRule "^\s*\(targetdir\|sourcedir\|unittargetdir\|includedir\)\>"
" [default]
syn match fpcmakeRule "^\s*\(cpu\|dir\|fpcdir\|rule\|target\)\>"
" [dist]
syn match fpcmakeRule "^\s*\(destdir\|zipname\|ziptarget\)\>"
" [install]
syn match fpcmakeRule "^\s*\(basedir\|datadir\|fpcpackage\|files\|prefix\)\>"
syn match fpcmakeRule "^\s*\(units\)\>"
" [package]
syn match fpcmakeRule "^\s*\(name\|version\|main\)\>"
" [requires]
syn match fpcmakeRule "^\s*\(fpcmake\|packages\|libc\|nortl\|unitdir\)\>"
syn match fpcmakeRule "^\s*\(packagedir\|tools\)\>"
" [shared]
syn match fpcmakeRule "^\s*\(build\|libname\|libversion\|libunits\)\>"
" [target]
syn match fpcmakeRule "^\s*\(dirs\|exampledirs\|examples\|loaders\|programs\)\>"
syn match fpcmakeRule "^\s*\(rsts\|units\)\>"
" Comments
syn keyword fpcmakeTodo TODO FIXME XXX contained
syn match fpcmakeComment "#.*" contains=fpcmakeTodo,@Spell
" Default highlighting
hi def link fpcmakeSectionDelimiter Delimiter
hi def link fpcmakeSectionName Type
hi def link fpcmakeComment Comment
hi def link fpcmakeTodo Todo
hi def link fpcmakeRule Identifier
let b:current_syntax = "fpcmake"
" vim: nowrap sw=2 sts=2 ts=8 noet:

View File

@ -1,16 +1,16 @@
" Vim syntax file " Vim syntax file
" Language: Pascal " Language: Pascal
" Version: 2.8 " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2004/10/17 17:47:30 " Previous Maintainers: Xavier Crégut <xavier.cregut@enseeiht.fr>
" Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr> " Mario Eusebio <bio@dq.fct.unl.pt>
" Previous Maintainer: Mario Eusebio <bio@dq.fct.unl.pt> " Last Change: 2021 Apr 23
" Contributors: Tim Chase <tchase@csc.com>, " Contributors: Tim Chase <tchase@csc.com>,
" Stas Grabois <stsi@vtrails.com>, " Stas Grabois <stsi@vtrails.com>,
" Mazen NEIFER <mazen.neifer.2001@supaero.fr>, " Mazen NEIFER <mazen.neifer.2001@supaero.fr>,
" Klaus Hast <Klaus.Hast@arcor.net>, " Klaus Hast <Klaus.Hast@arcor.net>,
" Austin Ziegler <austin@halostatue.ca>, " Austin Ziegler <austin@halostatue.ca>,
" Markus Koenig <markus@stber-koenig.de> " Markus Koenig <markus@stber-koenig.de>
" quit when a syntax file was already loaded " quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -25,10 +25,10 @@ syn keyword pascalBoolean true false
syn keyword pascalConditional if else then syn keyword pascalConditional if else then
syn keyword pascalConstant nil maxint syn keyword pascalConstant nil maxint
syn keyword pascalLabel case goto label syn keyword pascalLabel case goto label
syn keyword pascalOperator and div downto in mod not of or packed with syn keyword pascalOperator and div downto in mod not of or packed
syn keyword pascalRepeat do for do repeat while to until syn keyword pascalRepeat do for do repeat while to until
syn keyword pascalStatement procedure function syn keyword pascalStatement procedure function
syn keyword pascalStatement program begin end const var type syn keyword pascalStatement program begin end const var type with
syn keyword pascalStruct record syn keyword pascalStruct record
syn keyword pascalType array boolean char integer file pointer real set syn keyword pascalType array boolean char integer file pointer real set
syn keyword pascalType string text variant syn keyword pascalType string text variant
@ -40,12 +40,12 @@ syn keyword pascalTodo contained TODO FIXME XXX DEBUG NOTE
" 20010723az: When wanted, highlight the trailing whitespace -- this is " 20010723az: When wanted, highlight the trailing whitespace -- this is
" based on c_space_errors; to enable, use "pascal_space_errors". " based on c_space_errors; to enable, use "pascal_space_errors".
if exists("pascal_space_errors") if exists("pascal_space_errors")
if !exists("pascal_no_trail_space_error") if !exists("pascal_no_trail_space_error")
syn match pascalSpaceError "\s\+$" syn match pascalSpaceError "\s\+$"
endif endif
if !exists("pascal_no_tab_space_error") if !exists("pascal_no_tab_space_error")
syn match pascalSpaceError " \+\t"me=e-1 syn match pascalSpaceError " \+\t"me=e-1
endif endif
endif endif
@ -98,9 +98,24 @@ if exists("pascal_symbol_operator")
endif endif
syn match pascalNumber "-\=\<\d\+\>" syn match pascalNumber "-\=\<\d\+\>"
if !exists("pascal_traditional")
syn match pascalHexNumber "\$\x\+\>"
endif
if exists("pascal_fpc")
syn match pascalOctNumber "&\o\+\>"
syn match pascalBinNumber "%[01]\+\>"
endif
if exists("pascal_gpc")
syn match pascalExtendedNumber "\%([2-9]\|[12]\d\|3[0-6]\)#[[:alnum:]]\+\>"
endif
syn match pascalFloat "-\=\<\d\+\.\d\+\>" syn match pascalFloat "-\=\<\d\+\.\d\+\>"
syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>" syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>"
syn match pascalHexNumber "\$[0-9a-fA-F]\+\>"
if !exists("pascal_traditional")
" allow leading zeros
syn match pascalControlCharacter "#\%([01]\=\d\=\d\|2[0-4]\d\|25[0-5]\)\>"
endif
if exists("pascal_no_tabs") if exists("pascal_no_tabs")
syn match pascalShowTab "\t" syn match pascalShowTab "\t"
@ -142,7 +157,7 @@ if !exists("pascal_traditional")
syn keyword pascalStatement interface unit uses syn keyword pascalStatement interface unit uses
syn keyword pascalModifier absolute assembler external far forward inline syn keyword pascalModifier absolute assembler external far forward inline
syn keyword pascalModifier interrupt near virtual syn keyword pascalModifier interrupt near virtual
syn keyword pascalAcces private public syn keyword pascalAccess private public strict
syn keyword pascalStruct object syn keyword pascalStruct object
syn keyword pascalOperator shl shr xor syn keyword pascalOperator shl shr xor
@ -157,6 +172,7 @@ if !exists("pascal_traditional")
syn keyword pascalType Single Double Extended Comp syn keyword pascalType Single Double Extended Comp
syn keyword pascalType PChar syn keyword pascalType PChar
syn keyword pascalPredefined self
if !exists ("pascal_fpc") if !exists ("pascal_fpc")
syn keyword pascalPredefined Result syn keyword pascalPredefined Result
@ -166,11 +182,11 @@ if !exists("pascal_traditional")
syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
syn keyword pascalStatement fail otherwise operator syn keyword pascalStatement fail otherwise operator
syn keyword pascalDirective popstack syn keyword pascalDirective popstack
syn keyword pascalPredefined self
syn keyword pascalType ShortString AnsiString WideString syn keyword pascalType ShortString AnsiString WideString
endif endif
if exists("pascal_gpc") if exists("pascal_gpc")
syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
syn keyword pascalType SmallInt syn keyword pascalType SmallInt
syn keyword pascalType AnsiChar syn keyword pascalType AnsiChar
syn keyword pascalType PAnsiChar syn keyword pascalType PAnsiChar
@ -178,6 +194,8 @@ if !exists("pascal_traditional")
if exists("pascal_delphi") if exists("pascal_delphi")
syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
syn region pascalDocumentation start="///" end="$" contains=pascalTodo,pascalSpaceError
syn region pascalDocumentation start="{!" end="}" contains=pascalTodo,pascalSpaceError
syn keyword pascalType SmallInt Int64 syn keyword pascalType SmallInt Int64
syn keyword pascalType Real48 Currency syn keyword pascalType Real48 Currency
syn keyword pascalType AnsiChar WideChar syn keyword pascalType AnsiChar WideChar
@ -192,11 +210,11 @@ if !exists("pascal_traditional")
syn keyword pascalStatement initialization finalization uses exports syn keyword pascalStatement initialization finalization uses exports
syn keyword pascalStatement property out resourcestring threadvar syn keyword pascalStatement property out resourcestring threadvar
syn keyword pascalModifier contains syn keyword pascalModifier contains
syn keyword pascalModifier overridden reintroduce abstract syn keyword pascalModifier overridden reintroduce abstract sealed
syn keyword pascalModifier override export dynamic name message syn keyword pascalModifier override export dynamic name message
syn keyword pascalModifier dispid index stored default nodefault readonly syn keyword pascalModifier dispid index stored default nodefault readonly
syn keyword pascalModifier writeonly implements overload requires resident syn keyword pascalModifier writeonly implements overload requires resident
syn keyword pascalAcces protected published automated syn keyword pascalAccess protected published automated
syn keyword pascalDirective register pascal cvar cdecl stdcall safecall syn keyword pascalDirective register pascal cvar cdecl stdcall safecall
syn keyword pascalOperator as is syn keyword pascalOperator as is
endif endif
@ -319,37 +337,43 @@ endif
" Define the default highlighting. " Define the default highlighting.
" Only when an item doesn't have highlighting yet " Only when an item doesn't have highlighting yet
hi def link pascalAcces pascalStatement hi def link pascalAccess pascalStatement
hi def link pascalBoolean Boolean hi def link pascalBoolean Boolean
hi def link pascalComment Comment hi def link pascalComment Comment
hi def link pascalConditional Conditional hi def link pascalDocumentation Comment
hi def link pascalConditional Conditional
hi def link pascalConstant Constant hi def link pascalConstant Constant
hi def link pascalDelimiter Identifier hi def link pascalControlCharacter Character
hi def link pascalDirective pascalStatement hi def link pascalDelimiter Identifier
hi def link pascalException Exception hi def link pascalDirective pascalStatement
hi def link pascalFloat Float hi def link pascalException Exception
hi def link pascalFloat Float
hi def link pascalFunction Function hi def link pascalFunction Function
hi def link pascalLabel Label hi def link pascalLabel Label
hi def link pascalMatrixDelimiter Identifier hi def link pascalMatrixDelimiter Identifier
hi def link pascalModifier Type hi def link pascalModifier Type
hi def link pascalNumber Number hi def link pascalNumber Number
hi def link pascalExtendedNumber Number
hi def link pascalBinNumber pascalNumber
hi def link pascalHexNumber pascalNumber
hi def link pascalOctNumber pascalNumber
hi def link pascalOperator Operator hi def link pascalOperator Operator
hi def link pascalPredefined pascalStatement hi def link pascalPredefined pascalStatement
hi def link pascalPreProc PreProc hi def link pascalPreProc PreProc
hi def link pascalRepeat Repeat hi def link pascalRepeat Repeat
hi def link pascalSpaceError Error hi def link pascalSpaceError Error
hi def link pascalStatement Statement hi def link pascalStatement Statement
hi def link pascalString String hi def link pascalString String
hi def link pascalStringEscape Special hi def link pascalStringEscape Special
hi def link pascalStringEscapeGPC Special hi def link pascalStringEscapeGPC Special
hi def link pascalStringError Error hi def link pascalStringError Error
hi def link pascalStruct pascalStatement hi def link pascalStruct pascalStatement
hi def link pascalSymbolOperator pascalOperator hi def link pascalSymbolOperator pascalOperator
hi def link pascalTodo Todo hi def link pascalTodo Todo
hi def link pascalType Type hi def link pascalType Type
hi def link pascalUnclassified pascalStatement hi def link pascalUnclassified pascalStatement
" hi def link pascalAsm Assembler " hi def link pascalAsm Assembler
hi def link pascalError Error hi def link pascalError Error
hi def link pascalAsmKey pascalStatement hi def link pascalAsmKey pascalStatement
hi def link pascalShowTab Error hi def link pascalShowTab Error
@ -357,4 +381,4 @@ hi def link pascalShowTab Error
let b:current_syntax = "pascal" let b:current_syntax = "pascal"
" vim: ts=8 sw=2 " vim: nowrap sw=2 sts=2 ts=8 noet: