Having `f =` move to either => or ⇒

scala, vim

Solution

Try adding this to your vimrc:

nmap f= :call search('=\\|⇒')<CR>

That will alias (map) `f=` to a call to the search function that will jump to the next `=` or `⇒`.

Problem

I edit a lot of Scala code in Vim, which means I hit `f =` a lot, as I head to the RHS of a case statement (or whatever else): ``` case PatternMatch(a, b, c) => RHS Here ``` But Scala supports unicode characters, which means that a lot of people will use `⇒` instead of `=>` and that makes `f ...` a pain in the butt. Does anyone know how if there's a way to make `f =` move to the next `=` or `⇒`, whichever comes first?

Original source