tpope / vim-rsi

rsi.vim: Readline style insertion
http://www.vim.org/scripts/script.php?script_id=4359
583 stars 35 forks source link

m-t #32

Open ghost opened 8 years ago

ghost commented 8 years ago

How about including word transposition with m-t?

tpope commented 8 years ago

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

justinmk commented 8 years ago

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.

ghost commented 8 years ago

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.

jlesquembre commented 4 years ago

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