Holy crap this has been an astonishing experience for me:
I used vi for the first time for real.

well, this piece of software has been bugging me since forever, since I never understood how it worked. When I was a small kid I used nano as a crutch but quickly changed over to vim, which is my favourite editor ever since.

But there are situations when vim isn‘t available, namely

  • when installing a new system before vim is installed (which is pretty much the first thing to do)
  • when ssh into some embedded system where vim isn‘t available (not really happening)
  • when trying to change the crontab for root via doas crontab -e (which is exactly what I had to do today again.)

And again it was hell because you can‘t really use backspace, if you even make the tiniest mistake you can‘t correct it, and you can‘t use a good editor like vim. Argh.

But now to the good part. Actually you can do all of the above things no problem in vi. (still not sure how to make crontab -e use vim as an editor though)

simple google search gave me the answers, as it does. (I‘m sure I searched before, but didn‘t remember. Well now I have the blog and don‘t need to remember stuff.)


  • Backspace is in fact working, just leaving the characters there until you overwrite them.
  • to actually delete an item go to command mode and press x for char under the curser and X for the one on the right
  • to Write again right of the cursor you have to put in a instead of i
  • Also use hjkl as your cursor.

How much less pain I would have had, if only I had memorized these few things about 20 years ago. oh well. still like vim much better.

Update New command I learned search and replace string(foo) with otherstring(bar) for the whole document

:%s/foo/bar/g


another incredibly useful thing to consider is encoding :set encoding
to see what encoding vim uses at the moment. Good is UTF.8 bad is Latin1. you can either set the encoding in .vimrc but better yet so that the whole (Openbsd) system uses it when sshing into the machine: .ssh/environment
LC_CTYPE=en_US.UTF-8
LANG=en_US.UTF-8

and also set PermitUserEnvironment yes in your sshd.config

and then you can use all languages (as in umlauts etc.) and even 🤩 (ah vim is the best)


and yet another critical thing is being able to copy (and paste (not sure about pasting yet(just checked -> Works :D)) stuff while in vim via an ssh from a mac to an say openbsd box. in the default config it simply won’t work (don’t know how at least), since it goes to visual mode and I’ve got no Idea what that’s all about but it somehow makes copy impossible but adding a simple

set mouse=i

into your ~/.vimrc makes all of this work instantly. no copying while in insert mode, but in command mode you can mark stuff with the mouse and cmd-c it out flawlessly. aaah vim :)

dunno why but I also need to set the following in my .vimrc to make backspace working again after setting the above.

set backspace=indent,eol,start

Guess the sane defaults on my system are overridden now. Let’s see what else springs up :)