from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

83162

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->app-editors->VI

2. Commands



Below you will find a cheat-sheet with vi commands. This cheat sheet will also come in handy in the next section of this document,
Practice Lesson #1.



vi cheat-sheet


a. cursor movements (items below are sometimes called objects):
h - left one character
l - right one character
j - down one line
k - up one line
w - right one word
b - back one word
$ - to the end of line
0 - to the beginning of the line
) - right one sentence
( - left one sentence
} - right one paragraph
{ - left one paragraph
Ctrl-F - forward one page
Ctrl-B - back one page
G - go to (without arguments, go to end of file)
b. deleting:
d - delete
then add one of the cursor movement symbols to
show what should be deleted, i.e.:
d$ - delete to end of line
d0 - delete to the beginning of the line
d} - delete to the end of paragraph
dd - delete delete (delete the whole line)
x - delete character cursor is on
c. other basic commands:
r - replace one character
ZZ - save and exit (hold down shift and press "z" twice)
y - yank (copy into temporary buffer)
then add cursor movement symbol to show what should be
copied, for example: y) - copy to the end of sentence
Y - yank line cursor is on
p - paste below cursor line (deleted or copied text)
P - paste above cursor line
u - undo last editing command
/sometext - search for "sometext"

d. any command can take numeric argument before the name of "object", i.e.:
5dd - delete 5 lines beginning with cursor line (or) d5d - same
2dw - delete two words (or) d2w - delete two words
c3w - change 3 words
3Ctrl-B - move up three pages
1G - go to the first line
e. external commands can be performed on the selected text (in lines)
if command is started with "!", i.e.:
!}fmt - reformat paragraph to 72 columns
f. command line (sometimes called "ex mode"):
:
g. from the command line a "set" command can be executed to
customize editing environment, i.e.:
:set all - will show the state of all options
:set number - will show on the screen numbers of all lines
:set autoindent // obvious
h. from the command line operations can be performed on the range of lines,
i.e.:
:18,24 del - delete from line 18 to line 24
:23,48 copy 17 - block from line 23 to 48 copy to line 17
:2,17 move 92 - block from line 2 to 17 move to line 92
i. from the command line any external UNIX command can be performed on
the range of lines if line range is superseded by "!":
:11,16! sed -e "s/^//*/" -e "s/$/*//"

(the command above wraps the block of text with
"C" style comments - /* text */. It can be done
easier, but this is an example)
:14,19! sort -r +3
(sort the table in reverse order by fourth column)
j. file manipulation from the command line:
:r somefile - read in "somefile"
:x - save and exit (if file is "Read Only", this command will
exit without saving)
:wq - write and quit (same as above)
:w - write (save) if the file permissions allow it
:w! - save file even if it is read-only as long as we own it
:w somefile - save this file as "somefile"
:q - quit without saving
:q! - quit without saving if changes were made
k. text input commands (all require "Esc" to terminate):
i - insert text before the character cursor is on
I - insert text at the beginning of the line
a - append (insert text after the character cursor is on)
A - append text to the end of the line
c - change (replace previous text with new one)
takes arguments just like the delete command - it is
a fast and powerful way of changing original text -
much more so than typical "overwrite"

R - start overwriting text
o - start entering text at the beginning of the new line
below the cursor
O - start entering text at the beginning of the new line
above the cursor
l. if in doubt, press "Esc"


/* The article above and any accompanying files are freely
* distributable, but please leave this notice and the text intact.
* Home for this document: http://www.infobound.com/vi.html
* Copyright (C) 1994, 1999 Tony Thomas
* Contact author through email:
tony@infobound.com
* Last revision Feb 23, 1999
* UNIX is a trademark of X/Open
*/

