From 92dff1827aa0a199bd26139982c485fe366a5727 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 11 Feb 2014 19:15:50 +0100 Subject: Update runtime files. Add support for systemverilog. --- runtime/doc/autocmd.txt | 7 +- runtime/doc/change.txt | 2 +- runtime/doc/eval.txt | 6 +- runtime/doc/motion.txt | 4 +- runtime/doc/pattern.txt | 6 +- runtime/doc/repeat.txt | 14 ++- runtime/doc/tags | 3 +- runtime/doc/todo.txt | 52 ++++----- runtime/filetype.vim | 5 +- runtime/ftplugin/debchangelog.vim | 4 +- runtime/ftplugin/python.vim | 4 +- runtime/ftplugin/systemverilog.vim | 11 ++ runtime/indent/systemverilog.vim | 230 +++++++++++++++++++++++++++++++++++++ runtime/syntax/asm.vim | 8 +- runtime/syntax/debchangelog.vim | 4 +- runtime/syntax/debcontrol.vim | 4 +- runtime/syntax/debsources.vim | 4 +- runtime/syntax/systemverilog.vim | 101 ++++++++++++++++ 18 files changed, 411 insertions(+), 58 deletions(-) create mode 100644 runtime/ftplugin/systemverilog.vim create mode 100644 runtime/indent/systemverilog.vim create mode 100644 runtime/syntax/systemverilog.vim diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ef23c0061..ecb5b963d 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.4. Last change: 2013 Dec 04 +*autocmd.txt* For Vim version 7.4. Last change: 2014 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -562,6 +562,9 @@ FileChangedRO Before making the first change to a read-only It is not allowed to change to another buffer here. You can reload the buffer but not edit another one. + *E881* + If the number of lines changes saving for undo + may fail and the change will be aborted. *FileChangedShell* FileChangedShell When Vim notices that the modification time of a file has changed since editing started. @@ -740,7 +743,7 @@ QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix command is run, before jumping to the first location. For |:cfile| and |:lfile| commands it is run after error file is read and before - moving to the first error. + moving to the first error. See |QuickFixCmdPost-example|. *QuitPre* QuitPre When using `:quit`, `:wq` or `:qall`, before diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 1ae851004..1ff39c399 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -824,7 +824,7 @@ either the first or second pattern in parentheses did not match, so either < Substitute with an expression *sub-replace-expression* - *sub-replace-\=* *:s/\=* + *sub-replace-\=* *s/\=* When the substitute string starts with "\=" the remainder is interpreted as an expression. This does not work recursively: a |substitute()| function inside the expression cannot use "\=" for the substitute string. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f580d3983..7d6708a67 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2014 Jan 14 +*eval.txt* For Vim version 7.4. Last change: 2014 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1745,7 +1745,7 @@ cscope_connection( [{num} , {dbpath} [, {prepend}]]) cursor( {lnum}, {col} [, {coladd}]) Number move cursor to {lnum}, {col}, {coladd} cursor( {list}) Number move cursor to position in {list} -deepcopy( {expr}) any make a full copy of {expr} +deepcopy( {expr} [, {noref}]) any make a full copy of {expr} delete( {fname}) Number delete file {fname} did_filetype() Number TRUE if FileType autocommand event used diff_filler( {lnum}) Number diff filler lines about {lnum} @@ -5642,7 +5642,7 @@ strchars({expr}) *strchars()* strdisplaywidth({expr}[, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells - String {expr} occupies on the screen. + String {expr} occupies on the screen when it starts a {col}. When {col} is omitted zero is used. Otherwise it is the screen column where to start. This matters for Tab characters. diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index d40d825c2..eaa2d8df3 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 7.4. Last change: 2013 Jul 17 +*motion.txt* For Vim version 7.4. Last change: 2014 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -343,7 +343,7 @@ gg Goto line [count], default first line, on the first See also 'startofline' option. {not in Vi} :[range]go[to] [count] *:go* *:goto* *go* -[count]go Go to {count} byte in the buffer. Default [count] is +[count]go Go to [count] byte in the buffer. Default [count] is one, start of the file. When giving [range], the last number in it used as the byte count. End-of-line characters are counted depending on the current diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index f2f0b34e3..80688f918 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.4. Last change: 2013 Nov 09 +*pattern.txt* For Vim version 7.4. Last change: 2014 Feb 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -192,10 +192,10 @@ affected. An example of how to search for matches with a pattern and change the match with another word: > /foo find "foo" - c//e change until end of match + c//e change until end of match bar type replacement // go to start of next match - c//e change until end of match + c//e change until end of match beep type another replacement etc. < diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 069770024..25421a59d 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 7.4. Last change: 2013 Jul 25 +*repeat.txt* For Vim version 7.4. Last change: 2014 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -26,10 +26,14 @@ Chapter 26 of the user manual introduces repeating |usr_26.txt|. Simple changes can be repeated with the "." command. Without a count, the count of the last change is used. If you enter a count, it will replace the -last one. If the last change included a specification of a numbered register, -the register number will be incremented. See |redo-register| for an example -how to use this. Note that when repeating a command that used a Visual -selection, the same SIZE of area is used, see |visual-repeat|. +last one. |v:count| and |v:count1| will be set. + +If the last change included a specification of a numbered register, the +register number will be incremented. See |redo-register| for an example how +to use this. + +Note that when repeating a command that used a Visual selection, the same SIZE +of area is used, see |visual-repeat|. *@:* @: Repeat last command-line [count] times. diff --git a/runtime/doc/tags b/runtime/doc/tags index dce548fea..f885e84a4 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2673,7 +2673,6 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :rviminfo starting.txt /*:rviminfo* :s change.txt /*:s* :s% change.txt /*:s%* -:s/\= change.txt /*:s\/\\=* :sN windows.txt /*:sN* :sNext windows.txt /*:sNext* :s\= change.txt /*:s\\=* @@ -4305,6 +4304,7 @@ E878 pattern.txt /*E878* E879 syntax.txt /*E879* E88 windows.txt /*E88* E880 if_pyth.txt /*E880* +E881 autocmd.txt /*E881* E89 message.txt /*E89* E90 message.txt /*E90* E91 options.txt /*E91* @@ -7596,6 +7596,7 @@ s/\2 change.txt /*s\/\\2* s/\3 change.txt /*s\/\\3* s/\9 change.txt /*s\/\\9* s/\ change.txt /*s\/\\* +s/\= change.txt /*s\/\\=* s/\E change.txt /*s\/\\E* s/\L change.txt /*s\/\\L* s/\U change.txt /*s\/\\U* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 1ca994dc3..b15d63395 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2014 Jan 23 +*todo.txt* For Vim version 7.4. Last change: 2014 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,9 +34,12 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +When 'paste' is changed with 'pastetoggle', the ruler doesn't reflect this +right away. (Samuel Ferencik, 2010 Dec 7) +Patch to fix that status line isn't redrawn when 'pastetoggle' is set. +(Nobuhiro Takasaki, 2014 Feb 11) + Regexp problems: -- After patch 7.4.045 pattern with \zs isn't handled correctly. (Yukihiro - Nakadaira, 2013 Dec 23) Patch 2014 Jan 15, update Jan 16. - NFA regexp doesn't count tab matches correctly. (Urtica Dioica / gaultheria Shallon, 2013 Nov 18) - After patch 7.4.100 there is still a difference between NFA and old engine. @@ -50,13 +53,8 @@ Regexp problems: 2013 Dec 11) - Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski Remark from Brett 2014 Jan 6 and 7. - -Patch to fix endless loop in completion. (Christian Brabandt, 2014 Jan 15) - -Patch after 7.4.154: no autoload when not evaluating. (Yasuhiro Matsumoto, -2014 Jan 14) - -Test for patch 7.4.149. (Yukihiro Nakadaira, 2014 Jan 15) +- Bug with back references. (Lech Lorens, 2014 Feb 3) +- Bug when using \>. (Ramel, 2014 Feb 2) Problem that a previous silent ":throw" causes a following try/catch not to work. (ZyX, 2013 Sep 28) @@ -64,13 +62,6 @@ work. (ZyX, 2013 Sep 28) ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) -Blowfish is actually using CFB instead of OFB. Adjust names in blowfish.c. - -More compiler warnings for Python. (Tony Mechelynck, 2014 Jan 14) - -Patch to fix that when wide functions fail the non-wide function may do -something wrong. (Ken Takata, 2014 Jan 18) - Patch 7.4.085 breaks Visual insert in some situations. (Issue 193) Patch by Christian Brabandt, 2014 Jan 16. @@ -81,17 +72,15 @@ ftplugins. Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) -Patch to make Dictionary.update() work without arguments. -(ZyX, 2013 Oct 19) - -Include systemverilog file? Two votes yes. - Patch to make "J" set '[ and '] marks. (Christian Brabandt, 2013 Dec 11) Any compatibility problems? Patch to add :S modifier for excaping the current file name. (ZyX, 2013 Nov 30) Update Dec 5. +Issu 197: ]P doesn't paste over Visual selection. With patch from Christian +Brabandt, Feb 6. + Problem with 'spellsuggest' file, only works for some words. (Cesar Romani, 2013 Aug 20) Depends on file name? (Aug 24) Additional remark by glts: the suggested words are marked bad? @@ -102,12 +91,15 @@ Additional remark by glts: the suggested words are marked bad? Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) -Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) +Patch for mksession. (Nobuhiro Takasaki, 2014 Jan 31) +Also fixes another problem (following email) -Error number E834 is used twice. (Yukihiro Nakadaira. 2014 Jan 18) +Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Crash with ":%s/\n//g" on long file. (Aidan Marlin, 2014 Jan 15) Christian Brabandt: patch to run this into a join. (2014 Jan 18) +Suggestion to not save replaced line for undo: Yukihiro Nakadaira, 2014 Jan +25. Add digraph for Rouble: =P. What's the Unicode? @@ -117,6 +109,12 @@ Phpcomplete.vim update. (Complex, 2014 Jan 15) PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19) +Can we make ":unlet $VAR" use unsetenv() to delete the env var? +What for systems that don't have unsetenv()? + +spec ftplugin: patch from Igor Gnatenko, 2014 Jan 26. +Include if maintainers don't respond. + Patch to make has() check for Vim version and patch at the same time. (Marc Weber, 2013 Jun 7) @@ -325,7 +323,8 @@ MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) Patch to have text objects defined by arbitrary single characters. (Daniel -Thau, 2013 Nov 20) +Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) +Ben Fritz: problem with 'selection' set to "exclusive". Patch to select the next or previous text object if there isn't one under the cursor. (Daniel Thau, 2013 Nov 20) @@ -784,9 +783,6 @@ C-indenting: A matching { in a comment is ignored, but intermediate { are not checked to be in a comment. Implement FM_SKIPCOMM flag of findmatchlimit(). Issue 46. -When 'paste' is changed with 'pastetoggle', the ruler doesn't reflect this -right away. (Samuel Ferencik, 2010 Dec 7) - Mac with X11: clipboard doesn't work properly. (Raf, 2010 Aug 16) Using CompilerSet doesn't record where an option was set from. E.g., in the diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 88d262013..96207e0b2 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: 2014 Jan 06 +" Last Change: 2014 Feb 11 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -2243,6 +2243,9 @@ au BufNewFile,BufRead *.v setf verilog " Verilog-AMS HDL au BufNewFile,BufRead *.va,*.vams setf verilogams +" SystemVerilog +au BufNewFile,BufRead *.sv setf systemverilog + " VHDL au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index c74284fd4..d2718db88 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Michael Piefel " Stefano Zacchiroli -" Last Change: 2012-01-31 +" Last Change: 2014-01-31 " License: Vim License " URL: http://hg.debian.org/hg/pkg-vim/vim/file/unstable/runtime/ftplugin/debchangelog.vim @@ -152,7 +152,7 @@ function CloseBug() endfunction function Distribution(dist) - call setline(1, substitute(getline(1), ") [[:lower:] ]*;", ") " . a:dist . ";", "")) + call setline(1, substitute(getline(1), ') *\%(UNRELEASED\|\l\+\);', ") " . a:dist . ";", "")) endfunction function Urgency(urg) diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 59afdb556..75c7e8799 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: python " Maintainer: Johannes Zellner -" Last Change: 2013 Nov 28 +" Last Change: 2014 Feb 09 " Last Change By Johannes: Wed, 21 Apr 2004 13:13:08 CEST if exists("b:did_ftplugin") | finish | endif @@ -11,7 +11,7 @@ set cpo&vim setlocal cinkeys-=0# setlocal indentkeys-=0# -setlocal include=\s*\\(from\\\|import\\) +setlocal include=^\\s*\\(from\\\|import\\) setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.py setlocal comments=b:#,fb:- diff --git a/runtime/ftplugin/systemverilog.vim b/runtime/ftplugin/systemverilog.vim new file mode 100644 index 000000000..4d0f565fc --- /dev/null +++ b/runtime/ftplugin/systemverilog.vim @@ -0,0 +1,11 @@ +" Vim filetype plugin file +" Language: SystemVerilog +" Maintainer: kocha +" Last Change: 12-Aug-2013. + +if exists("b:did_ftplugin") + finish +endif + +" Behaves just like Verilog +runtime! ftplugin/verilog.vim diff --git a/runtime/indent/systemverilog.vim b/runtime/indent/systemverilog.vim new file mode 100644 index 000000000..b01753553 --- /dev/null +++ b/runtime/indent/systemverilog.vim @@ -0,0 +1,230 @@ +" Vim indent file +" Language: SystemVerilog +" Maintainer: kocha +" Last Change: 12-Aug-2013. + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=SystemVerilogIndent() +setlocal indentkeys=!^F,o,O,0),0},=begin,=end,=join,=endcase,=join_any,=join_none +setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify +setlocal indentkeys+==endclass,=endpackage,=endsequence,=endclocking +setlocal indentkeys+==endinterface,=endgroup,=endprogram,=endproperty,=endchecker +setlocal indentkeys+==`else,=`endif + +" Only define the function once. +if exists("*SystemVerilogIndent") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +function SystemVerilogIndent() + + if exists('b:systemverilog_indent_width') + let offset = b:systemverilog_indent_width + else + let offset = &sw + endif + if exists('b:systemverilog_indent_modules') + let indent_modules = offset + else + let indent_modules = 0 + endif + + " Find a non-blank line above the current line. + let lnum = prevnonblank(v:lnum - 1) + + " At the start of the file use zero indent. + if lnum == 0 + return 0 + endif + + let lnum2 = prevnonblank(lnum - 1) + let curr_line = getline(v:lnum) + let last_line = getline(lnum) + let last_line2 = getline(lnum2) + let ind = indent(lnum) + let ind2 = indent(lnum - 1) + let offset_comment1 = 1 + " Define the condition of an open statement + " Exclude the match of //, /* or */ + let sv_openstat = '\(\\|\([*/]\)\@<+-/%^&|!=?:]\([*/]\)\@!\)' + " Define the condition when the statement ends with a one-line comment + let sv_comment = '\(//.*\|/\*.*\*/\s*\)' + if exists('b:verilog_indent_verbose') + let vverb_str = 'INDENT VERBOSE:' + let vverb = 1 + else + let vverb = 0 + endif + + " Indent accoding to last line + " End of multiple-line comment + if last_line =~ '\*/\s*$' && last_line !~ '/\*.\{-}\*/' + let ind = ind - offset_comment1 + if vverb + echo vverb_str "De-indent after a multiple-line comment." + endif + + " Indent after if/else/for/case/always/initial/specify/fork blocks + elseif last_line =~ '`\@' || + \ last_line =~ '^\s*\<\(for\|case\%[[zx]]\|do\|foreach\|randcase\)\>' || + \ last_line =~ '^\s*\<\(always\|always_comb\|always_ff\|always_latch\)\>' || + \ last_line =~ '^\s*\<\(initial\|specify\|fork\|final\)\>' + if last_line !~ '\(;\|\\)\s*' . sv_comment . '*$' || + \ last_line =~ '\(//\|/\*\).*\(;\|\\)\s*' . sv_comment . '*$' + let ind = ind + offset + if vverb | echo vverb_str "Indent after a block statement." | endif + endif + " Indent after function/task/class/package/sequence/clocking/ + " interface/covergroup/property/checkerprogram blocks + elseif last_line =~ '^\s*\<\(function\|task\|class\|package\)\>' || + \ last_line =~ '^\s*\<\(sequence\|clocking\|interface\)\>' || + \ last_line =~ '^\s*\(\w\+\s*:\)\=\s*\' || + \ last_line =~ '^\s*\<\(property\|checker\|program\)\>' + if last_line !~ '\\s*' . sv_comment . '*$' || + \ last_line =~ '\(//\|/\*\).*\(;\|\\)\s*' . sv_comment . '*$' + let ind = ind + offset + if vverb + echo vverb_str "Indent after function/task/class block statement." + endif + endif + + " Indent after module/function/task/specify/fork blocks + elseif last_line =~ '^\s*\(\\s*\)\=\' + let ind = ind + indent_modules + if vverb && indent_modules + echo vverb_str "Indent after module statement." + endif + if last_line =~ '[(,]\s*' . sv_comment . '*$' && + \ last_line !~ '\(//\|/\*\).*[(,]\s*' . sv_comment . '*$' + let ind = ind + offset + if vverb + echo vverb_str "Indent after a multiple-line module statement." + endif + endif + + " Indent after a 'begin' statement + elseif last_line =~ '\(\\)\(\s*:\s*\w\+\)*' . sv_comment . '*$' && + \ last_line !~ '\(//\|/\*\).*\(\\)' && + \ ( last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' || + \ last_line2 =~ '^\s*[^=!]\+\s*:\s*' . sv_comment . '*$' ) + let ind = ind + offset + if vverb | echo vverb_str "Indent after begin statement." | endif + + " Indent after a '{' or a '(' + elseif last_line =~ '[{(]' . sv_comment . '*$' && + \ last_line !~ '\(//\|/\*\).*[{(]' && + \ ( last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' || + \ last_line2 =~ '^\s*[^=!]\+\s*:\s*' . sv_comment . '*$' ) + let ind = ind + offset + if vverb | echo vverb_str "Indent after begin statement." | endif + + " De-indent for the end of one-line block + elseif ( last_line !~ '\' || + \ last_line =~ '\(//\|/\*\).*\' ) && + \ last_line2 =~ '\<\(`\@.*' . + \ sv_comment . '*$' && + \ last_line2 !~ '\(//\|/\*\).*\<\(`\@' && + \ last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' && + \ ( last_line2 !~ '\' || + \ last_line2 =~ '\(//\|/\*\).*\' ) + let ind = ind - offset + if vverb + echo vverb_str "De-indent after the end of one-line statement." + endif + + " Multiple-line statement (including case statement) + " Open statement + " Ident the first open line + elseif last_line =~ sv_openstat . '\s*' . sv_comment . '*$' && + \ last_line !~ '\(//\|/\*\).*' . sv_openstat . '\s*$' && + \ last_line2 !~ sv_openstat . '\s*' . sv_comment . '*$' + let ind = ind + offset + if vverb | echo vverb_str "Indent after an open statement." | endif + + " Close statement + " De-indent for an optional close parenthesis and a semicolon, and only + " if there exists precedent non-whitespace char + elseif last_line =~ ')*\s*;\s*' . sv_comment . '*$' && + \ last_line !~ '^\s*)*\s*;\s*' . sv_comment . '*$' && + \ last_line !~ '\(//\|/\*\).*\S)*\s*;\s*' . sv_comment . '*$' && + \ ( last_line2 =~ sv_openstat . '\s*' . sv_comment . '*$' && + \ last_line2 !~ ';\s*//.*$') && + \ last_line2 !~ '^\s*' . sv_comment . '$' + let ind = ind - offset + if vverb | echo vverb_str "De-indent after a close statement." | endif + + " `ifdef and `else + elseif last_line =~ '^\s*`\<\(ifdef\|else\)\>' + let ind = ind + offset + if vverb + echo vverb_str "Indent after a `ifdef or `else statement." + endif + + endif + + " Re-indent current line + + " De-indent on the end of the block + " join/end/endcase/endfunction/endtask/endspecify + if curr_line =~ '^\s*\<\(join\|join_any\|join_none\|\|end\|endcase\|while\)\>' || + \ curr_line =~ '^\s*\<\(endfunction\|endtask\|endspecify\|endclass\)\>' || + \ curr_line =~ '^\s*\<\(endpackage\|endsequence\|endclocking\|endinterface\)\>' || + \ curr_line =~ '^\s*\<\(endgroup\|endproperty\|endchecker\|endprogram\)\>' || + \ curr_line =~ '^\s*}' + let ind = ind - offset + if vverb | echo vverb_str "De-indent the end of a block." | endif + elseif curr_line =~ '^\s*\' + let ind = ind - indent_modules + if vverb && indent_modules + echo vverb_str "De-indent the end of a module." + endif + + " De-indent on a stand-alone 'begin' + elseif curr_line =~ '^\s*\' + if last_line !~ '^\s*\<\(function\|task\|specify\|module\|class\|package\)\>' || + \ last_line !~ '^\s*\<\(sequence\|clocking\|interface\|covergroup\)\>' || + \ last_line !~ '^\s*\<\(property\|checker\|program\)\>' && + \ last_line !~ '^\s*\()*\s*;\|)\+\)\s*' . sv_comment . '*$' && + \ ( last_line =~ + \ '\<\(`\@' || + \ last_line =~ ')\s*' . sv_comment . '*$' || + \ last_line =~ sv_openstat . '\s*' . sv_comment . '*$' ) + let ind = ind - offset + if vverb + echo vverb_str "De-indent a stand alone begin statement." + endif + endif + + " De-indent after the end of multiple-line statement + elseif curr_line =~ '^\s*)' && + \ ( last_line =~ sv_openstat . '\s*' . sv_comment . '*$' || + \ last_line !~ sv_openstat . '\s*' . sv_comment . '*$' && + \ last_line2 =~ sv_openstat . '\s*' . sv_comment . '*$' ) + let ind = ind - offset + if vverb + echo vverb_str "De-indent the end of a multiple statement." + endif + + " De-indent `else and `endif + elseif curr_line =~ '^\s*`\<\(else\|endif\)\>' + let ind = ind - offset + if vverb | echo vverb_str "De-indent `else and `endif statement." | endif + + endif + + " Return the indention + return ind +endfunction + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim:sw=2 diff --git a/runtime/syntax/asm.vim b/runtime/syntax/asm.vim index f208245ab..e5f16c5bd 100644 --- a/runtime/syntax/asm.vim +++ b/runtime/syntax/asm.vim @@ -3,7 +3,7 @@ " Maintainer: Erik Wognsen " Previous maintainer: " Kevin Dahlhausen -" Last Change: 2012 Apr 09 +" Last Change: 2014 Feb 04 " Thanks to Ori Avtalion for feedback on the comment markers! @@ -93,7 +93,11 @@ syn match asmCond "\.endif" syn match asmMacro "\.macro" syn match asmMacro "\.endm" -syn match asmDirective "\.[a-z][a-z]\+" +" Assembler directives start with a '.' and may contain upper case (e.g., +" .ABORT), numbers (e.g., .p2align), dash (e.g., .app-file) and underscore in +" CFI directives (e.g., .cfi_startproc). This will also match labels starting +" with '.', including the GCC auto-generated '.L' labels. +syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*" syn case match diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index b1d7a3139..4b3cbc7b3 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2013 May 05 +" Last Change: 2014 Jan 20 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim " Standard syntax initialization @@ -19,7 +19,7 @@ syn case ignore " Define some common expressions we can use later on syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" -syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(lucid|precise|quantal|raring|saucy)%(-%(security|proposed|updates|backports|commercial|partner))=)+" +syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(lucid|precise|quantal|saucy|trusty)%(-%(security|proposed|updates|backports|commercial|partner))=)+" syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index 3ca17a86e..2a14b67f0 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2013 May 05 +" Last Change: 2013 Oct 28 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim " Standard syntax initialization @@ -24,7 +24,7 @@ syn match debControlComma ", *" syn match debControlSpace " " " Define some common expressions we can use later on -syn match debcontrolArchitecture contained "\%(all\|linux-any\|\%(any-\)\=\%(alpha\|amd64\|arm\%(e[bl]\|hf\)\=\|avr32\|hppa\|i386\|ia64\|lpia\|m32r\|m68k\|mips\%(el\)\=\|powerpc\|ppc64\|s390x\=\|sh[34]\(eb\)\=\|sh\|sparc\%(64\)\=\)\|hurd-\%(i386\|any\)\|kfreebsd-\%(i386\|amd64\|any\)\|knetbsd-\%(i386\|any\)\|kopensolaris-\%(i386\|any\)\|netbsd-\%(alpha\|i386\|any\)\|any\)" +syn match debcontrolArchitecture contained "\%(all\|linux-any\|\%(any-\)\=\%(alpha\|amd64\|arm\%(e[bl]\|hf\|64\)\=\|avr32\|hppa\|i386\|ia64\|lpia\|m32r\|m68k\|mips\%(el\)\=\|powerpc\%(spe\)\=\|ppc64\|s390x\=\|sh[34]\(eb\)\=\|sh\|sparc\%(64\)\=\)\|x32\|hurd-\%(i386\|any\)\|kfreebsd-\%(i386\|amd64\|any\)\|knetbsd-\%(i386\|any\)\|kopensolaris-\%(i386\|any\)\|netbsd-\%(alpha\|i386\|any\)\|any\)" syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index f3dd2a5fc..0146d3d00 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann -" Last Change: 2013 May 05 +" Last Change: 2014 Jan 20 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debsources.vim " Standard syntax initialization @@ -23,7 +23,7 @@ syn match debsourcesComment /#.*/ contains=@Spell " Match uri's syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++ -syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|lucid\|precise\|quantal\|raring\|saucy\)\([-[:alnum:]_./]*\)+ +syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|lucid\|precise\|quantal\|saucy\|trusty\)\([-[:alnum:]_./]*\)+ " Associate our matches and regions with pretty colours hi def link debsourcesLine Error diff --git a/runtime/syntax/systemverilog.vim b/runtime/syntax/systemverilog.vim new file mode 100644 index 000000000..5bf293507 --- /dev/null +++ b/runtime/syntax/systemverilog.vim @@ -0,0 +1,101 @@ +" Vim syntax file +" Language: SystemVerilog +" Maintainer: kocha +" Last Change: 12-Aug-2013. + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Read in Verilog syntax files +if version < 600 + so :p:h/verilog.vim +else + runtime! syntax/verilog.vim + unlet b:current_syntax +endif + +" IEEE1800-2005 +syn keyword systemverilogStatement always_comb always_ff always_latch +syn keyword systemverilogStatement class endclass new +syn keyword systemverilogStatement virtual local const protected +syn keyword systemverilogStatement package endpackage +syn keyword systemverilogStatement rand randc constraint randomize +syn keyword systemverilogStatement with inside dist +syn keyword systemverilogStatement sequence endsequence randsequence +syn keyword systemverilogStatement srandom +syn keyword systemverilogStatement logic bit byte +syn keyword systemverilogStatement int longint shortint +syn keyword systemverilogStatement struct packed +syn keyword systemverilogStatement final +syn keyword systemverilogStatement import export +syn keyword systemverilogStatement context pure +syn keyword systemverilogStatement void shortreal chandle string +syn keyword systemverilogStatement clocking endclocking iff +syn keyword systemverilogStatement interface endinterface modport +syn keyword systemverilogStatement cover covergroup coverpoint endgroup +syn keyword systemverilogStatement property endproperty +syn keyword systemverilogStatement program endprogram +syn keyword systemverilogStatement bins binsof illegal_bins ignore_bins +syn keyword systemverilogStatement alias matches solve static assert +syn keyword systemverilogStatement assume super before expect bind +syn keyword systemverilogStatement extends null tagged extern this +syn keyword systemverilogStatement first_match throughout timeprecision +syn keyword systemverilogStatement timeunit type union +syn keyword systemverilogStatement uwire var cross ref wait_order intersect +syn keyword systemverilogStatement wildcard within + +syn keyword systemverilogTypeDef typedef enum + +syn keyword systemverilogConditional randcase +syn keyword systemverilogConditional unique priority + +syn keyword systemverilogRepeat return break continue +syn keyword systemverilogRepeat do foreach + +syn keyword systemverilogLabel join_any join_none forkjoin + +" IEEE1800-2009 add +syn keyword systemverilogStatement checker endchecker +syn keyword systemverilogStatement accept_on reject_on +syn keyword systemverilogStatement sync_accept_on sync_reject_on +syn keyword systemverilogStatement eventually nexttime until until_with +syn keyword systemverilogStatement s_always s_eventually s_nexttime s_until s_until_with +syn keyword systemverilogStatement let untyped +syn keyword systemverilogStatement strong weak +syn keyword systemverilogStatement restrict global implies + +syn keyword systemverilogConditional unique0 + +" IEEE1800-2012 add +syn keyword systemverilogStatement implements +syn keyword systemverilogStatement interconnect soft nettype + +" Define the default highlighting. +if version >= 508 || !exists("did_systemverilog_syn_inits") + if version < 508 + let did_systemverilog_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + " The default highlighting. + HiLink systemverilogStatement Statement + HiLink systemverilogTypeDef TypeDef + HiLink systemverilogConditional Conditional + HiLink systemverilogRepeat Repeat + HiLink systemverilogLabel Label + HiLink systemverilogGlobal Define + HiLink systemverilogNumber Number + + delcommand HiLink +endif + +let b:current_syntax = "systemverilog" + +" vim: ts=8 -- cgit v1.2.1