Hacker News new | ask | show | jobs
by AndrewRadev 5023 days ago
Well, in your case, you could put a definition for javascript. The built-in "ruby hash style" transformation should work for this:

    " in ftplugin/javascript.vim
    let b:switch_definitions =
          \ [
          \   g:switch_builtins.ruby_hash_style
          \ ]
With this, in a javascript file, you can turn ":foo => 'bar'" entries into "foo: 'bar'" ones.

If you do need global (non-filetype) switches, you could define some by placing them in the g:switch_definitions variable. Read up on the docs if you want more information.