From 6bb5bdcbb72d3770dc294a17e24b9b63c143f756 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Fri, 4 Nov 2016 18:21:37 +0100 Subject: [PATCH] inoffical merge of .dia hightlighting with master (cip) --- vim/rc | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/vim/rc b/vim/rc index 8b593ad..e133807 100644 --- a/vim/rc +++ b/vim/rc @@ -120,20 +120,19 @@ if @% =~ ".*.dia" hi def link regie Operator hi def link text String hi def link badcode ErrorMsg - hi def link branch TODO -endif -"highlight branch in .dia is go back to insertmode -inoremap :execute HL_branch() -nnoremap :execute HL_branch() + + "highlight branch in .dia is go back to insertmode + inoremap ma:execute HL_branch():set hlsearch`a + nnoremap ma :execute HL_branch():set hlsearch`a + nnoremap w gma :execute HL_branch():set hlsearch `a + nnoremap s gma :execute HL_branch():set hlsearch `a -nnoremap w g:execute HL_branch() -nnoremap s g:execute HL_branch() - -function HL_branch() -let line=getline('.') -"backslash muss escaped werden um + zu escapen in func -if line =~ "\[A-Z]\\+.*:" + "function for highlighting + function HL_branch() + let line=getline('.') + "backslash muss escaped werden um + zu escapen in func + if line =~ "\[A-Z]\\+.*:" python << endpython import vim l = vim.current.line @@ -146,9 +145,9 @@ for tmp in llist[0]: break l = llist[0][i:] #escaped \ for py AND vim -vim.command('let tmp=":execute \'normal /[A-Z]\\\\+%s.*:\\``\'"'% l) +vim.command("let @/='[A-Z]\+%s.*:'"% l) endpython -return tmp + endif + return "echo ''" + endfunction endif -return "echo ''" -endfunction