From 91a34032ca66181a8374daa419dce4d97537b5d5 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 21 Jun 2010 00:26:12 +0200 Subject: Fixed highlighting and xquery and xml syntax --- .vim/test.vim | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .vim/test.vim (limited to '.vim/test.vim') diff --git a/.vim/test.vim b/.vim/test.vim new file mode 100644 index 0000000..823f08c --- /dev/null +++ b/.vim/test.vim @@ -0,0 +1,34 @@ +" To use, save this file and type ":so %" +" Optional: First enter ":let g:rgb_fg=1" to highlight foreground only. +" Restore normal highlighting by typing ":call clearmatches()" +" +" Create a new scratch buffer: +" - Read file $VIMRUNTIME/rgb.txt +" - Delete lines where color name is not a single word (duplicates). +" - Delete "grey" lines (duplicate "gray"; there are a few more "gray"). +" Add matches so each color name is highlighted in its color. +call clearmatches() +new +setlocal buftype=nofile bufhidden=hide noswapfile +0read rgb.txt +let find_color = '^\s*\(\d\+\s*\)\{3}\zs\w*$' +silent execute 'v/'.find_color.'/d' +silent g/grey/d +let namedcolors=[] +1 +while search(find_color, 'W') > 0 + let w = expand('') + call add(namedcolors, w) +endwhile + +for w in namedcolors + execute 'hi col_'.w.' guifg=black guibg='.w + execute 'hi col_'.w.'_fg guifg='.w.' guibg=NONE' + execute '%s/\<'.w.'\>/'.printf("%-36s%s", w, w).'/g' + + call matchadd('col_'.w, '\<'.w.'\>', -1) + " determine second string by that with large # of spaces before it + call matchadd('col_'.w.'_fg', ' \{10,}\<'.w.'\>', -1) +endfor +1 +nohlsearch -- cgit v1.2.3-54-g00ecf