
Interactive Vim tutorial - ashitlerferad
http://www.openvim.com
======
sevensor
Alternatively, don't try to hurry enlightenment.

First, learn

    
    
        :q!
    

Next

    
    
        h,j,k,l
    

Then

    
    
        i and ESC
    

Finally

    
    
        :w
    

Now you know vim. Don't let people tell you you're using too many keystrokes.
Are you still reaching for the mouse? If not, you're using vim just fine.

Most of the good stuff in vim, you'll learn accidentally, because you're in
normal mode when you think you're in insert mode, or because you have caps
lock on in normal mode and you don't realize it. Pay attention to the bizarre
behavior that results and you'll learn useful tricks. Mode confusion is a
feature, not a bug.

For the rest, there are certain topics that reward study and are unlikely to
present themselves to you accidentally, but there's no hurry unless you're
feeling the pain of not knowing them. I recommend:

1\. Visual selection mode

2\. Prefixing counts to commands

3\. Search and replace with regular expressions

4\. Advanced cursor movements

Lastly, if you're using gvim, do

    
    
        :set guioptions=
    

at the beginning of every session. Those GUI elements will tempt you to use
the mouse, when that's almost never an appropriate thing to do.

Edit: learning to use x and d early on is probably also a good idea, if like
me you're the kind of person who makes mistakes.

~~~
edanm
Sorry, but I think that's really bad advice.

For one thing, it doesn't give new users any positive experience or _reason_
to learn vim. If all you learn is to do things that are "pointless" (like
learning hjkl), then you won't get any value out of vim. And if your way of
learning is to do something that screws up your file and try to recreate how
that happened, well, let's just say that every time I do something that screws
up my file I'm in the middle of working, and the _last_ thing I want is to
stop and fix some random problem.

I usually recommend people try to get into vim easily, then learn the GOOD
things. I.e. I think it's perfectly fine that people start with arrow keys,
much as I love hjkl. But to get _value_ out of vim, you should really learn
"f" and "t", and text objects, then how they compose with "c" and "d". That is
the reason I started loving vim myself - that's when I saw that it gives me
something that other editors didn't give me, adn that encouraged me to explore
further.

~~~
sevensor
I think we just don't agree about what the good parts of vim are. I find f and
t to be a minute improvement over forward search. I think hjkl is strictly
better than arrow keys, because you don't have to move your fingers from the
home row to navigate a file, and I think the basic editing commands I outlined
are sufficient for a superior editing experience within a day of learning
them, no deep study required.

~~~
autokad
i'm sure it becomes intuitive with lots of use, bit i find it awkward with
having to move my finger off the home keys to move left. somehow for me, its
even more confusing that way. where as my arrow keys are completely intuitive,
one finger for the left and right keys and the middle finger handles up down.
to me its not a big deal to remove my fingers from the home row if i already
have to move from the home keys.

------
icc97
All these tutorials are like taking beginner French. If you want to learn
French live in France. If you want to learn Vim you have to live in it. Use it
for your development full time. Then over time you start to see it's power.

For me on Windows, GVim was the only sane option. Mostly because the Windows
console can't fully handle syntax highlighting / italics. However it's also a
good transition world. You've got all the power of Vim but quite a few of the
commands you'd expect still work. I've practically never need them but it's
handy to reduce the confusion / frustration

~~~
yasserkaddour
I fully agree with you, however some people are worried by the loss of their
daily productivity especially if they are used to using their mouse a lot, for
those I will recommend to start learning vim in their browser to surf mouse-
free using plugins like SurfingKeys[1], vimium[2](chrome),
Vimperator[3](Firefox). Once used to surf without reaching to the mouse and
know the essential vim key, you'll be ready to use vim daily for your dev
work, without a big loss in initial productivity.

