The VikiD Truth

Knowledge base / Computing / Tools & dev workflow

computingFreedom | Build | Picolisp | Picolisp Machine | Pil Sources | Linux | BASH | C-Programmming | Operating Systems | Javascipt | Emacs | vim | Pharo Smalltalk | Computer Security | Python | The Compiler | Identifiers | Literals | storage_linkage | emacs | computing

vim

vim is one of the tools that you will want to get familiar with in linux. Just like Emacs, vim has it’s adherents who evangelize endlessly about its virtues.

I happen to love both emacs & vim finding that I happen to pop in and out of both continuously while working. You can do everything you want in either one of them, but like many things in life, having multi options you are fairly competent in, is very useful, fun and keeps life interesting.

To get started in vim, once you have it on your system just type this in the shell:

$ vimtutor

and your away!

My notes on vim, vikid’s vim notes

What it is, in plain words

Here is the truth about vim: it is not an editor with strange shortcuts. It is a small language for talking about text, and the shortcuts are its words. Once you see that, it stops being a memory test.

vim (“Vi IMproved”) was written by Bram Moolenaar in 1991 as a clone of Bill Joy’s vi from 1976. Bram passed away in 2023 and the project is now maintained by a team of volunteers; Vim 9.1 is the current line, with its own faster scripting language, Vim9 script. Its big sibling Neovim (0.11 and newer in 2026) forked in 2014 and adds built-in LSP, Tree-sitter parsing and Lua configuration. Both share the same core: modal editing.

Why it matters

An everyday analogy: speaking in sentences

In most editors you point and drag, like gesturing at things in a shop. Vim lets you say what you want: “delete inside the quotes”, “change to the end of the sentence”, “yank three paragraphs”. Commands are verb + count + noun:

VerbMeaningNoun (motion or text object)Meaning
ddeletewto next word
cchange$to end of line
yyank (copy)ipinner paragraph
>indenti"inside quotes
gUuppercaset,up to the next comma

So d2w deletes two words, ci" changes everything inside the quotes, yip copies a paragraph, gUiw uppercases a word. Learn five verbs and ten nouns and you know fifty commands. And . repeats the last change, which is where the real speed comes from.

A hands-on example

Start with the built-in tutorial (vimtutor, 30 minutes, really do it). Then try this in any file:

/TODO<Enter>     search for TODO
cwDONE<Esc>      change the word to DONE
n.               jump to the next TODO and repeat the change
:%s/foo/bar/gc   replace foo with bar everywhere, confirming each
qa ... q         record a macro into register a; @a plays it, 10@a ten times
:g/^$/d          delete every empty line

A minimal, modern ~/.vimrc to start from:

vim9script
set number relativenumber      # line numbers relative to the cursor
set ignorecase smartcase incsearch hlsearch
set expandtab shiftwidth=4 tabstop=4
set clipboard=unnamedplus      # share the X clipboard (needs vim with +clipboard)
syntax on
filetype plugin indent on
nnoremap <Space>w :w<CR>

On Vikix, a vim build with +clipboard is what you want (check with vim --version | grep clipboard; the gvim package provides one); neovim is packaged too. For Lisp work, plugins like vim-sexp or Conjure make parentheses as easy to edit as in Emacs.

Common misconceptions

Connections

Links & Sources

Last edited · 11 revisions

Tags: #Computing