rate this article:
current rating: average rating: 1.2 (26 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-02-09
Image-Scale - 0.140.0-r1
Ebuild name:

dev-perl/Image-Scale-0.140.0-r1

Description

Fast, high-quality fixed-point image resizing

Added to portage

2026-02-09

borgmatic - 2.1.2
Ebuild name:

app-backup/borgmatic-2.1.2

Description

Automatically create, prune and verify backups with borgbackup

Added to portage

2026-02-09

chafa - 1.18.1
Ebuild name:

media-gfx/chafa-1.18.1

Description

versatile and fast Unicode/ASCII/ANSI graphics renderer

Added to portage

2026-02-09

freenet - 0.7.5_p1505
Ebuild name:

net-p2p/freenet-0.7.5_p1505

Description

Freenet REference Daemon

Added to portage

2026-02-09

gcc - 16.0.1_p20260208
Ebuild name:

sys-devel/gcc-16.0.1_p20260208

Description

The GNU Compiler Collection

Added to portage

2026-02-09

krita - 6.0.0_beta1-r1
Ebuild name:

media-gfx/krita-6.0.0_beta1-r1

Description

Free digital painting application. Digital Painting, Creative Freedo

Added to portage

2026-02-09

less - 692
Ebuild name:

sys-apps/less-692

Description

Excellent text file viewer

Added to portage

2026-02-09

libXmu - 1.3.1
Ebuild name:

x11-libs/libXmu-1.3.1

Description

X.Org Xmu library

Added to portage

2026-02-09

stalonetray - 1.0.1
Ebuild name:

x11-misc/stalonetray-1.0.1

Description

System tray utility including support for KDE system tray icons

Added to portage

2026-02-09

2026-02-08
AusweisApp - 2.4.1
Ebuild name:

sys-auth/AusweisApp-2.4.1

Description

Official authentication app for German ID cards and residence permits

Added to portage

2026-02-08

astroid - 4.0.4
Ebuild name:

dev-python/astroid-4.0.4

Description

Abstract Syntax Tree for logilab packages

Added to portage

2026-02-08

asymptote - 3.06
Ebuild name:

media-gfx/asymptote-3.06

Description

A vector graphics language that provides a framework for technical drawing

Added to portage

2026-02-08

bitmap - 1.1.2
Ebuild name:

x11-apps/bitmap-1.1.2

Description

X.Org bitmap application

Added to portage

2026-02-08

busted - 2.3.0
Ebuild name:

dev-lua/busted-2.3.0

Description

Elegant Lua unit testing

Added to portage

2026-02-08

chemex - 2026.1.0
Ebuild name:

sci-chemistry/chemex-2026.1.0

Description

Program to fit chemical exchange induced shift and relaxation data

Added to portage

2026-02-08

compose-tables - 1.8.13
Ebuild name:

x11-misc/compose-tables-1.8.13

Description

X.Org Compose Key tables from libX11

Added to portage

2026-02-08

crispy-doom - 7.1
Ebuild name:

games-fps/crispy-doom-7.1

Description

A limit-removing enhanced-resolution Doom source port based on Chocolate

Added to portage

2026-02-08

csharp-language-server - 0.22.0
Ebuild name:

dev-dotnet/csharp-language-server-0.22.0

Description

Roslyn-based LSP language server for C

Added to portage

2026-02-08

discord - 0.0.123
Ebuild name:

net-im/discord-0.0.123

Description

All-in-one voice and text chat for gamers

Added to portage

2026-02-08

dssp - 4.5.8
Ebuild name:

sci-chemistry/dssp-4.5.8

Description

The protein secondary structure standard

Added to portage

2026-02-08

e16-epplets - 0.18
Ebuild name:

x11-plugins/e16-epplets-0.18

Description

Enlightenment DR16 epplets

Added to portage

2026-02-08

faudio - 26.02
Ebuild name:

app-emulation/faudio-26.02

Description

Accuracy-focused XAudio reimplementation for open platforms

Added to portage

2026-02-08

font-alias - 1.0.6
Ebuild name:

media-fonts/font-alias-1.0.6

Description

X.Org font aliases

Added to portage

2026-02-08

galculator - 2.1.5_pre20150928
Ebuild name:

sci-calculators/galculator-2.1.5_pre20150928

Description

GTK+ based algebraic and RPN calculator

Added to portage

2026-02-08

gcc - 13.4.1_p20260205
Ebuild name:

sys-devel/gcc-13.4.1_p20260205

Description

The GNU Compiler Collection

Added to portage

2026-02-08

gcc - 14.3.1_p20260206
Ebuild name:

sys-devel/gcc-14.3.1_p20260206

Description

The GNU Compiler Collection

Added to portage

2026-02-08

gcc - 15.2.1_p20260207
Ebuild name:

sys-devel/gcc-15.2.1_p20260207

Description

The GNU Compiler Collection

Added to portage

2026-02-08

gmpy2 - 2.3.0
Ebuild name:

dev-python/gmpy2-2.3.0

Description

Python bindings for GMP, MPC, MPFR and MPIR libraries

Added to portage

2026-02-08

gnome-control-center - 48.6
Ebuild name:

gnome-base/gnome-control-center-48.6

Description

GNOME's main interface to configure various aspects of the des

Added to portage

2026-02-08

gnome-shell - 48.7
Ebuild name:

gnome-base/gnome-shell-48.7

Description

Provides core UI functions for the GNOME desktop

Added to portage

2026-02-08

gunicorn - 25.0.3
Ebuild name:

www-servers/gunicorn-25.0.3

Description

A WSGI HTTP Server for UNIX

Added to portage

2026-02-08

gxemul - 0.7.0
Ebuild name:

app-emulation/gxemul-0.7.0

Description

A Machine Emulator, Mainly emulates MIPS, but supports other CPU types

Added to portage

2026-02-08

kst - 2.1.0_p20260208-r1
Ebuild name:

sci-visualization/kst-2.1.0_p20260208-r1

Description

Fast real-time large-dataset viewing and plotting tool

Added to portage

2026-02-08

level-zero - 1.28.0
Ebuild name:

dev-libs/level-zero-1.28.0

Description

oneAPI Level Zero headers, loader and validation layer

Added to portage

2026-02-08

libX11 - 1.8.13
Ebuild name:

x11-libs/libX11-1.8.13

Description

X.Org X11 library

Added to portage

2026-02-08

libcifpp - 9.0.6
Ebuild name:

sci-libs/libcifpp-9.0.6

Description

Code to work with mmCIF and PDB files

Added to portage

2026-02-08

libdnet - 1.18.2
Ebuild name:

dev-libs/libdnet-1.18.2

Description

Simplified, portable interface to several low-level networking routines

Added to portage

2026-02-08

libfontenc - 1.1.9
Ebuild name:

x11-libs/libfontenc-1.1.9

Description

X.Org fontenc library

Added to portage

2026-02-08

libupnp - 1.14.26
Ebuild name:

net-libs/libupnp-1.14.26

Description

An Portable Open Source UPnP Development Kit

Added to portage

2026-02-08

lua-zlib - 1.4
Ebuild name:

dev-lua/lua-zlib-1.4

Description

Simple streaming interface to zlib for Lua

Added to portage

2026-02-08

luacov - 0.17.0
Ebuild name:

dev-lua/luacov-0.17.0

Description

A simple coverage analyzer for Lua scripts

Added to portage

2026-02-08

luafilesystem - 1.9.0
Ebuild name:

dev-lua/luafilesystem-1.9.0

Description

File System Library for the Lua programming language

Added to portage

2026-02-08

luarocks - 3.13.0
Ebuild name:

dev-lua/luarocks-3.13.0

Description

A package manager for the Lua programming language

Added to portage

2026-02-08

mac - 12.12
Ebuild name:

media-sound/mac-12.12

Description

Monkey's Audio Codecs

Added to portage

2026-02-08

mattermost-desktop-bin - 6.1.0_rc2
Ebuild name:

net-im/mattermost-desktop-bin-6.1.0_rc2

Description

Mattermost Desktop application

Added to portage

2026-02-08

metee - 6.2.1
Ebuild name:

dev-libs/metee-6.2.1

Description

Cross-platform access library for Intel CSME HECI interface

Added to portage

2026-02-08

mkdocstrings - 1.0.3
Ebuild name:

dev-python/mkdocstrings-1.0.3

Description

Automatic documentation from sources, for MkDocs

Added to portage

2026-02-08

mutter - 48.7
Ebuild name:

x11-wm/mutter-48.7

Description

GNOME compositing window manager based on Clutter

Added to portage

2026-02-08

mysqltuner - 2.8.35
Ebuild name:

dev-db/mysqltuner-2.8.35

Description

Makes recommendations for increased performance and stability for MySQL

Added to portage

2026-02-08

nautilus - 49.2-r1
Ebuild name:

gnome-base/nautilus-49.2-r1

Description

Default file manager for the GNOME desktop

Added to portage

2026-02-08

nautilus - 49.4
Ebuild name:

gnome-base/nautilus-49.4

Description

Default file manager for the GNOME desktop

Added to portage

2026-02-08

nautilus-python - 4.1.0
Ebuild name:

dev-python/nautilus-python-4.1.0

Description

Python bindings for the Nautilus file manager

Added to portage

2026-02-08

newlib - 4.6.0.20260123
Ebuild name:

sys-libs/newlib-4.6.0.20260123

Description

Newlib is a C library intended for use on embedded systems

Added to portage

2026-02-08

noto - 20260201
Ebuild name:

media-fonts/noto-20260201

Description

Google's font family that aims to support all the world's languages

Added to portage

2026-02-08

nxml-libvirt-schemas - 12.0.0
Ebuild name:

app-emacs/nxml-libvirt-schemas-12.0.0

Description

Extension for nxml-mode with libvirt schemas

Added to portage

2026-02-08

nxml-svg-schemas - 1.1.20081123-r2
Ebuild name:

app-emacs/nxml-svg-schemas-1.1.20081123-r2

Description

Extension for nxml-mode with SVG 1.1 schemas

Added to portage

2026-02-08

openjdk - 26_beta34
Ebuild name:

dev-java/openjdk-26_beta34

Description

Open source implementation of the Java programming language

Added to portage

2026-02-08

openjdk - 27_alpha8
Ebuild name:

dev-java/openjdk-27_alpha8

Description

Open source implementation of the Java programming language

Added to portage

2026-02-08

openjdk-bin - 11.0.30_p7
Ebuild name:

dev-java/openjdk-bin-11.0.30_p7

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-02-08

openjdk-bin - 17.0.18_p8
Ebuild name:

dev-java/openjdk-bin-17.0.18_p8

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-02-08

openjdk-bin - 26_beta34
Ebuild name:

dev-java/openjdk-bin-26_beta34

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-02-08

openjdk-bin - 27_alpha7
Ebuild name:

dev-java/openjdk-bin-27_alpha7

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-02-08

openjdk-bin - 8.482_p08
Ebuild name:

dev-java/openjdk-bin-8.482_p08

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-02-08

openpgp-keys-gocryptfs - 20260208
Ebuild name:

sec-keys/openpgp-keys-gocryptfs-20260208

Description

OpenPGP keys used to sign gocryptfs

Added to portage

2026-02-08

openrct2 - 0.4.31
Ebuild name:

games-simulation/openrct2-0.4.31

Description

An open source re-implementation of Chris Sawyer's RollerCoaster T

Added to portage

2026-02-08

papers - 48.5-r1
Ebuild name:

app-text/papers-48.5-r1

Description

A document viewer for the GNOME desktop

Added to portage

2026-02-08

papers - 49.3
Ebuild name:

app-text/papers-49.3

Description

A document viewer for the GNOME desktop

Added to portage

2026-02-08

penlight - 1.15.0
Ebuild name:

dev-lua/penlight-1.15.0

Description

Lua utility libraries loosely based on the Python standard libraries

Added to portage

2026-02-08

pkcs11-dump - 0.3.5
Ebuild name:

app-crypt/pkcs11-dump-0.3.5

Description

Utilities for PKCS11 token content dump

Added to portage

2026-02-08

portage-utils - 0.97.1
Ebuild name:

app-portage/portage-utils-0.97.1

Description

Small and fast Portage helper tools written in C

Added to portage

2026-02-08

prosody - 13.0.4
Ebuild name:

net-im/prosody-13.0.4

Description

Prosody is a modern XMPP communication server

Added to portage

2026-02-08

pure-ftpd - 1.0.53
Ebuild name:

net-ftp/pure-ftpd-1.0.53

Description

Fast, production-quality, standard-conformant FTP server

Added to portage

2026-02-08

pyftpdlib - 2.2.0
Ebuild name:

dev-python/pyftpdlib-2.2.0

Description

Python FTP server library

Added to portage

2026-02-08

pymdstat - 0.5.1
Ebuild name:

dev-python/pymdstat-0.5.1

Description

Python library to parse Linux /proc/mdstat

Added to portage

2026-02-08

pyproject-fmt - 2.14.0
Ebuild name:

dev-python/pyproject-fmt-2.14.0

Description

Format your pyproject.toml file

Added to portage

2026-02-08

rar - 7.20
Ebuild name:

app-arch/rar-7.20

Description

RAR compressor/uncompressor

Added to portage

2026-02-08

s2geometry - 0.13.1-r1
Ebuild name:

sci-geosciences/s2geometry-0.13.1-r1

Description

Computational geometry and spatial indexing on the sphere

Added to portage

2026-02-08

slixmpp - 1.13.0
Ebuild name:

dev-python/slixmpp-1.13.0

Description

Python 3 library for XMPP

Added to portage

2026-02-08

sof-firmware - 2025.12.2
Ebuild name:

sys-firmware/sof-firmware-2025.12.2

Description

Sound Open Firmware (SOF) binary files

Added to portage

2026-02-08

stone-soup - 0.34.0
Ebuild name:

games-roguelike/stone-soup-0.34.0

Description

Role-playing roguelike game of exploration and treasure-hunting i

Added to portage

2026-02-08

systemd - 259.1
Ebuild name:

sys-apps/systemd-259.1

Description

System and service manager for Linux

Added to portage

2026-02-08

systemd-utils - 259.1
Ebuild name:

sys-apps/systemd-utils-259.1

Description

Utilities split out from systemd for OpenRC users

Added to portage

2026-02-08

tenacity - 9.1.4
Ebuild name:

dev-python/tenacity-9.1.4

Description

General-purpose retrying library

Added to portage

2026-02-08

turbovnc - 3.3
Ebuild name:

net-misc/turbovnc-3.3

Description

A fast replacement for TigerVNC

Added to portage

2026-02-08

unrar - 7.2.4
Ebuild name:

app-arch/unrar-7.2.4

Description

Uncompress rar files

Added to portage

2026-02-08

untrunc - 0_pre20260204
Ebuild name:

media-video/untrunc-0_pre20260204

Description

Restore truncated mp4/mov files

Added to portage

2026-02-08

virtualbox-kvm - 7.2.6_pre20260201
Ebuild name:

app-emulation/virtualbox-kvm-7.2.6_pre20260201

Description

Family of powerful x86 virtualization products for e

Added to portage

2026-02-08

wine-staging - 11.2
Ebuild name:

app-emulation/wine-staging-11.2

Description

Free implementation of Windows(tm) on Unix, with Wine-Staging patch

Added to portage

2026-02-08

xcalc - 1.1.3
Ebuild name:

x11-apps/xcalc-1.1.3

Description

scientific calculator for X

Added to portage

2026-02-08

z3 - 4.15.5
Ebuild name:

sci-mathematics/z3-4.15.5

Description

An efficient theorem prover

Added to portage

2026-02-08

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 80.7 ms