You can use the :split function of vim to separate a given string to all its different character.
The basic split function that would do it for you would be something like:
split(current_word, '\zs')
A full command that would actually do the split is:
:execute "normal ciw" . string(split(expand("<cword>"), '\zs'))
If you would like, you can create a function that would change the current word to its different characters.
The function would be:
function! SplitCurrentWord()
let current_word = expand("<cword>")
normal ciw
for current_char in split(current_word, '\zs')
execute "normal a\'" . current_char . "\', "
endfor
normal "xxx"
endfunction
You can add it to your vimrc and load it when needed, or map it to a command or a set of keys.
(with command! SplitWord call SplitCurrentWord)
:s/./'&', /gis a bit shorter and (depending on the keyboard) might be easier to type. – Jürgen Krämer May 08 '19 at 14:33&represents the whole matched pattern. In this case, the pattern is any single character. So using&is the same as capturing the single character and using\1, in a cleaner way. – padawin May 12 '19 at 09:05