xp is a quick way in vi to swap two adjacent characters (a common typo correction)
Ctrl-T does the same in emacs, and also in readline based programs like bash, as well as everywhere on macOS.
Ctrl-T does the same in emacs, and also in readline based programs like bash, as well as everywhere on macOS.
I always thought the fact that Vim had automatic buffer copying and forced me to use "0p instead of p was really annoying. Looks like there is an actual reason for it after all :)
Not specifying a register (e.g. "0) just means the commands, including x and p, will use the " register, aka the unnamed register. By itself, p is equivalent to ""p.
:reg shows you all the registers and their current contents.
This seems like a good description: https://www.brianstorti.com/vim-registers/
Edit: Oh I guess you are saying it was unexpected that delete or change commands clobber yanked contents of the unnamed register.