From 1d2ba7fa851f988ea9eab47b7662be243f85ddfa Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 14 Feb 2006 22:29:30 +0000 Subject: updated for version 7.0197 --- runtime/indent/vhdl.vim | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'runtime/indent/vhdl.vim') diff --git a/runtime/indent/vhdl.vim b/runtime/indent/vhdl.vim index e510f3c8f..82f0f834b 100644 --- a/runtime/indent/vhdl.vim +++ b/runtime/indent/vhdl.vim @@ -1,8 +1,8 @@ " VHDL indent ('93 syntax) " Language: VHDL " Maintainer: Gerald Lai -" Version: 1.3 -" Last Change: 2006 Jan 31 +" Version: 1.34 +" Last Change: 2006 Feb 11 " URL: http://www.vim.org/scripts/script.php?script_id=1450 " only load this indent file when no other was loaded @@ -17,13 +17,35 @@ setlocal indentkeys=!^F,o,O,e,0(,0) setlocal indentkeys+==~if,=~then,=~elsif,=~else setlocal indentkeys+==~begin,=~is,=~select,=~-- -" move around +" count repeat +function! CountWrapper(cmd) + let i = v:count1 + if a:cmd[0] == ":" + while i > 0 + execute a:cmd + let i = i - 1 + endwhile + else + execute "normal! gv\" + execute "normal ".i.a:cmd + let curcol = col(".") + let curline = line(".") + normal! gv + call cursor(curline, curcol) + endif +endfunction + +" explore motion " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units" let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)' -nnoremap [[ :cal search('\%(\\c','bW') -nnoremap ]] :cal search('\%(\\c','W') -nnoremap [] :cal search('\\c','bW') -nnoremap ][ :cal search('\\c','W') +noremap [[ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') +noremap ]] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') +noremap [] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') +noremap ][ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') +vnoremap [[ :cal CountWrapper('[[') +vnoremap ]] :cal CountWrapper(']]') +vnoremap [] :cal CountWrapper('[]') +vnoremap ][ :cal CountWrapper('][') " constants " not a comment -- cgit v1.2.3