Open ghost opened 8 years ago
What would an implementation look like? This sounds way more complicated than character transposition.
Really robust DWIM transposition is very slick (smartparens is pretty good), but as with all DWIM things tends to have some fuzzy edges.
I've come to view https://github.com/tommcdo/vim-exchange as the Vim alternative to transposition.
I don't know, I took your way of using meta and put
" transpose characters:
noremap! <M-T> <esc>xhPla
" words:
noremap! <M-t> <esc>diwbPa <esc>ea
if !has("gui_running") " from tpope/vim-rsi
silent! exe "set <F36>=\<esc>t"
silent! exe "set <F37>=\<esc>T"
map! <F36> <M-t>
map! <F37> <M-T>
map <F36> <M-t>
map <F37> <M-T>
endif
into my .vimrc. Of course, this doesn't work for the ex-line.
There is also https://github.com/vim-scripts/transpose-words
How about including word transposition with m-t?