Permalink
Browse files

Add in cocoa.vim and objc syntax hilighting

  • Loading branch information...
1 parent 35ec491 commit a7b01fb22a109d9474f635a853e0d2c761887115 @asivitz committed Jan 9, 2012
Showing with 87 additions and 2 deletions.
  1. +3 −0 .gitmodules
  2. +8 −0 after/syntax/objc.vim
  3. +1 −0 bundle/cocoa
  4. +5 −0 colors/desert256.vim
  5. +5 −0 colors/moria.vim
  6. +65 −0 plugin/SyntaxAttr.vim
  7. +0 −2 vimrc
View
@@ -55,3 +55,6 @@
[submodule "bundle/vim-gnupg"]
path = bundle/vim-gnupg
url = git://gitorious.org/vim-gnupg/vim-gnupg.git
+[submodule "bundle/cocoa"]
+ path = bundle/cocoa
+ url = git@github.com:radicalbit/cocoa.vim.git
View
@@ -0,0 +1,8 @@
+syn match parens /[(){}]/
+syn match punctuation "[-&|+<>=*!~\;:]"
+syn match braces /[\[\]]/
+"syn match atdec '@[[:alnum:]]*'
+
+
+
+" vim: set fdl=0 fdm=marker:
Submodule cocoa added at 50dc97
View
@@ -291,6 +291,11 @@ if has("gui_running") || &t_Co == 88 || &t_Co == 256
call <SID>X("PmenuSel", "000000", "63B3FF", "")
call <SID>X("SpellBad", "000000", "63B3FF", "")
+ call <SID>X("punctuation", "0071DB", "", "")
+ call <SID>X("objcMethodParens", "56CC63", "", "")
+ call <SID>X("parens", "56CC63", "", "")
+ call <SID>X("braces", "0071DB", "", "")
+
" delete functions {{{
delf <SID>X
delf <SID>rgb
View
@@ -163,3 +163,8 @@ elseif s:moria_style == "light"
hi htmlBoldUnderlineItalic guibg=bg guifg=fg gui=bold,underline,italic
hi htmlUnderlineItalic guibg=bg guifg=fg gui=underline,italic
endif
+
+hi punctuation guifg=#0071DB
+hi objcMethodParens guifg=#56CC63
+hi parens guifg=#56CC63
+hi braces guifg=#0071DB
View
@@ -0,0 +1,65 @@
+" EXAMPLE SETUP
+"
+" Show the syntax group name of the item under cursor.
+" map -a :call SyntaxAttr()<CR>
+
+function! SyntaxAttr()
+ let synid = ""
+ let guifg = ""
+ let guibg = ""
+ let gui = ""
+
+ let id1 = synID(line("."), col("."), 1)
+ let tid1 = synIDtrans(id1)
+
+ if synIDattr(id1, "name") != ""
+ let synid = "group: " . synIDattr(id1, "name")
+ if (tid1 != id1)
+ let synid = synid . '->' . synIDattr(tid1, "name")
+ endif
+ let id0 = synID(line("."), col("."), 0)
+ if (synIDattr(id1, "name") != synIDattr(id0, "name"))
+ let synid = synid . " (" . synIDattr(id0, "name")
+ let tid0 = synIDtrans(id0)
+ if (tid0 != id0)
+ let synid = synid . '->' . synIDattr(tid0, "name")
+ endif
+ let synid = synid . ")"
+ endif
+ endif
+
+ " Use the translated id for all the color & attribute lookups; the linked id yields blank values.
+ if (synIDattr(tid1, "fg") != "" )
+ let guifg = " guifg=" . synIDattr(tid1, "fg") . "(" . synIDattr(tid1, "fg#") . ")"
+ endif
+ if (synIDattr(tid1, "bg") != "" )
+ let guibg = " guibg=" . synIDattr(tid1, "bg") . "(" . synIDattr(tid1, "bg#") . ")"
+ endif
+ if (synIDattr(tid1, "bold" ))
+ let gui = gui . ",bold"
+ endif
+ if (synIDattr(tid1, "italic" ))
+ let gui = gui . ",italic"
+ endif
+ if (synIDattr(tid1, "reverse" ))
+ let gui = gui . ",reverse"
+ endif
+ if (synIDattr(tid1, "inverse" ))
+ let gui = gui . ",inverse"
+ endif
+ if (synIDattr(tid1, "underline"))
+ let gui = gui . ",underline"
+ endif
+ if (gui != "" )
+ let gui = substitute(gui, "^,", " gui=", "")
+ endif
+
+ echohl MoreMsg
+ let message = synid . guifg . guibg . gui
+ if message == ""
+ echohl WarningMsg
+ let message = "<no syntax group here>"
+ endif
+ echo message
+ echohl None
+endfunction
View
2 vimrc
@@ -334,5 +334,3 @@ map - <Leader>c<Space>
" --- EasyMotion
let g:EasyMotion_leader_key = '<Leader>m'
-
-

0 comments on commit a7b01fb

Please sign in to comment.