summaryrefslogtreecommitdiff
path: root/.vim/test.vim
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-06-21 00:26:12 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-06-21 00:26:13 +0200
commit91a34032ca66181a8374daa419dce4d97537b5d5 (patch)
treed25de110ef23706804f484745a0b410328ceb7dc /.vim/test.vim
parentd36eb0c0424d926f8b31acc55b10f95aac6f5ba3 (diff)
downloaddotfiles-91a34032ca66181a8374daa419dce4d97537b5d5.tar.gz
dotfiles-91a34032ca66181a8374daa419dce4d97537b5d5.tar.bz2
dotfiles-91a34032ca66181a8374daa419dce4d97537b5d5.zip
Fixed highlighting and xquery and xml syntax
Diffstat (limited to '.vim/test.vim')
-rw-r--r--.vim/test.vim34
1 files changed, 34 insertions, 0 deletions
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('<cword>')
+ 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