-
-
Save lkosak/2353063 to your computer and use it in GitHub Desktop.
easy vim hash=>rocket and php $object->thingy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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