annotate runtime/ftplugin/vhdl.vim @ 13566:c9bacbda2d5b

Small runtime update commit https://github.com/vim/vim/commit/25a6e8a769aa1c0d308b5f871132961f37986d0a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 30 12:27:32 2018 +0200 Small runtime update
author Christian Brabandt <cb@256bit.org>
date Fri, 30 Mar 2018 12:30:06 +0200
parents 8b8ef1fed009
children 02939ae3aaca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
1 " VHDL filetype plugin
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
2 " Language: VHDL
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
3 " Maintainer: R.Shankar <shankar.pec?gmail.com>
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
4 " Modified By: Gerald Lai <laigera+vim?gmail.com>
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
5 " Last Change: 2011 Dec 11
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
6
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
7 " Only do this when not done yet for this buffer
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
9 finish
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
10 endif
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
11
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
12 " Don't load another plugin for this buffer
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
13 let b:did_ftplugin = 1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
14
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
15 let s:cpo_save = &cpo
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
16 set cpo&vim
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
17
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
18 " Set 'formatoptions' to break comment lines but not other lines,
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
19 " and insert the comment leader when hitting <CR> or using "o".
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
20 "setlocal fo-=t fo+=croqlm1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
21
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
22 " Set 'comments' to format dashed lists in comments.
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
23 "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
24
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
25 " Format comments to be up to 78 characters long
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
26 "setlocal tw=75
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
27
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
28 " Win32 can filter files in the browse dialog
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
29 "if has("gui_win32") && !exists("b:browsefilter")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
30 " let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
31 " \ "All Files (*.*)\t*.*\n"
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
32 "endif
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
33
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
34 " Let the matchit plugin know what items can be matched.
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
35 if ! exists("b:match_words") && exists("loaded_matchit")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
36 let b:match_ignorecase=1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
37 let s:notend = '\%(\<end\s\+\)\@<!'
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
38 let b:match_words =
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
39 \ s:notend.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
40 \ s:notend.'\<case\>:\<when\>:\<end\s\+case\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
41 \ s:notend.'\<loop\>:\<end\s\+loop\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
42 \ s:notend.'\<for\>:\<end\s\+for\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
43 \ s:notend.'\<generate\>:\<end\s\+generate\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
44 \ s:notend.'\<record\>:\<end\s\+record\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
45 \ s:notend.'\<units\>:\<end\s\+units\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
46 \ s:notend.'\<process\>:\<end\s\+process\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
47 \ s:notend.'\<block\>:\<end\s\+block\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
48 \ s:notend.'\<function\>:\<end\s\+function\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
49 \ s:notend.'\<entity\>:\<end\s\+entity\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
50 \ s:notend.'\<component\>:\<end\s\+component\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
51 \ s:notend.'\<architecture\>:\<end\s\+architecture\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
52 \ s:notend.'\<package\>:\<end\s\+package\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
53 \ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
54 \ s:notend.'\<configuration\>:\<end\s\+configuration\>'
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
55 endif
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
56
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
57 " count repeat
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
58 function! <SID>CountWrapper(cmd)
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
59 let i = v:count1
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
60 if a:cmd[0] == ":"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
61 while i > 0
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
62 execute a:cmd
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
63 let i = i - 1
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
64 endwhile
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
65 else
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
66 execute "normal! gv\<Esc>"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
67 execute "normal ".i.a:cmd
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
68 let curcol = col(".")
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
69 let curline = line(".")
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
70 normal! gv
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
71 call cursor(curline, curcol)
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
72 endif
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
73 endfunction
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
74
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
75 " explore motion
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
76 " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
77 let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
78 noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
79 noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
80 noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
81 noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
82 vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
83 vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
84 vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
85 vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
86
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
87 let &cpo = s:cpo_save
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 671
diff changeset
88 unlet s:cpo_save