4 ms·
Some things feel unnatural about vim. For instance I always tend to remap its default paste behavior to more commonly used one, and claims that one has to "adju
by shmerl 11y ago
Some things feel unnatural about vim. For instance I always tend to remap its default paste behavior to more commonly used one, and claims that one has to "adjust muscular memory" don't sound convincing to me when it introduces a drastic inconsistency.
Most editors paste text before the cursor position, and also set cursor position after the pasted text (after pasting). Vim defaults are different. If you press "p" it pastes after the cursor, and as well puts cursor on the last character of the pasted text (not after!). Vim offers an option that's similar to common behavior. It's "gP" (instead of "p"), so I usually remap p to act as gP, since that's what I use all the time:
noremap p gP
noremap P gp
noremap gp P
noremap gP p
Another thing that's commonly different in vim, is that when you select text in visual mode, it picks the character under cursor as well i.e. beyond the highlighted area. Most editors only select it until the cursor, and not including. Luckily this is also configurable with
set selection=exclusive
May be in vim it was always the other way for historic reasons, but consistency is convenient and at least in my case all other editors / text forms that I use (including browsers) act differently from vim defaults in regards to select / copy / paste behavior.
- veddox 11y ago> claims that one has to "adjust muscular memory" don't sound convincing to me when it introduces a drastic inconsistency Sorry, emacs user here... I just wanted to say that adjusting muscular memory can go faster than you expect. I learnt how to use emacs a couple of months ago, and have recently noticed the tendency to do ctrl-x + ctrl-s to save, or ctrl-y to paste, even when not in emacs ;-) The latter can be a bit annoying, but learning emacs was such a big plus that I don't mind much. The article on vim sounds interesting, I tried and gave up learning it some time back, I should definitely revisit it again.
- shmerl 11y agoI don't mean you can't adjust muscular memory - you can. But when behavior is inconsistent (like pasting I described above), you need to switch it each time you use something that's not vim. For me it's not about what key combination to press - that's not as hard to switch, but more about what behavior to expect from the action "paste" and etc.