From 43fe335eda6c9f0ef231777aa03836a402d50668 Mon Sep 17 00:00:00 2001 From: David Barnett Date: Mon, 18 Apr 2016 21:12:05 -0700 Subject: [PATCH] vim-patch:60cce2f Update runtime files. https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d --- runtime/autoload/tohtml.vim | 4 +- runtime/doc/syntax.txt | 41 ++++++++++----- runtime/filetype.vim | 8 ++- runtime/ftplugin/bzl.vim | 94 ++++++++++++++++++++++++++++++++++ runtime/ftplugin/j.vim | 13 +++-- runtime/ftplugin/systemd.vim | 7 +++ runtime/indent/bzl.vim | 97 ++++++++++++++++++++++++++++++++++++ runtime/indent/systemd.vim | 10 ++++ runtime/plugin/tohtml.vim | 35 +++++++------ runtime/syntax/2html.vim | 8 ++- runtime/syntax/bzl.vim | 16 ++++++ runtime/syntax/cmake.vim | 6 +-- runtime/syntax/dnsmasq.vim | 9 +++- runtime/syntax/sh.vim | 51 ++++++++++--------- runtime/syntax/systemd.vim | 8 +++ runtime/syntax/vhdl.vim | 82 ++++++++++++++++++++++-------- 16 files changed, 402 insertions(+), 87 deletions(-) create mode 100644 runtime/ftplugin/bzl.vim create mode 100644 runtime/ftplugin/systemd.vim create mode 100644 runtime/indent/bzl.vim create mode 100644 runtime/indent/systemd.vim create mode 100644 runtime/syntax/bzl.vim create mode 100644 runtime/syntax/systemd.vim diff --git a/runtime/autoload/tohtml.vim b/runtime/autoload/tohtml.vim index 5cb23a6146..d972ad63fe 100644 --- a/runtime/autoload/tohtml.vim +++ b/runtime/autoload/tohtml.vim @@ -1,6 +1,6 @@ " Vim autoload file for the tohtml plugin. " Maintainer: Ben Fritz -" Last Change: 2013 Jun 19 +" Last Change: 2013 Sep 03 " " Additional contributors: " @@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{ else "{{{ let win_list = [] let buf_list = [] - windo | if &diff | call add(win_list, winbufnr(0)) | endif + windo if &diff | call add(win_list, winbufnr(0)) | endif let s:settings.whole_filler = 1 let g:html_diff_win_num = 0 for window in win_list diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 81e258f6be..1f392cd0b5 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2015 Aug 13 +*syntax.txt* For Vim version 7.4. Last change: 2015 Sep 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -417,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: > *:TOhtml* :[range]TOhtml The ":TOhtml" command is defined in a standard plugin. This command will source |2html.vim| for you. When a - range is given, set |g:html_start_line| and - |g:html_end_line| to the start and end of the range, - respectively. Default range is the entire buffer. + range is given, this command sets |g:html_start_line| + and |g:html_end_line| to the start and end of the + range, respectively. Default range is the entire + buffer. - If the current window is part of a |diff|, unless - |g:html_diff_one_file| is set, :TOhtml will convert - all windows which are part of the diff in the current - tab and place them side-by-side in a element - in the generated HTML. With |g:html_line_ids| you can - jump to lines in specific windows with (for example) - #W1L42 for line 42 in the first diffed window, or - #W3L87 for line 87 in the third. + If the current window is part of a |diff|, unless + |g:html_diff_one_file| is set, :TOhtml will convert + all windows which are part of the diff in the current + tab and place them side-by-side in a
element + in the generated HTML. With |g:html_line_ids| you can + jump to lines in specific windows with (for example) + #W1L42 for line 42 in the first diffed window, or + #W3L87 for line 87 in the third. Examples: > @@ -742,6 +743,22 @@ and UTF-32 instead, use: > Note that documents encoded in either UTF-32 or UTF-16 have known compatibility problems with some major browsers. + *g:html_font* +Default: "monospace" +You can specify the font or fonts used in the converted document using +g:html_font. If this option is set to a string, then the value will be +surrounded with single quotes. If this option is set to a list then each list +item is surrounded by single quotes and the list is joined with commas. Either +way, "monospace" is added as the fallback generic family name and the entire +result used as the font family (using CSS) or font face (if not using CSS). +Examples: > + + " font-family: 'Consolas', monospace; + :let g:html_font = "Consolas" + + " font-family: 'DejaVu Sans Mono', 'Consolas', monospace; + :let g:html_font = ["DejaVu Sans Mono", "Consolas"] +< *convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml* Default: 0. When 0, generate standard HTML 4.01 (strict when possible). diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6929efb510..757b9a0db7 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2015 Sep 22 +" Last Change: 2015 Oct 13 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -304,6 +304,9 @@ au BufNewFile,BufRead *.bl setf blank " Blkid cache file au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml +" Bazel (http://bazel.io) +autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl + " C or lpc au BufNewFile,BufRead *.c call s:FTlpc() @@ -2119,6 +2122,9 @@ au BufNewFile,BufRead *.cm setf voscm " Sysctl au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl +" Systemd unit files +au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd + " Synopsys Design Constraints au BufNewFile,BufRead *.sdc setf sdc diff --git a/runtime/ftplugin/bzl.vim b/runtime/ftplugin/bzl.vim new file mode 100644 index 0000000000..0296b0c0b8 --- /dev/null +++ b/runtime/ftplugin/bzl.vim @@ -0,0 +1,94 @@ +" Vim filetype plugin file +" Language: Bazel (http://bazel.io) +" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) +" Last Change: 2015 Aug 11 + +"" +" @section Introduction, intro +" Core settings for the bzl filetype, used for BUILD and *.bzl files for the +" Bazel build system (http://bazel.io/). + +if exists('b:did_ftplugin') + finish +endif + + +" Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force +" PEP8 conventions on every python file, but these conflict with Google's +" indentation guidelines. As a workaround, we explicitly source the system +" ftplugin, but save indentation settings beforehand and restore them after. +let s:save_expandtab = &l:expandtab +let s:save_shiftwidth = &l:shiftwidth +let s:save_softtabstop = &l:softtabstop +let s:save_tabstop = &l:tabstop + +" NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken +" for compatible mode. +let s:save_cpo = &cpo +set cpo&vim + +" Load base python ftplugin (also defines b:did_ftplugin). +source $VIMRUNTIME/ftplugin/python.vim + +" NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim. +setlocal comments=b:#,fb:- + +" Restore pre-existing indentation settings. +let &l:expandtab = s:save_expandtab +let &l:shiftwidth = s:save_shiftwidth +let &l:softtabstop = s:save_softtabstop +let &l:tabstop = s:save_tabstop + +setlocal formatoptions-=t + +" Make gf work with imports in BUILD files. +setlocal includeexpr=substitute(v:fname,'//','','') + +" Enable syntax-based folding, if specified. +if get(g:, 'ft_bzl_fold', 0) + setlocal foldmethod=syntax + setlocal foldtext=BzlFoldText() +endif + +if exists('*BzlFoldText') + finish +endif + +function BzlFoldText() abort + let l:start_num = nextnonblank(v:foldstart) + let l:end_num = prevnonblank(v:foldend) + + if l:end_num <= l:start_num + 1 + " If the fold is empty, don't print anything for the contents. + let l:content = '' + else + " Otherwise look for something matching the content regex. + " And if nothing matches, print an ellipsis. + let l:content = '...' + for l:line in getline(l:start_num + 1, l:end_num - 1) + let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$') + if !empty(l:content_match) + let l:content = l:content_match + break + endif + endfor + endif + + " Enclose content with start and end + let l:start_text = getline(l:start_num) + let l:end_text = substitute(getline(l:end_num), '^\s*', '', '') + let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text + + " Compute the available width for the displayed text. + let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0) + let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines' + + " Expand tabs, truncate, pad, and concatenate + let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g') + let l:text = strpart(l:text, 0, l:width - len(l:lines_folded)) + let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text)) + return l:text . l:padding . l:lines_folded +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim index 774696836f..9dc1692534 100644 --- a/runtime/ftplugin/j.vim +++ b/runtime/ftplugin/j.vim @@ -2,7 +2,7 @@ " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> " URL: https://github.com/glts/vim-j -" Last Change: 2015-03-27 +" Last Change: 2015-09-27 if exists('b:did_ftplugin') finish @@ -12,13 +12,20 @@ let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim -setlocal iskeyword=48-57,A-Z,_,a-z +setlocal iskeyword=48-57,A-Z,a-z,_ setlocal comments=:NB. setlocal commentstring=NB.\ %s setlocal formatoptions-=t setlocal matchpairs=(:) +setlocal path-=/usr/include -let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword<' +" Includes. To make the shorthand form "require 'web/cgi'" work, double the +" last path component. Also strip off leading folder names like "~addons/". +setlocal include=\\v^\\s*(load\|require)\\s*'\\zs\\f+\\ze' +setlocal includeexpr=substitute(substitute(tr(v:fname,'\\','/'),'\\v^[^~][^/.]*(/[^/.]+)$','&\\1',''),'\\v^\\~[^/]+/','','') +setlocal suffixesadd=.ijs + +let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword< path< include< includeexpr< suffixesadd<' " Section movement with ]] ][ [[ []. The start/end patterns below are amended " inside the function in order to avoid matching on the current cursor line. diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim new file mode 100644 index 0000000000..60b3fd996d --- /dev/null +++ b/runtime/ftplugin/systemd.vim @@ -0,0 +1,7 @@ +" Vim filetype plugin file +" Language: systemd.unit(5) + +if !exists('b:did_ftplugin') + " Looks a lot like dosini files. + runtime! ftplugin/dosini.vim +endif diff --git a/runtime/indent/bzl.vim b/runtime/indent/bzl.vim new file mode 100644 index 0000000000..24e5b870cd --- /dev/null +++ b/runtime/indent/bzl.vim @@ -0,0 +1,97 @@ +" Vim indent file +" Language: Bazel (http://bazel.io) +" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) +" Last Change: 2015 Aug 11 + +if exists('b:did_indent') + finish +endif + +" Load base python indent. +if !exists('*GetPythonIndent') + runtime! indent/python.vim +endif + +let b:did_indent = 1 + +" Only enable bzl google indent if python google indent is enabled. +if !get(g:, 'no_google_python_indent') + setlocal indentexpr=GetBzlIndent(v:lnum) +endif + +if exists('*GetBzlIndent') + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +" Maximum number of lines to look backwards. +let s:maxoff = 50 + +"" +" Determine the correct indent level given an {lnum} in the current buffer. +function GetBzlIndent(lnum) abort + let l:use_recursive_indent = !get(g:, 'no_google_python_recursive_indent') + if l:use_recursive_indent + " Backup and override indent setting variables. + if exists('g:pyindent_nested_paren') + let l:pyindent_nested_paren = g:pyindent_nested_paren + endif + if exists('g:pyindent_open_paren') + let l:pyindent_open_paren = g:pyindent_open_paren + endif + " Vim 7.3.693 and later defines a shiftwidth() function to get the effective + " shiftwidth value. Fall back to &shiftwidth if the function doesn't exist. + let l:sw_expr = exists('*shiftwidth') ? 'shiftwidth()' : '&shiftwidth' + let g:pyindent_nested_paren = l:sw_expr . ' * 2' + let g:pyindent_open_paren = l:sw_expr . ' * 2' + endif + + let l:indent = -1 + + " Indent inside parens. + " Align with the open paren unless it is at the end of the line. + " E.g. + " open_paren_not_at_EOL(100, + " (200, + " 300), + " 400) + " open_paren_at_EOL( + " 100, 200, 300, 400) + call cursor(a:lnum, 1) + let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW', + \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" . + \ " synIDattr(synID(line('.'), col('.'), 1), 'name')" . + \ " =~ '\\(Comment\\|String\\)$'") + if l:par_line > 0 + call cursor(l:par_line, 1) + if l:par_col != col('$') - 1 + let l:indent = l:par_col + endif + endif + + " Delegate the rest to the original function. + if l:indent == -1 + let l:indent = GetPythonIndent(a:lnum) + endif + + if l:use_recursive_indent + " Restore global variables. + if exists('l:pyindent_nested_paren') + let g:pyindent_nested_paren = l:pyindent_nested_paren + else + unlet g:pyindent_nested_paren + endif + if exists('l:pyindent_open_paren') + let g:pyindent_open_paren = l:pyindent_open_paren + else + unlet g:pyindent_open_paren + endif + endif + + return l:indent +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/runtime/indent/systemd.vim b/runtime/indent/systemd.vim new file mode 100644 index 0000000000..a05a87bb1c --- /dev/null +++ b/runtime/indent/systemd.vim @@ -0,0 +1,10 @@ +" Vim indent file +" Language: systemd.unit(5) + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif + +" Looks a lot like dosini files. +runtime! indent/dosini.vim diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim index eb47b1a7c3..b438dea811 100644 --- a/runtime/plugin/tohtml.vim +++ b/runtime/plugin/tohtml.vim @@ -1,6 +1,6 @@ " Vim plugin for converting a syntax highlighted file to HTML. " Maintainer: Ben Fritz -" Last Change: 2013 Jul 08 +" Last Change: 2015 Sep 08 " " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and " $VIMRUNTIME/syntax/2html.vim @@ -67,20 +67,24 @@ if exists('g:loaded_2html_plugin') finish endif -let g:loaded_2html_plugin = 'vim7.4_v1' +let g:loaded_2html_plugin = 'vim7.4_v2' " " Changelog: {{{ -" 7.4_v1 (this version): Fix modeline mangling for new "Vim:" format, and +" 7.4_v2 (this version): Fix error raised when converting a diff containing +" an empty buffer. Jan Stocker: allow g:html_font to +" take a list so it is easier to specfiy fallback +" fonts in the generated CSS. +" 7.4_v1 (Vim 7.4.0000): Fix modeline mangling for new "Vim:" format, and " also for version-specific modelines like "vim>703:". " " 7.3 updates: {{{ -" 7.3_v14 (ad6996a23e3e): Allow suppressing line number anchors using +" 7.3_v14 (Vim 7.3.1246): Allow suppressing line number anchors using " g:html_line_ids=0. Allow customizing " important IDs (like line IDs and fold IDs) using " g:html_id_expr evalutated when the buffer conversion " is started. -" 7.3_v13 (2eb30f341e8d): Keep foldmethod at manual in the generated file and +" 7.3_v13 (Vim 7.3.1088): Keep foldmethod at manual in the generated file and " insert modeline to set it to manual. " Fix bug: diff mode with 2 unsaved buffers creates a " duplicate of one buffer instead of including both. @@ -91,7 +95,7 @@ let g:loaded_2html_plugin = 'vim7.4_v1' " Fix XML validation error: &nsbp; not part of XML. " Allow TOhtml to chain together with other commands " using |. -" 7.3_v12 (9910cbff5f16): Fix modeline mangling to also work for when multiple +" 7.3_v12 (Vim 7.3.0616): Fix modeline mangling to also work for when multiple " highlight groups make up the start-of-modeline text. " Improve render time of page with uncopyable regions " by not using one-input-per-char. Change name of @@ -117,23 +121,23 @@ let g:loaded_2html_plugin = 'vim7.4_v1' " http://groups.google.com/d/topic/vim_dev/B6FSGfq9VoI/discussion. " This patch has not yet been included in Vim, thus " these changes are removed in the next version. -" 7.3_v10 (fd09a9c8468e): Fix error E684 when converting a range wholly inside +" 7.3_v10 (Vim 7.3.0227): Fix error E684 when converting a range wholly inside " multiple nested folds with dynamic folding on. " Also fix problem with foldtext in this situation. -" 7.3_v9 (0877b8d6370e): Add html_pre_wrap option active with html_use_css +" 7.3_v9 (Vim 7.3.0170): Add html_pre_wrap option active with html_use_css " and without html_no_pre, default value same as " 'wrap' option, (Andy Spencer). Don't use " 'fileencoding' for converted document encoding if " 'buftype' indicates a special buffer which isn't " written. -" 7.3_v8 (85c5a72551e2): Add html_expand_tabs option to allow leaving tab +" 7.3_v8 (Vim 7.3.0100): Add html_expand_tabs option to allow leaving tab " characters in generated output (Andy Spencer). " Escape text that looks like a modeline so Vim " doesn't use anything in the converted HTML as a " modeline. Bugfixes: Fix folding when a fold starts " before the conversion range. Remove fold column when " there are no folds. -" 7.3_v7 (840c3cadb842): see betas released on vim_dev below: +" 7.3_v7 (Vim 7-3-0063): see betas released on vim_dev below: " 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way. " 7.3_v7b2: Remove automatic detection of encodings that are not " supported by all major browsers according to @@ -147,23 +151,22 @@ let g:loaded_2html_plugin = 'vim7.4_v1' " charset, and make sure the 'fenc' of the generated " file matches its indicated charset. Add charsets for " all of Vim's natively supported encodings. -" 7.3_v6 (0d3f0e3d289b): Really fix bug with 'nowrapscan', 'magic' and other +" 7.3_v6 (Vim 7.3.0000): Really fix bug with 'nowrapscan', 'magic' and other " user settings interfering with diff mode generation, " trailing whitespace (e.g. line number column) when " using html_no_pre, and bugs when using " html_hover_unfold. " 7.3_v5 ( unreleased ): Fix bug with 'nowrapscan' and also with out-of-sync " folds in diff mode when first line was folded. -" 7.3_v4 (7e008c174cc3): Bugfixes, especially for xhtml markup, and diff mode -" 7.3_v3 (a29075150aee): Refactor option handling and make html_use_css +" 7.3_v4 (Vim 7.3.0000): Bugfixes, especially for xhtml markup, and diff mode +" 7.3_v3 (Vim 7.3.0000): Refactor option handling and make html_use_css " default to true when not set to anything. Use strict " doctypes where possible. Rename use_xhtml option to " html_use_xhtml for consistency. Use .xhtml extension " when using this option. Add meta tag for settings. -" 7.3_v2 (80229a724a11): Fix syntax highlighting in diff mode to use both the +" 7.3_v2 (Vim 7.3.0000): Fix syntax highlighting in diff mode to use both the " diff colors and the normal syntax colors -" 7.3_v1 (e7751177126b): Add conceal support and meta tags in output -" Pre-v1 baseline: Mercurial changeset 3c9324c0800e +" 7.3_v1 (Vim 7.3.0000): Add conceal support and meta tags in output "}}} "}}} diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim index 187b1be1b0..ddc7819be2 100644 --- a/runtime/syntax/2html.vim +++ b/runtime/syntax/2html.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Ben Fritz -" Last Change: 2013 Jul 08 +" Last Change: 2015 Sep 08 " " Additional contributors: " @@ -26,7 +26,11 @@ let s:end=line('$') " Font if exists("g:html_font") - let s:htmlfont = "'". g:html_font . "', monospace" + if type(g:html_font) == type([]) + let s:htmlfont = "'". join(g:html_font,"','") . "', monospace" + else + let s:htmlfont = "'". g:html_font . "', monospace" + endif else let s:htmlfont = "monospace" endif diff --git a/runtime/syntax/bzl.vim b/runtime/syntax/bzl.vim new file mode 100644 index 0000000000..b0ee9454ff --- /dev/null +++ b/runtime/syntax/bzl.vim @@ -0,0 +1,16 @@ +" Vim syntax file +" Language: Bazel (http://bazel.io) +" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) +" Last Change: 2015 Aug 11 + +if exists('b:current_syntax') + finish +endif + + +runtime! syntax/python.vim + +let b:current_syntax = 'bzl' + +syn region bzlRule start='^\w\+($' end='^)\n*' transparent fold +syn region bzlList start='\[' end='\]' transparent fold diff --git a/runtime/syntax/cmake.vim b/runtime/syntax/cmake.vim index 58a7079b83..68b2198de7 100644 --- a/runtime/syntax/cmake.vim +++ b/runtime/syntax/cmake.vim @@ -2,10 +2,10 @@ " Program: CMake - Cross-Platform Makefile Generator " Module: $RCSfile: cmake-syntax.vim,v $ " Language: CMake -" Author: Andy Cedilnik " Maintainer: Karthik Krishnan -" Last Change: 2015 Sep 25 -" (Dominique Pelle added @Spell) +" Former Maintainer: Dimitri Merejkowsky +" Author: Andy Cedilnik +" Last Change: 2015 Sep 29 " Version: $Revision: 1.10 $ " " Licence: The CMake license applies to this file. See diff --git a/runtime/syntax/dnsmasq.vim b/runtime/syntax/dnsmasq.vim index 2a31aed77f..9fa32077b6 100644 --- a/runtime/syntax/dnsmasq.vim +++ b/runtime/syntax/dnsmasq.vim @@ -4,8 +4,8 @@ " :3s+-foo++g " Description: highlight dnsmasq configuration files " File: runtime/syntax/dnsmasq.vim -" Version: 2.70 -" Last Change: 2014 Apr 30 +" Version: 2.76 +" Last Change: 2015 Sep 27 " Modeline: vim: ts=8:sw=2:sts=2: " " License: VIM License @@ -131,10 +131,12 @@ syn match DnsmasqKeyword "^\s*dhcp-sequential-ip\>" syn match DnsmasqKeyword "^\s*dhcp-subscrid\>" syn match DnsmasqKeyword "^\s*dhcp-userclass\>" syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>" +syn match DnsmasqKeyword "^\s*dhcp-hostsdir\>" syn match DnsmasqKeyword "^\s*dns-rr\>" syn match DnsmasqKeyword "^\s*dnssec\>" syn match DnsmasqKeyword "^\s*dnssec-check-unsigned\>" syn match DnsmasqKeyword "^\s*dnssec-no-timecheck\>" +syn match DnsmasqKeyword "^\s*dnssec-timestamp\>" syn match DnsmasqKeyword "^\s*dns-forward-max\>" syn match DnsmasqKeyword "^\s*domain\>" syn match DnsmasqKeyword "^\s*domain-needed\>" @@ -150,6 +152,7 @@ syn match DnsmasqKeyword "^\s*host-record\>" syn match DnsmasqKeyword "^\s*interface\>" syn match DnsmasqKeyword "^\s*interface-name\>" syn match DnsmasqKeyword "^\s*ipset\>" +syn match DnsmasqKeyword "^\s*ignore-address\>" syn match DnsmasqKeyword "^\s*keep-in-foreground\>" syn match DnsmasqKeyword "^\s*leasefile-ro\>" syn match DnsmasqKeyword "^\s*listen-address\>" @@ -164,6 +167,7 @@ syn match DnsmasqKeyword "^\s*log-facility\>" syn match DnsmasqKeyword "^\s*log-queries\>" syn match DnsmasqKeyword "^\s*max-ttl\>" syn match DnsmasqKeyword "^\s*max-cache-ttl\>" +syn match DnsmasqKeyword "^\s*min-cache-ttl\>" syn match DnsmasqKeyword "^\s*min-port\>" syn match DnsmasqKeyword "^\s*mx-host\>" syn match DnsmasqKeyword "^\s*mx-target\>" @@ -204,6 +208,7 @@ syn match DnsmasqKeyword "^\s*test\>" syn match DnsmasqKeyword "^\s*tftp-max\>" syn match DnsmasqKeyword "^\s*tftp-lowercase\>" syn match DnsmasqKeyword "^\s*tftp-no-blocksize\>" +syn match DnsmasqKeyword "^\s*tftp-no-fail\>" syn match DnsmasqKeyword "^\s*tftp-port-range\>" syn match DnsmasqKeyword "^\s*tftp-root\>" syn match DnsmasqKeyword "^\s*tftp-secure\>" diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 4087aff46e..60f23d2d83 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: May 29, 2015 -" Version: 137 +" Last Change: Oct 09, 2015 +" Version: 139 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr) @@ -16,14 +16,14 @@ elseif exists("b:current_syntax") finish endif -" AFAICT "." should be considered part of the iskeyword. Using iskeywords in -" syntax is dicey, so the following code permits the user to +" AFAICT "." should be considered part of the iskeyword for ksh. Using iskeywords +" in syntax is dicey, so the following code permits the user to prevent/override " g:sh_isk set to a string : specify iskeyword. " g:sh_noisk exists : don't change iskeyword -" g:sh_noisk does not exist : (default) append "." to iskeyword +" g:sh_noisk does not exist : (default) append "." to iskeyword for kornshell if exists("g:sh_isk") && type(g:sh_isk) == 1 " user specifying iskeyword exe "setl isk=".g:sh_isk -elseif !exists("g:sh_noisk") " optionally prevent appending '.' to iskeyword +elseif !exists("g:sh_noisk") && exists("b:is_kornshell") " append '.' to iskeyword setl isk+=. endif @@ -128,7 +128,7 @@ syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDere syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator -syn cluster shTestList contains=shCharClass,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr +syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr " Echo: {{{1 " ==== " This one is needed INSIDE a CommandSub, so that `echo bla` be correct @@ -321,12 +321,11 @@ elseif !exists("g:sh_no_error") endif syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@ " Previous Maintainer: Czo " Credits: Stephan Hegel -" Last Changed: 2015 Apr 25 by Daniel Kho +" Last Changed: 2015 Oct 13 by Daniel Kho " $Id: vhdl.vim,v 1.1 2004/06/13 15:34:56 vimboss Exp $ " VHSIC (Very High Speed Integrated Circuit) Hardware Description Language @@ -72,6 +72,7 @@ syn keyword vhdlType boolean_vector integer_vector real_vector time_vector syn keyword vhdlType string severity_level " Predefined standard ieee VHDL types syn keyword vhdlType positive natural signed unsigned +syn keyword vhdlType unresolved_signed unresolved_unsigned u_signed u_unsigned syn keyword vhdlType line text syn keyword vhdlType std_logic std_logic_vector syn keyword vhdlType std_ulogic std_ulogic_vector @@ -92,12 +93,12 @@ syn match vhdlAttribute "\'reverse_range" syn match vhdlAttribute "\'right" syn match vhdlAttribute "\'ascending" " block attributes -syn match vhdlAttribute "\'behaviour" -syn match vhdlAttribute "\'structure" +"syn match vhdlAttribute "\'behaviour" " Non-standard VHDL +"syn match vhdlAttribute "\'structure" " Non-standard VHDL syn match vhdlAttribute "\'simple_name" syn match vhdlAttribute "\'instance_name" syn match vhdlAttribute "\'path_name" -syn match vhdlAttribute "\'foreign" +syn match vhdlAttribute "\'foreign" " VHPI " signal attribute syn match vhdlAttribute "\'active" syn match vhdlAttribute "\'delayed" @@ -112,10 +113,9 @@ syn match vhdlAttribute "\'driving" syn match vhdlAttribute "\'driving_value" " type attributes syn match vhdlAttribute "\'base" -syn match vhdlAttribute "\'high" -syn match vhdlAttribute "\'left" +syn match vhdlAttribute "\'subtype" +syn match vhdlAttribute "\'element" syn match vhdlAttribute "\'leftof" -syn match vhdlAttribute "\'low" syn match vhdlAttribute "\'pos" syn match vhdlAttribute "\'pred" syn match vhdlAttribute "\'rightof" @@ -150,34 +150,76 @@ syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>" syn match vhdlNumber "-\=\<\d\+\>" syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\=" syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\=" + " operators -syn keyword vhdlOperator and nand or nor xor xnor -syn keyword vhdlOperator rol ror sla sll sra srl -syn keyword vhdlOperator mod rem abs not -syn match vhdlOperator "[&><=:+\-*\/|]" -syn match vhdlSpecial "[().,;]" +syn keyword vhdlOperator and nand or nor xor xnor +syn keyword vhdlOperator rol ror sla sll sra srl +syn keyword vhdlOperator mod rem abs not +" TODO remove the following line. You can't have a sequence of */=+ as an operator for example. +"syn match vhdlOperator "[&><=:+\-*\/|]" +" The following lines match valid and invalid operators. + +" Concatenation and math operators +syn match vhdlOperator "&\|+\|-\|\*\|\/" + +" Equality and comparison operators +syn match vhdlOperator "=\|\/=\|>\|<\|>=" + +" Assignment operators +syn match vhdlOperator "<=\|:=" +syn match vhdlOperator "=>" + +" VHDL-2008 conversion, matching equality/non-equality operators +syn match vhdlOperator "??\|?=\|?\/=\|?<\|?<=\|?>\|?>=" + +" Linting for illegal operators +" '=' +syn match vhdlError "\(=\)[<=&+\-\*\/\\]\+" +syn match vhdlError "[=&+\-\*\\]\+\(=\)" +" '>', '<' +syn match vhdlError "\(>\)[<>&+\-\/\\]\+" +syn match vhdlError "[>&+\-\/\\]\+\(>\)" +syn match vhdlError "\(<\)[<&+\-\/\\]\+" +syn match vhdlError "[<>=&+\-\/\\]\+\(<\)" +" Covers most operators +syn match vhdlError "\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<=\|?>=\|>=\|<=\|:=\|=>\)[<>=&+\-\*\\?:]\+" +syn match vhdlError "[<>=&+\-\*\\:]\+\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|>=\|<=\|:=\|=>\)" +syn match vhdlError "\(?<\|?>\)[<>&+\-\*\/\\?:]\+" + +"syn match vhdlError "[?]\+\(&\|+\|\-\|\*\*\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|:=\|=>\)" +" '/' +syn match vhdlError "\(\/\)[<>&+\-\*\/\\?:]\+" +syn match vhdlError "[<>=&+\-\*\/\\:]\+\(\/\)" + +syn match vhdlSpecial "<>" +syn match vhdlSpecial "[().,;]" + + " time syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>" syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>" +syn case match syn keyword vhdlTodo contained TODO NOTE syn keyword vhdlFixme contained FIXME +syn case ignore -" Regex for space is '\s' -" Any number of spaces: \s* -" At least one space: \s+ -syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell -syn match vhdlComment "--.*" contains=vhdlTodo,vhdlFixme,@Spell +syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell +syn match vhdlComment "\(^\|\s\)--.*" contains=vhdlTodo,vhdlFixme,@Spell + +" Industry-standard directives. These are not standard VHDL, but are commonly +" used in the industry. syn match vhdlPreProc "/\* synthesis .* \*/" +"syn match vhdlPreProc "/\* simulation .* \*/" syn match vhdlPreProc "/\* pragma .* \*/" syn match vhdlPreProc "/\* synopsys .* \*/" syn match vhdlPreProc "--\s*synthesis .*" +"syn match vhdlPreProc "--\s*simulation .*" syn match vhdlPreProc "--\s*pragma .*" syn match vhdlPreProc "--\s*synopsys .*" -" syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]" "Modify the following as needed. The trade-off is performance versus functionality. -syn sync minlines=200 +syn sync minlines=600 " Define the default highlighting. " For version 5.7 and earlier: only when not done already @@ -203,7 +245,7 @@ if version >= 508 || !exists("did_vhdl_syntax_inits") HiLink vhdlTime Number HiLink vhdlType Type HiLink vhdlOperator Operator -" HiLink vhdlGlobal Error + HiLink vhdlError Error HiLink vhdlAttribute Special HiLink vhdlPreProc PreProc