This file contains hidden or 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
| " https://github.com/tangledhelix/dotfiles/blob/master/vim/plugin/twiddlecase.vim | |
| " Toggles between uppercase, lowercase, titlecase. Bind to a mapping, then | |
| " select something and keep hitting the map until you get what you want. | |
| function! TwiddleCase(str) | |
| if a:str ==# toupper(a:str) | |
| let result = tolower(a:str) | |
| elseif a:str ==# tolower(a:str) | |
| let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g') | |
| else |