Frage

What are the pros and cons of changing vim's default keybindings? How far is too far? As a new learner of vim, I already have a glimpse of its power, but I am also much bothered by some key-bindings that don't make sense to me. Already, I have mapped <c-l> and <c-h> to w and b respectively. Now I'm itching to find a new key for $ so that I won't have to press shift just to go to the end of line. To my mind, the basic motion keys should be one-button operations (my mapping above notwithstanding, I still use w and b in conjunction with d and c etc), and spatial logic should trump symbolic logic in deciding their placements. - is currently my candidate for replacing $ because as a shift-free key to the right of 0 (for the beginning of line).

Should I go ahead, and thus opening the floodgate for potentially myriads of other changes? Or should I try to adapt to the default? One thing that's holding me back is my concern about unintended consequences that I, as a newbie, cannot foresee, including loss of functionality (such as what the - currently does, which doesn't seem like much to me). In addition, I'm not sure how I feel about customizing vim so much that I can work only with my vim and no others. Are these concerns valid or overblown? Thanks.

War es hilfreich?

Lösung 2

I say, go for it. Although it appears that you have already learned the vim model essentials somewhat well, there's no reason not to adjust it to your personal needs and preferences. One shouldn't aim to target the lower common denominator, even if "plain vi" is pretty high as such. Although I don't exactly know what's the case with C-l and C-h if you also use w and b comfortably, there's always a case for meaningful helpers.

If you are worried about ssh'ing to foreign machines without your vim configs, worry no more. Vim has a satisfactory remote editing capabilities; edit over SSH/SCP locally.

Andere Tipps

While I agree that some vim key-bindings can be awkward, you should start off following the defaults in the beginning. After some time most of it becomes muscle memory and it shouldn't bother you much. If after a long time you still feel uncomfortable, feel free to rebind some keys. For example I have <CTRL-S> bound to save because it's easier than pressing <ESC>:w<CR> and less confusing when I'm working with other editors.

If you start rebinding too many keys too early, you will find it frustrating to use vanilla vim (for example on a remote machine).

As for your examples, I personally think <c-l> and <c-h> are harder to press than w and b. For example cw is a common vim operation and can be done using one hand compared to c<c-l>.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top