Created
February 5, 2014 09:18
-
-
Save nelstrom/8819893 to your computer and use it in GitHub Desktop.
A Vim function to transform words to "stitch words", e.g. "Seattle" becomes "S-e-a-t-t-l-e"
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
function! StitchWord(word) | |
let word = substitute(a:word, '\v(\w)', '\1-', 'g') | |
let word = substitute(word, '\v(\w)-$', '\1', 'g') | |
return word | |
endfunction | |
inoremap <c-x>- <c-o>ciw<C-r>=StitchWord(@@)<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment