summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2010-11-26 22:18:53 +0530
committerRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2010-11-26 22:18:53 +0530
commit46fe851b2406d2a512f97c10f94830959afd0fd1 (patch)
tree1392ca42a8ace60f0cb362f578cfa8679c09fa93
downloadcomceal-46fe851b2406d2a512f97c10f94830959afd0fd1.tar.gz
comceal-46fe851b2406d2a512f97c10f94830959afd0fd1.tar.bz2
comceal-46fe851b2406d2a512f97c10f94830959afd0fd1.zip
Initial comceal commit
-rw-r--r--after/plugin/comceal.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/after/plugin/comceal.vim b/after/plugin/comceal.vim
new file mode 100644
index 0000000..261833f
--- /dev/null
+++ b/after/plugin/comceal.vim
@@ -0,0 +1,31 @@
+
+ " we need the conceal feature (vim ≥ 7.3)
+ if !has('conceal')
+ finish
+ endif
+
+ " remove the keywords. we'll re-add them below
+ if ! &ft
+ finish
+ endif
+
+
+ let commentType=&ft."Comment"
+
+ syntax cluster matchi add=&ft."Comment"
+ syntax match matchComment "" contains=@matchi conceal cchar=Ξ
+
+ hi! link matchComment Comment
+ set conceallevel=2
+
+ nnoremap <silent> <leader>C :call comceal#toggle()<CR>
+
+fun! comceal#toggle()
+ if !exists('s:counter')
+ let s:counter = 0
+ else
+ let s:counter += 1
+ let s:counter = s:counter % 3
+ endif
+ setlocal conceallevel=s:counter
+endfun