From 4b72126e904eb4dd9f07ab6ce20e0ae363d7b743 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Sun, 30 Oct 2016 01:58:31 +0200 Subject: [PATCH] working on branch higlighting --- vim/rc | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/vim/rc b/vim/rc index 3feadb2..75f088b 100644 --- a/vim/rc +++ b/vim/rc @@ -70,6 +70,7 @@ nnoremap cc dd nnoremap cl dd "dene (cc works too) nnoremap ce dw +nnoremap cq cb "delete next word "copy/paste (y is the vim default, Ctrl-c is for many GUI programs and windows) nnoremap yr y$ @@ -104,7 +105,7 @@ nnoremap s :mksession "highlighting for .dia if 1 == 1 syntax match nodeID "N.*:" - syntax match leaveID "[A-MO-Z].*:" + syntax match leaveID "[A-MO-Z]\+.*:" syntax match annotation "[%@].*" @@ -115,7 +116,33 @@ if 1 == 1 hi def link nodeID Structure hi def link leaveID Tag hi def link annotation Function - hi def link regie String - hi def link text Visual + 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 :call HL_branch() +nnoremap :call HL_branch() + +function HL_branch() +let line=getline('.') +"why does this not work with \+ like above??? +if line =~ "\[A-Z].*:" +python << endpython +import vim +l = vim.current.line +llist = l.split(":") +i = 0 +for tmp in llist[0]: + if tmp <= 'Z' and tmp >= 'A': + i += 1 + else: + break +l = llist[0][i:] +vim.command("let l='%s'"% l) +endpython +echom l +endif +endfunction