Skip to content

Instantly share code, notes, and snippets.

@foxyblocks
Created April 5, 2012 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save foxyblocks/2314735 to your computer and use it in GitHub Desktop.
Save foxyblocks/2314735 to your computer and use it in GitHub Desktop.
easy vim hash=>rocket and php $object->thingy
"Paste into your .vimrc
" for insert mode remap <c-l> to:
" Insert a hash rocket for ruby
" Insert a -> for php
function! SmartHash()
let ruby = match(expand("%"), '\(.rb\|.haml\)$') != -1
let php = match(expand("%"), '.php') != -1
if php
return "\->"
end
if ruby
return "\ => "
end
return ""
endfunction
imap <c-l> <c-r>=SmartHash()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment