Skip to content

Instantly share code, notes, and snippets.

@lkosak
Forked from foxyblocks/gist:2314735
Created April 10, 2012 17:28
Show Gist options
  • Save lkosak/2353063 to your computer and use it in GitHub Desktop.
Save lkosak/2353063 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 = &ft == 'ruby'
let php = &ft == 'php'
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