vim-rsi icon indicating copy to clipboard operation
vim-rsi copied to clipboard

m-t

Open ghost opened this issue 10 years ago • 4 comments

How about including word transposition with m-t?

ghost avatar Jan 06 '16 23:01 ghost

What would an implementation look like? This sounds way more complicated than character transposition.

tpope avatar Jan 07 '16 00:01 tpope

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.

justinmk avatar Jan 07 '16 01:01 justinmk

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.

ghost avatar Jan 07 '16 16:01 ghost

There is also https://github.com/vim-scripts/transpose-words

jlesquembre avatar Mar 07 '20 10:03 jlesquembre