[1]
[https://github.com/brookhong/Surfingkeys](https://github.com/brookhong/Surfingkeys)

[2] [https://vimium.github.io/](https://vimium.github.io/)

[3] [https://addons.mozilla.org/en-
US/firefox/addon/vimperator/](https://addons.mozilla.org/en-
US/firefox/addon/vimperator/)

~~~
maddyboo
I cannot recommend SurfingKeys highly enough; it's a phenomenal extension.

------
mushishi
Author here.

The tutorial succeeds if it gets people to have a superficial comprehension
what Vim is about -- especially for those that have been putting off trying it
out in a terminal. That's it. It doesn't really try to make you actually learn
Vim.

As a tutorial it could be made so much better. I don't have the energy slots
for this project. But I feel anxious when I get feedback because I feel like
there's some moral duty to fix the site. The least I can do is to pay for the
hosting so that people get to have a go with it as it seems some people like
it.

Just to make clear: the Vim behaviour is modelled and is not just trivial
precoding of keystream. There is a sandbox where you have contextual helper at
the right side of the screen. You can play around with it to your heart's and
battery's content. But it is merely a simplistic version of Vim.

Development-wise the most fun aspect of the tutorial was the DSL for tests.
For some reason (haven't really updated the code properly in years) many
fails. But click on the individual tests and you see something fun.
[http://openvim.com/tests.html](http://openvim.com/tests.html) See the
corresponding code here:
[https://github.com/egaga/openvim/blob/87b9e1d62c4144c958ddf8...](https://github.com/egaga/openvim/blob/87b9e1d62c4144c958ddf81f9a9b4b10577cea0d/js/testing/tests.js#L25)

The actual code is modelled operating on html elements. This was a fun side
project, so please don't be too critical. It grew bigger than anticipated.

~~~
batisteo
Your side project made me switch from Nano to Vim on my servers through SSH. I
aprehended vim with fear, and now I have the right level of confidence. Thank
you!

~~~
mushishi
That is heartwarming to hear :) You're welcome!

------
andkenneth
I started going through it, and unfortunately it takes control away from you
way too often. I want to be able to toy around with the concepts after I learn
them. I'd still recommend `vimtutor`.

~~~
doktrin
'vim adventures' also seems fun, but it's not quite the same (for me) without
the context of actually navigating a text document.

~~~
travmatt
I picked up vim very well from vim adventures. Once I finished the game those
key movements were in my muscle memory, and that’s all that was really needed
to get me up and running.

------
elliotec
Here’s how I “learned” vim and many of the more proficient vimmers I know did
too: go through vimtutor (type “vimtutor” on your command line), then write
YOUR OWN .vimrc - in vim. Then use it and learn by doing.

~~~
nickysielicki
I disagree with the notion that you have to write your own vimrc from scratch
in order to become a proficient vim user. Don't waste your time pouring over
the documentation and trying to get things just right, vim is a pretty old
program and a lot of useful config options are not on by default, nor are they
easy to understand by a skim of the documentation. There's no point to having
a deep understanding of them, because you want them on 100% of the time.

Start by copying someone else's vimrc (vim-sensible [1] is a great starting
point) and tweak it as needed. My $0.02 is to avoid plugins until you have
used vim for a substantial amount of time.

[1]: [https://github.com/tpope/vim-
sensible/blob/master/plugin/sen...](https://github.com/tpope/vim-
sensible/blob/master/plugin/sensible.vim)

~~~
elliotec
I strongly disagree with your disagreement, but that's ok.

Writing my own vimrc from scratch (but obviously referencing others) was by
far THE best learning tool for me.

------
Ajedi32
Went through the tutorial, but I still don't think I really get why so many
people seem to like Vim so much. The only thing there I noticed which was new
to me from a functionality standpoint was the repeated commands feature.

Anyone have some better examples of things you can do with Vim that make it
worth learning over a GUI-based editor like Atom?

~~~
et1337
I think the strongest arguments for vim are:

1\. The main benefit of vim or any editor is not some fancy feature like
macros or visual block editing. Although vim has those and they are great,
they only become useful in about 20% of situations. When coding, you spend
much more time reading code than writing it. That's why vim has you in Normal
mode most of the time, where you can't type at all, and the whole keyboard
becomes a tool for navigating. Reaching for the mouse incurs an unconscious
mental cost that affects the way you read and write code. Editor ergonomics do
impact your codebase.

2\. Vim's ratio of power to learning difficulty is the best out there, because
once you learn one word of vim's "language", you can combine it with every
other word you know and it will behave how you expect.

3\. I never try to convince people to switch to the actual vim editor because
it requires a ton of customization just to be usable, and overall it's not
that great. It's filled with cruft and weird things like a custom scripting
language. The only important part is the key bindings, and you can get those
in any modern editor. I use about 4 different editors and IDEs on 3 platforms
on a daily basis. I never had to learn all their crappy keyboard shortcuts
because they all have vim key bindings.

~~~
dasil003
I have to disagree with #1, vim normal mode is emphatically not about
navigation, it's about _editing_. It's basically a command grammar where
navigation (motions in vim parlance) can be combined with the various
commands.

The key observation behind its design is that programmers and sysadmins spend
much more time editing than entering new text, and therefore it is asinine
that 40 of the keys on the keyboard are permanently dedicated to typing out
literals when there are very obvious editing operations that give you a lot
more leverage.

------
fstop
Honestly though, is it even worth learning?

I've tried learning VIM a few times and always gave up, and feel like my
editors shortcuts cover most cases anyway. There's also not that many times
where I feel like coding speed is required. Honestly curious how much more
productive you guys feel after learning VIM.

~~~
thomasahle
For me the productivity boost is mostly a matter of having a suite of very
powerful shortcuts/commands that I can use everywhere. I use them in all IDE's
(IntelliJ, Visual Studio, Eclipse all have great vim plugins); I use them in
any terminal I get access to, even when I can't install software; and I use
them in less, Chrome, man and other other tools that copy vim's shortcuts
either natively or through plugins.

In actual day to day use, it is more a matter of saving my fingers from
stressful yoga tricks.

~~~
pweissbrod
+1

Also consider vim in your web browser (vimperator or vimfx or qutebrowser or
vimium)

Vim in your file explorer (vifm)

Vim in your terminal (tmux in vim-mode)

Vim in your mayonnaise for lunch
([https://lisalynnfit.vimtoday.com/images/thumbs/0000878_1200....](https://lisalynnfit.vimtoday.com/images/thumbs/0000878_1200.jpeg))

Vim as a floor wax/desert topping
([http://www.mysavings.com/img/link/large/74808.jpg](http://www.mysavings.com/img/link/large/74808.jpg))

and so forth.

~~~
vetar
You mentioned tmux... What is the best counterpart windows solution by you?
vim+tmux is awesome.

------
mbonzo
Thanks for making this tutorial and helping more people with Vim! I actually
started learning Vim a few months ago. And to help me practice, a friend of
mine recommended Vimgolf challenges. Since then I’ve been making weekly videos
about the solutions to those challenges. I started it because some of the
solutions were really hard to understand and I had almost given up a few
times. I hope that by making videos it’ll help people see and understand some
of the more complicated vim commands. I thought this would be a good place to
share, hope it helps someone!

[https://www.youtube.com/channel/UC9xP5LRmm2qbSKq6nHTB_bw?vie...](https://www.youtube.com/channel/UC9xP5LRmm2qbSKq6nHTB_bw?view_as=subscriber)

------
cleandreams
Here's a plug for bash with vim on the command line. (Ubuntu but also wsl). In
your login dir, in .inputrc, add:

set editing-mode vi set keymap vi-command:w

This gives you vim on the command line, very handy.

Interactively, set -o vi will work.

This is a great way to 'live in vim.'

------
chestervonwinch
I apologize that this question is slightly tangential to the submitted post,
but this seems like an ideal venue to ask: Is there a GUI interface to vim
that has smooth-scrolling?

I've tried Gvim, but this just seems like vim with buttons (no smooth-scroll).
I've tried Sublime text with the ActualVim plugin (powered by NeoVim), but
this had errors which somehow swapped document buffers on write, essentially
deleting an entire document (thankfully I had a backup).

~~~
alfla
Do you mean scrolling with a mouse? It might sound a bit arrogant, but there's
rarely any good reason to scroll with a mouse in vim.

~~~
revscat
I would like to second this, and support you in that I don’t think it is an
arrogant sentiment. Many of the efficiency gains vim gives you are the result
of being able to navigate anywhere in a document or on a line with a few
keystrokes. The mouse is comparatively slower, once the navigation commands
are familiar.

~~~
no_wizard
I disagree, in only that good mouse support can help ease the transition and
in some cases it may simply come down to user preference for some things. I
don’t think personally that any text editor should be overly opinionated in
how a user interacts with it; too much at least. I do agree that it is mostly
more effective to not use a mouse once you know the commands

------
thinkpad20
I've tried learning Vim several times, but the need to switch modes and back
for cursor movement has been a huge turnoff, especially considering the
location of the ESC key. It seems to just conflict with the way that I type,
where I am frequently jumping my cursor around in the middle of text editing,
which is effortless in Emacs. Maybe mastering Vim is not just about memorizing
key combos but about changing your coding workflow?

~~~
thomasahle
> especially considering the location of the ESC key

This can be solved by remapping ESC to Capslock.

~~~
Tenhundfeld
Exactly. Or remap it to any key combination that makes sense for your work, if
you like using Capslock for its original purpose, which I happen to.

For example, I have _jj_ and _jk_ mapped to ESC. So I just tap _j_ twice while
in insert mode, and it switches to normal/command mode. If you find yourself
needing to type jj or jk often in insert mode, just pick other letters that
make sense for you.

To use mine, plop these in your .vimrc:

    
    
      inoremap jj <Esc>
      inoremap jJ <Esc>
      inoremap jk <Esc>

~~~
flukus
I do it with zz, which I find is consistent with ZZ (save and quit).

------
udp
The single thing you need to do to learn vim is to download the ViEmu
cheatsheet[0], _print it out_ , and stick it on the wall where you can see it.
Printing it out is mandatory - you need to be able to see it without switching
windows.

Putting things up on the wall is like a free, albeit static, extra monitor.
:-)

[0] [http://www.viemu.com/vi-vim-cheat-sheet.gif](http://www.viemu.com/vi-vim-
cheat-sheet.gif)

------
earlybike
To learn Vim you have to use it everyday. Question is if most have the
opportunity to use it full-time for development from day one. I started with
Vim using it just as a todo list manager on a remote server. Wrote here and
there some macros to add or mark todos and that was my gateway drug. Used it
everyday and at some point it felt more natural than any other editor. So I
fully switched.

Besides, I use Neovim for 1-2 years now.

~~~
nitemice
I 100% agree. I originally learnt Vim because I didn't have any choice. It was
the only supported editor at my workplace, so I was thrown in the deep end,
using it every day.

That kind of situation can foster resentment, but I embraced the challenge. I
got use to Vim, and overall adopted a more "UNIX" approach to my workflow and
development. I'm not all the way there, but I'm trying to embrace it more,
little by little.

------
pmoriarty
To make the basic vim movement keys (hjkl) second nature to you, play games
that use them for movement, like Nethack[1] and Dungeon Crawl Stone Soup.[2]

[1] - [http://www.nethack.org/](http://www.nethack.org/)

[2] - [https://crawl.develz.org/](https://crawl.develz.org/)

------
gravypod
Coincidentally we've recently shipped a tutorial for Nano except we've decided
to build it strait into our editor! After you 'sudo apt update && sudo apt
upgrade && sudo apt install nano' you can run 'nano' in your terminal. At the
bottom of your terminal window you'll see a set of hand-picked lessons
displayed for you. Anywhere you see "^" you just hold CNTRL on your keyboard.
Unfortunately we didn't have the funds to implement our own content in the
tutorial series. You'll have to provide your own textual media to practice on.
You can do this by typing "nano <your_file_name>" in the terminal which will
launch our tutorial system with your file. The tutorial system is very
unobtrusive and will remain on the bottom of your screen until you add 'set
nohelp' to your nanorc.

------
pkamb
Are there any common "home row arrow key" schemes besides the Vim HJKL? Need
to determine which to learn, and those 4 have never made sense to me.

ESDF and IJKL look temping

Typing in Dvorak, I'd need to remap anyway before being able to use the keys.
May as well pick the best scheme.

------
ah-
It would be amazing to be able to play with the commands in addition to
pressing exactly the keys that the tutorial tells you to press.

Get a demonstration, then try on your own.

Or maybe even include a vim golf game as an exercise? E.g. get to some word in
less than four key presses.

~~~
jlebrech
vim golf needs to be multiplayer

------
sfsylvester
Is there something similar to this for emacs?

~~~
stinkytaco
To expand on the answers, C-h t opens the built in tutorial, which is good. It
only covers the basics of navigation, but that's what you need to know to
start. The tutorial is interactive.

Since emacs changes its behavior depending on the mode, it would be
impractical to do a more in depth tutorial, in my opinion, but I liked the
Mastering Emacs ebook.

~~~
todd8
One of the very best features of Emacs is it's built in help system, faster,
more convenient and more accurate than most program wikis or on-line
documentation.

Emacs is too big to learn every one of the 7000 or so functions, one learns
just what's useful in a particular realm. Anytime it's necessary to wander
into new territory, there is really good built-in help system available. Help
commands start with Ctrl-h. The next keystroke determines the kind of help
that comes next.

A handy prompt after Ctrl-h suggests typing '?' for additional options. The
basics options are:

a PATTERN -- show commands whose name matches PATTERN

d PATTERN -- show commands whose documentation has a match to PATTERN

f -- documentation of a particular function

c -- what command runs for a particular Emacs key sequence

t -- learn by doing tutorial.

There is a full page of other help options including access to the full emacs
manual.

~~~
stinkytaco
The only gripe I have with emacs help, is that it does require some basic
skill to use it. The help opens in a window in the existing frame and you need
to know how to jump back and forth and close. It's a bit like having to drive
yourself to your learning to drive lessons. But once you've done the built in
tutorial a few times, you should have that basic skill.

~~~
prakashk
> The only gripe I have with emacs help, is that it does require some basic
> skill to use it.

The only thing to know is to press 'q' to quit the help window and get back to
where you were.

------
todd8
I was just watching my daughter writing a program in Java using eclipse. It's
frustrating to watch a relative beginner editing using a combination of the
mouse and the keyboard--it's so slow.

------
rudedogg
Kind of off-topic but this is probably a decent place to ask..

I've just started working on a text editor as a side project, and one of the
main things I want to include is a really complete implementation of vim
keybindings. So far I just have a queue of keyboard events. Basic movements
seem pretty easy, but I'm worried about operator motions (d6w - delete 6
words, etc). Will I basically need to build a parser?

Any guidance or keywords I can use to research/learn how to do this would be
greatly appreciated.

------
vram22
I would like to read a long and interesting article like this, but for emacs,
because I've been mainly a vi/vim guy (on both Unix and Windows) (plus use of
various other text editors on Windows (Textpad, Notepad++, Metapad (light use,
like a better Notepad), PFE (older, cool one, it could edit really large
files), Norton Editor (NE, damn fast one), and some others, but interested in
learning about emacs' capabilities.

------
superasn
A little off-topic, but if you like working in Vim, try using cVim[1] for
Chrome. It really makes your browsing experience a lot faster, especially if
you're on a laptop.

[1]
[https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojh...](https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh?hl=en)

~~~
curioussavage
Is there anything better about this than vimium?

The most disappointing thing about using an extension for this is when I open
dev tools or a tab fails to load. I love luakit because the browser itself
lets you set up vim like commands. Unfortunately I had to give up trying to
build it for macOS

~~~
foo101
Vimium has been a very frustrating experience for me. The one thing where I
always trip:

\- Press 't' to open a new tab.

\- Now I realize I want to go back to the previous tab. I press 'Escape'.
Nothing happens. The focus is stuck in the address bar. I press 'J' and of
course the 'J' gets typed into the address bar. How do I escape back to normal
mode? I can't figure.

With VimFx for Firefox, it works exactly as one would imagine.

\- Press 't' to open a new tab.

\- Now I realize I want to go back to the previous tab. Press 'Escape' to
return to normal mode. Press 'J' to go back to the previous tab.

If this is something that works fine in cVim, I am going to ditch Vimium in
favor of cVim today!

~~~
superasn
I tried pentadectyl for firefox and couldn't get it to work after 1 hour of
messing around (some version issues). I'll try vimfx because I'm not too happy
with cvim either mainly because it won't run on chrome:// pages which makes it
necessary to use the mouse afterall.

------
localhost
Obligatory link to VimGolf, a great way to learn by doing.

[https://vimgolf.com/](https://vimgolf.com/)

~~~
omtose
This website sucks, it takes forever to load challenge pages because they're
flooded with irrelevant entries which you can't even see if you don't submit
your own. You can't even visualize the solutions directly in the browser.

~~~
aidos
And you never really get to learn anything. I generally come away feeling like
there's this knowledge locked in solutions I'll never get to see so there's no
way to improve. Seems like a good idea but in practice it's just frustrating.

------
bananicorn
Now I wonder if there's a js library which makes a textfield behave like
VIM...

Guess I'll need to look at the source here later on to find out.

~~~
woodrowbarlow
since this site doesn't let you experiment, i'd guess they didn't actually
emulate vim. it's little more than a slide deck triggered by specific
keypresses.

~~~
bananicorn
Makes sense, vim emulation seems a bit overkill for this^^

------
no_wizard
Not to be that that guy but I’m gonna go ahead and plug spacemacs here. Using
it in Vim (EVIL) mode I found it to be basically like vim navigationally
speaking, plus they have a built completer for commands and you can even get
help with commands in real time using ? And just start typing. Not a knock
against Vim just something I found to be very beginner friendly

~~~
waivek

      nnoremap h j
    

Is this possible yet in their elisp config?

~~~
Nullabillity
You should be able to put

    
    
        (define-key evil-normal-state-map "h" 'evil-next-line)
    

into your dotspacemacs/user-config.

~~~
waivek
That doesn't work everywhere. This was my dealbreaker with Spacemacs. To remap
hjkl to jkl; (imperfectly at that) I had to do the following:

    
    
      (define-key evil-normal-state-map (kbd "j") 'evil-backward-char)
      (define-key evil-normal-state-map (kbd "k") 'evil-next-visual-line)
      (define-key evil-normal-state-map (kbd "l") 'evil-previous-visual-line)
      (define-key evil-normal-state-map (kbd ";") 'evil-forward-char)
      
      (define-key evil-visual-state-map (kbd "j") 'evil-backward-char)
      (define-key evil-visual-state-map (kbd "k") 'evil-next-line)
      (define-key evil-visual-state-map (kbd "l") 'evil-previous-line)
      (define-key evil-visual-state-map (kbd ";") 'evil-forward-char)
      
      (define-key evil-motion-state-map (kbd "j") 'evil-backward-char)
      (define-key evil-motion-state-map (kbd "k") 'evil-next-line)
      (define-key evil-motion-state-map (kbd "l") 'evil-previous-line)
      (define-key evil-motion-state-map (kbd ";") 'evil-forward-char)
      
      (define-key dired-mode-map (kbd "j") 'evil-backward-char)
      (define-key dired-mode-map (kbd "k") 'evil-next-line)
      (define-key dired-mode-map (kbd "l") 'evil-previous-line)
      (define-key dired-mode-map (kbd ";") 'evil-forward-char))

~~~
ludston

      (defun multi-evil-define (d symb)
      	(define-key evil-normal-state-map d symb)
      	(define-key evil-motion-state-map d symb)
      	(define-key evil-visual-state-map d symb)
      	(define-key dired-mode-map d symb))
      
      (multi-evil-define (kbd "j") 'evil-backward-char) ....

------
Ascetik
So... many... commands.

~~~
dutchieinfrance
So... much... power.

~~~
kowdermeister
I wonder what was the issue with arrow keys. Were there keyboards that lacked
them?

~~~
mrzool
Yep, but it then stayed that way because arrow keys are distant and require
you to leave the home row, while hjkl are on the home row.

Vim is all about ergonomic touch-typing.

------
rmetzler
Just last week my team and I understood how to select inside and around of
brackets.

    
    
       vi" - select inside " 
       va{ - select around curly brackets
    

If you have selected what you want, you're able to yank (y), change (c),
delete (d) the selected text.

------
mrzool
How is a web-based tutorial better than "the real thing" (i.e. vimtutor)?

------
qwerty1793
I have to say how confusing I found this demo without a US keyboard. In
section 10 I spent far too long pressing Shift+3 and wondering why it wouldn't
progress even though I was pressing the pound key (£).

------
simondedalus
best way to learn vim:

(optional) first, go thru vimtutor (just type vimtutor in your shell and press
enter).

second, get a vim cheat sheet (google).

finally (most important), code a few things using vim. keep google at the
ready to look up "how do (etc)?" to speed up things you're actually doing.

once comfortable with that, maybe watch a few vim tips videos.

after all that, you will probably find vim much more comfortable than gedit,
textedit, notepad, etc, just for the power. if you favor ides, you'll probably
need to do a lot of tweaking to love raw vim, though or course some ides offer
vim keymapping anyway.

~~~
jhauris
I really liked having a "vim mug" as cheat sheet. If you drink hot liquids at
your desk you'll have a mug anyway. This way it doubles as a vim reference
while you're learning and you're probably less likely to lose it.

------
fokinsean
My biggest vim efficiency booster is remapping <esc> to "jk"

~~~
foo101
What do you do when you actually need to type the string "jk"? Type "j", then
wait for sometime and then type "k"?

~~~
tomsthumb
it waits `timeoutlen` before accepting the next character as literal instead
of as part of the mapped sequence. see `:help timeoutlen`

------
chrismorgan
Wait, Shift+7 for slash? What keyboard layout is this? I had already noticed
various other weird things about the layout depicted on the screen, but that
one takes the cake.

~~~
alvarosevilla95
Probably Spanish. It's a horrible layout for developers, curly braces involve
alt-gr for instance...

~~~
SeriousM
As well as the German layout. But you get used to if you don't know anything
else.

------
jdhawk
Looking at the TOC, its missing cut/copy and paste, which is pretty important
for any text editor

~~~
rstefanic
It's true, but since vim is a bit old, copy/pasting can be a bit awkward due
to having an internal clipboard with the buffer and not using the system's
clipboard.

I wouldn't put that in a beginner tutorial (at least the system clipboard
copying/pasting).

~~~
Xophmeister
Vim has system clipboard support with the `+` and `*` registers.

~~~
edanm
Or even better, setting "set clipboard=unnamed" in your vimrc, which just
makes it to so vim's clipboad _is_ the system clipboard.

~~~
Analog24
I never knew about this trick, which is pretty significant if you use tmux
regularly. This just made my day!

------
css
The day I commit myself to learning vim properly, this comes up. Thanks for
posting!

------
shmerl
It's using hardcore classic vim key bindings. Insert mode doesn't even start
when pressing actual Ins. I understand some can have nostalgia for the times
of archaic terminals, but I find it counter productive. Sorry, but I'm going
to use Ins and regular arrow keys, not i and h,j,k,l.

~~~
Lio
Then you’re missing the point of touch typing the commands from the home row.

~~~
shmerl
I simply find those keys for navigation awkward and out of place. Habits play
a role here.

~~~
Analog24
It's hugely inefficient to have to pick up your hand every time you want to
move the cursor (assuming you're a developer and spend a significant amount of
time in a text editor). If you don't want to learn a new tool to improve
efficiency that's one thing but saying that it's out of place to use the
'hjkl' keys for navigation is pretty misguided.

~~~
shmerl
Efficient enough for me. And yes, for me those keys are out of place for
navigation.

------
movedx
(Incoming controversial anti-Vim comment. Down voting because you disagree is
a poor show and a poor argument. Convince me otherwise with words, good sirs
and madams.)

Vim, beyond the very basics for server side administrative tasks, isn't worth
your time.

Vim isn't worth the investment in time for me, as an average programmer, and I
doubt it's worth the time of most other (average) developers as well. It's a
big investment in retraining muscle memory and rethinking about how your
editor works for, frankly, little gain.

"It speeds you up" \- no it doesn't. It gives you access to keyboard shortcuts
for moving around your buffer that other editors give you. It has a cool way
of looking at text and once understood, you can do cool shit. I never could
find a need for any of that stuff, even after spending a week or so learning
it and adjusting muscle memory. After moving to VSCode, I've never missed that
stuff neither. That says a lot about my personal use case I'll admit, but my
use case in very common as an everyday programmer.

Funny enough, most editors have plugins to enable Vim modes and keyboard
weirdness anyway.

So I've tried moving to Vim from Sublime, and I'm thankful for the time I
invested, but I quickly realised that Vim (and Sublime, actually) fall short
compared to VSCode or a serious IDEs. And yes, I'm aware you can make Vim
behave like an IDE - I did it. I get it. It's not worth the time.

With modern, graphical editors and IDEs like VSCode, Atom, Eclipse, the
IntelliJ family like IDEs, and so on, you get up and running straight away.
You can extend them very quickly using a built in plugin system - you don't
even have to leave the software.

I use VSCode, and I've found that I haven't had to leave the editor or install
anything outside of VSCode plugins to make it operate as a Java IDE, Go IDE
(OK, I had to install Delve), or Python IDE. It has saved me a lot of time
tinkering and allowed me to just get going. It even PROMPTED me when I opened
a Python, Go, or JavaScript file for the first and offered to install plugins
for making the file easier to work with... YES PLEASE! And yes I know Vim can
do these things (using external, third party plugins.) I did it. I get it.
It's not worth the time.

I'm also aware that Vim uses kilobytes, perhaps megabytes, of RAM to operate
and VSCode uses hundreds. And that's a problem how? I have 16GB of RAM on a
system running a single VM for Docker and a browser. I'm the first person
you'll find who will complain about how bloated and heavy applications are in
this day and age, believing that us programmers are getting lazy due to an
ever increase in resources, but a few hundred MBs of RAM for massive time
savings and a great UI is worth it.

It's simply not worth the time invested. The basics allow you to do quick
server side stuff and you'll be thankful for the knowledge, but beyond that
use something designed for the job, even if it does eat RAM for breakfast.

~~~
foo101
> It gives you access to keyboard shortcuts for moving around ...

Your whole comment can be dismissed easily because of this one gross
misunderstanding. Vim is not a bunch of weird keyboard shortcuts. If one
approaches Vim as an editor that uses keyboard shortcuts that are inconsistent
with every other editor out there, then one is simply setting themselves up
for pain and unproductivity.

Vim is not a bunch of keyboard shortcuts. It is an interactive editing
language! For more, see this excellent comment on StackOverflow:
[https://stackoverflow.com/a/1220118/1175080](https://stackoverflow.com/a/1220118/1175080)
(a very well written answer!).

~~~
movedx
It's an interactive editing language... that I'll never use and still be as
productive as you.

~~~
foo101
Good luck living in your comfortable bubble!

~~~
movedx
Thanks. I do, and will continue to :)

------
equalunique
I learned vim on Ubuntu 8.04 by using vimtutor.

------
tolgahanuzun
unbelievable, it's so much fun.

------
downrightmike
That was fun.

------
foo101
The first thing I do on a new system is map my Caps Lock key to
Escape[1][2][3] so that I can use Vim conveniently without having to reach the
physical Escape key placed awkwardly at the corner of the keyboard.

The choice of Escape key to return to normal mode and H, J, K, L for
navigation makes total sense if we look at the original Lear Siegler ADM-3A
terminal[4] that Bill Joy used while creating vi, but in the modern day
keyboard, the choice of Escape key to return to normal mode really disturbs
the otherwise fine ergonomics of using Vim.

[1]:
[https://github.com/susam/uncap#uncap](https://github.com/susam/uncap#uncap)

[2]:
[http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows...](http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows#Utilities)

[3]:
[http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_XWindow...](http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_XWindows#Comment_from_tip_327_.28now_removed.29)

[4]: [https://vintagecomputer.ca/wp-content/uploads/2015/01/LSI-
AD...](https://vintagecomputer.ca/wp-content/uploads/2015/01/LSI-ADM3A-full-
keyboard.jpg)

~~~
weaksauce
Mapping jk and kj to escape and mapping caps lock to some other hyper key is
way better than caps lock to esc IMO. You can just mash both j and k together
and you are out of it.

inoremap jk <esc>

And

inoremap kj <esc>

In your vimrc file should do it.

~~~
foo101
I have considered such alternatives in the past and they did not work for me.
For example, how can I conveniently type the string "jk" or "kj" with such a
configuration?

The artificial delay I have to introduce between typing "j" and "k" to
actually type "jk" is unacceptable. Although it is rare, I sometimes do have
to type "jk" in special circumstances such as while typing LaTeX code.

Mapping Caps Lock to Escape is just a much cleaner solution that does not come
with any surprises.

~~~
humblebee
I use the 'jk' and 'kj' mapping for escape as well, though I've never actually
needed to type those characters out myself or at least it's so rare I don't
remember. However, everyone is different.

What I'd suggest if you want to give it a try is to also set the `timeoutlen`
to a lower value. By default it's usually 1000ms, but that can be dropped
quite a bit I believe without much interference.

    
    
        autocmd InsertEnter * set timeoutlen=100
        autocmd InsertLeave * set timeoutlen=1000

~~~
foo101
This 'jk' and 'kj' mapping works only to get out of the Insert mode. But it
does not match the full capability of the original 'Escape'.

\- How do you escape from visual mode to normal mode?

\- How do you ensure that your abbreviation gets expanded when you escape from
insert mode to normal mode?

\- How do you escape from operator-pending mode to normal mode? With this
mapping, if you press 'd' to delete something and then change your mind and
decide to return to normal mode, you are forced to use the original 'Escape'
anyway. If you happen to press 'jk' due to habit at this time, it is going to
end up deleting lines.

For these reasons, I thought to have a clean mapping of another convenient key
(such as Caps Lock) to Escape at an operating system level, rather than trying
to make Vim treat some other key as Escape in certain modes.

------
denisehilton
That's a highly interactive Vim tutorial. Kudos to the developer

