Vim (Vi IMproved) is a further development of the text editor Vi. It is characterised by its slimness, but also by the fact that it can be extended and configured as desired. Vim does not need a mouse or a graphical user interface. However, its somewhat cumbersome handling proves to be an obstacle at first. Vimtutor offers a good possibility to get acquainted with this editor.
On many systems Vim is already pre-installed, this can be checked with command -v vim
or vim --version
.
$ command -v vim
/usr/bin/vim
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Jan 11 2023 23:53:12)
Inklusive der Patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
Verändert von team+vim@tracker.debian.org
Übersetzt von team+vim@tracker.debian.org
Riesige Version ohne GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften:
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap -ruby +wildignore
+cursorbind -lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse -sound -xfontset
-dnd -mouseshape +spell -xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags +mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
System-vimrc-Datei: "$VIM/vimrc"
Benutzer-vimrc-Datei: "$HOME/.vimrc"
zweite Benutzer-vimrc-Datei: "~/.vim/vimrc"
Benutzer-exrc-Datei: "$HOME/.exrc"
defaults Datei: "$VIMRUNTIME/defaults.vim"
Voreinstellung für $VIM: "/usr/share/vim"
Übersetzt: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-XHiCvL/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linken: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -ldl -lm -lm
If not, simply install it with sudo apt install -y
.
What sounds strange at first, however, causes confusion again and again, as many jokes and memes on the internet testify. Once you have curiously opened Vim for the first time, the question is how to leave it again. Desperate users often choke off the graphical terminal, which is not an option on systems without a graphical user interface. Often one hears that the whole computer has been restarted,
If you have already played around in the editor and have slipped into the editing mode, you can leave it again by pressing esc
.
Press :q
to exit Vim - :q!
forces an abort and discards changes, while :wq
saves the file first.
Calling up vimtutor
provides a training environment that simplifies familiarisation with Vim.
vimtutor