Skip to content

Instantly share code, notes, and snippets.

@rainux
Forked from sikachu/.vimrc
Created February 2, 2012 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rainux/1722405 to your computer and use it in GitHub Desktop.
Save rainux/1722405 to your computer and use it in GitHub Desktop.
" Highlight Ruby 1.8.x hash rocket
" This will prevent us to ever write it again
highlight ObsoleteHashRocket ctermbg=red guibg=red
au ColorScheme * highlight ObsoleteHashRocket guibg=red
au BufEnter * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
au InsertEnter * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
au InsertLeave * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
#!/usr/bin/ruby
Dir['**/*.{rb,erb}'].each do |filename|
content = File.read(filename)
File.open(filename, "w"){ |f| f.write content.gsub(/:([a-z0-9_]+)\s?=>/, "\\1:") }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment