Created
May 27, 2013 07:08
-
-
Save othree/5655583 to your computer and use it in GitHub Desktop.
Switch between different case type: camelCase -> MixedCase -> snake_case -> UPPER_CASE -> dash-case -> camelCase
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
let g:switch_custom_definitions = | |
\ [ | |
\ { | |
\ '\<\(\l\)\(\l\+\(\u\l\+\)\+\)\>': '\=toupper(submatch(1)) . submatch(2)', | |
\ '\<\(\u\l\+\)\(\u\l\+\)\+\>': "\\=tolower(substitute(submatch(0), '\\(\\l\\)\\(\\u\\)', '\\1_\\2', 'g'))", | |
\ '\<\(\l\+\)\(_\l\+\)\+\>': '\U\0', | |
\ '\<\(\u\+\)\(_\u\+\)\+\>': "\\=tolower(substitute(submatch(0), '_', '-', 'g'))", | |
\ '\<\(\l\+\)\(-\l\+\)\+\>': "\\=substitute(submatch(0), '-\\(\\l\\)', '\\u\\1', 'g')", | |
\ } | |
\ ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lua adaptation using lazy-nvim: