1

I'm using Git's MINGW64 bash shell to run vim and vimtutor. I managed to change the movement key bindings via e: $MYVIMRC, but the changes in keybindings do not apply to vimtutor.

When I open vimtutor, all the keybindings are the default ones. When I use the e: $MYVIMRC in vimtutor, it shows the same vimrc file that vim uses, but it does not change the keybindings.

Is there a way to apply vimrc to vimtutor?


Unrelated question, but the key binding change that I want is changing the navigation keys from "hjlk" to "jkl;". The latter seems more natural to me; it makes more sense for my pointer finger to be on j because that's where the key bump is.

A friend told me that you end up not using the left and right navigation buttons very much, so that this doesn't matter. Is this correct? Will switching the navigation buttons in this way hurt my overall vim experience?

1

Simple answer, yes, all you need to do is run the :so[urce] command from within vimtutor:

:source ~/_vimrc

(change the path to wherever your vimrc is located. Inside vim you can always use forward slashes as a path separator even on windows, they're less confusing because vim often uses \ as an escape character).

However vimtutor deliberately doesn't load personal configuration by default, because it's purpose is to teach you vim's default keybinings. I'd recommend learning the defaults first so you know what functionality you're changing/potentially loosing when you rebind keys (rebinding hjkl to jkl; will prevent use of ; for it's original meaning). Vim's keybindings come in patterns that make them easier to remember, and if you rebind stuff before learning said patterns you might not notice them.

Note: there's no reason to move your hand when using hjkl, I use the same finger for both h and j, it's no problem because it's rare to have to suddenly transition between them.

Edit: spelling, grammar

  • 1
    it maybe better to use terms like e, E, w, b, /, ? to navigate. What I found after using hjkl, is that I was using these as a cructch to not learn about the real motion commands that make moving in vim much faster: vi.stackexchange.com/questions/7378/… – alpha_989 Jun 9 '18 at 19:38
  • 1
    Spot on @alpha_989. If you can remember the last time you used h,j,k,l to move more than a couple characters or a line or two then you're not doing it right. ;) – B Layer Jun 10 '18 at 0:07
  • I do sometimes use gj from time to time to move a few lines up or down.. when nobody is watching ;) – alpha_989 Jun 10 '18 at 1:51
0

vimtutor is really a shell script which starts vim with no vimrc-s and with the following vimscript $VIMRUNTIME/tutor/tutor.vim'.

On linux systems, you can find the location of this script using

which vimtutor.

You can find the location of tutor.vim in Windows, and then change the line in the shell script

$VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'

to

$VIM -f -c 'so $VIMRUNTIME/tutor/tutor.vim'

so that it loads it up with the default vimrc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.