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:

85920

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 (48 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-06-15
86Box - 6.0
Ebuild name:

app-emulation/86Box-6.0

Description

Emulator of x86-based machines based on PCem

Added to portage

2026-06-15

IP-Country-DB_File - 4.0.0
Ebuild name:

dev-perl/IP-Country-DB_File-4.0.0

Description

Build an IP address to country code database

Added to portage

2026-06-15

LuaBitOp - 1.0.3
Ebuild name:

dev-lua/LuaBitOp-1.0.3

Description

Bit Operations Library for the Lua Programming Language

Added to portage

2026-06-15

alacenc - 0.4.2
Ebuild name:

media-sound/alacenc-0.4.2

Description

Encodes audio into the Apple Lossless Audio Codec (ALAC) format

Added to portage

2026-06-15

bedrock-server - 1.26.23.1
Ebuild name:

games-server/bedrock-server-1.26.23.1

Description

The official bedrock (non-java) based server for the sandbox

Added to portage

2026-06-15

claude-code - 2.1.177
Ebuild name:

dev-util/claude-code-2.1.177

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-06-15

dist-kernel - 6.12.93-r1
Ebuild name:

virtual/dist-kernel-6.12.93-r1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-06-15

dist-kernel - 6.18.35-r1
Ebuild name:

virtual/dist-kernel-6.18.35-r1

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-06-15

faudio - 26.06
Ebuild name:

app-emulation/faudio-26.06

Description

Accuracy-focused XAudio reimplementation for open platforms

Added to portage

2026-06-15

gentoo-kernel-bin - 6.12.93-r1
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.93-r1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-06-15

gentoo-kernel-bin - 6.18.35-r1
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.35-r1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-06-15

gentoo-kernel-bin - 7.0.12-r1
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.0.12-r1

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-06-15

hydrus - 637
Ebuild name:

media-gfx/hydrus-637

Description

A booru-like media organizer for the desktop

Added to portage

2026-06-15

intel-compute-runtime - 26.22.38646.4
Ebuild name:

dev-libs/intel-compute-runtime-26.22.38646.4

Description

Intel Graphics Compute Runtime for oneAPI Level Zero a

Added to portage

2026-06-15

intel-graphics-compiler - 2.37.1
Ebuild name:

dev-util/intel-graphics-compiler-2.37.1

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel Gen

Added to portage

2026-06-15

intel-graphics-system-controller - 1.3.0
Ebuild name:

dev-util/intel-graphics-system-controller-1.3.0

Description

Intel graphics system controller firmware update li

Added to portage

2026-06-15

intel-metrics-discovery - 1.16.188
Ebuild name:

dev-libs/intel-metrics-discovery-1.16.188

Description

A user mode library that provides access to GPU performan

Added to portage

2026-06-15

intel-metrics-library - 1.0.231
Ebuild name:

dev-libs/intel-metrics-library-1.0.231

Description

User mode driver helper library that provides access to GPU

Added to portage

2026-06-15

ipmicfg - 1.37.0.250723
Ebuild name:

sys-apps/ipmicfg-1.37.0.250723

Description

An in-band utility for configuring Supermicro IPMI devices

Added to portage

2026-06-15

ipmiview - 2.24.0.251224
Ebuild name:

net-misc/ipmiview-2.24.0.251224

Description

A GUI application that allows to manage multiple target systems thr

Added to portage

2026-06-15

knot - 3.5.5
Ebuild name:

net-dns/knot-3.5.5

Description

High-performance authoritative-only DNS server

Added to portage

2026-06-15

level-zero - 1.30.0
Ebuild name:

dev-libs/level-zero-1.30.0

Description

oneAPI Level Zero headers, loader and validation layer

Added to portage

2026-06-15

luadbi - 0.7.5
Ebuild name:

dev-lua/luadbi-0.7.5

Description

A database interface library for Lua

Added to portage

2026-06-15

luajson - 1.3.5
Ebuild name:

dev-lua/luajson-1.3.5

Description

JSON Parser/Constructor for Lua

Added to portage

2026-06-15

m-buffer - 0.16.1
Ebuild name:

app-emacs/m-buffer-0.16.1

Description

List Oriented Buffer Operations for Emacs

Added to portage

2026-06-15

macrostep - 0.9.5
Ebuild name:

app-emacs/macrostep-0.9.5

Description

Interactive macro-expander for Emacs

Added to portage

2026-06-15

macrostep-geiser - 0.2.0_p20210717
Ebuild name:

app-emacs/macrostep-geiser-0.2.0_p20210717

Description

Emacs macrostep back-end powered by geiser

Added to portage

2026-06-15

metee - 6.2.4
Ebuild name:

dev-libs/metee-6.2.4

Description

Cross-platform access library for Intel CSME HECI interface

Added to portage

2026-06-15

mysqltuner - 2.8.44
Ebuild name:

dev-db/mysqltuner-2.8.44

Description

Makes recommendations for increased performance and stability for MySQL

Added to portage

2026-06-15

networkmanager-strongswan - 1.6.5
Ebuild name:

net-vpn/networkmanager-strongswan-1.6.5

Description

NetworkManager StrongSwan plugin

Added to portage

2026-06-15

opencl-clang - 16.0.12
Ebuild name:

dev-libs/opencl-clang-16.0.12

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 17.0.7
Ebuild name:

dev-libs/opencl-clang-17.0.7

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 18.1.6
Ebuild name:

dev-libs/opencl-clang-18.1.6

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 19.1.4
Ebuild name:

dev-libs/opencl-clang-19.1.4

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 20.1.4
Ebuild name:

dev-libs/opencl-clang-20.1.4

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 21.1.4
Ebuild name:

dev-libs/opencl-clang-21.1.4

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

opencl-clang - 22.1.1
Ebuild name:

dev-libs/opencl-clang-22.1.1

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-06-15

openrct2 - 0.5.2
Ebuild name:

games-simulation/openrct2-0.5.2

Description

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

Added to portage

2026-06-15

prosody - 13.0.6
Ebuild name:

net-im/prosody-13.0.6

Description

Prosody is a modern XMPP communication server

Added to portage

2026-06-15

redis-knot - 3.5.5
Ebuild name:

net-dns/redis-knot-3.5.5

Description

Redis module for Knot DNS

Added to portage

2026-06-15

rrdtool - 1.10.3
Ebuild name:

net-analyzer/rrdtool-1.10.3

Description

A data logging and graphing system for time series data

Added to portage

2026-06-15

smcipmitool - 2.30.0.250915
Ebuild name:

sys-apps/smcipmitool-2.30.0.250915

Description

An out-of-band utility for interfacing with SuperBlade and IPMI

Added to portage

2026-06-15

sphinx-panels - 0.6.0-r2
Ebuild name:

dev-python/sphinx-panels-0.6.0-r2

Description

A sphinx extension for creating panels in a grid layout

Added to portage

2026-06-15

stress-ng - 0.21.03
Ebuild name:

app-benchmarks/stress-ng-0.21.03

Description

Stress test for a computer system with various selectable ways

Added to portage

2026-06-15

superdiag - 1.11.0.20251106
Ebuild name:

sys-apps/superdiag-1.11.0.20251106

Description

Provides the capability to determine the health of Supermicro se

Added to portage

2026-06-15

tas - 1.11.0.260514
Ebuild name:

sys-apps/tas-1.11.0.260514

Description

Supermicro Thin-Agent Service for monitoring through the BMC/IPMI

Added to portage

2026-06-15

tlp - 1.10.1
Ebuild name:

sys-power/tlp-1.10.1

Description

Optimize laptop battery life

Added to portage

2026-06-15

tlp - 1.9.1-r1
Ebuild name:

sys-power/tlp-1.9.1-r1

Description

Optimize laptop battery life

Added to portage

2026-06-15

unifi - 10.4.57
Ebuild name:

net-wireless/unifi-10.4.57

Description

A Management Controller for Ubiquiti Networks UniFi APs

Added to portage

2026-06-15

vanilla-sources - 7.1.0
Ebuild name:

sys-kernel/vanilla-sources-7.1.0

Description

Full sources for the Linux kernel

Added to portage

2026-06-15

2026-06-14
ansilove - 4.2.2
Ebuild name:

media-gfx/ansilove-4.2.2

Description

ANSI and ASCII art to PNG converter (using libansilove)

Added to portage

2026-06-14

asymptote - 3.12
Ebuild name:

media-gfx/asymptote-3.12

Description

A vector graphics language that provides a framework for technical drawing

Added to portage

2026-06-14

cava - 1.0.0
Ebuild name:

media-sound/cava-1.0.0

Description

Console-based Audio Visualizer for Alsa

Added to portage

2026-06-14

cproto - 4.8
Ebuild name:

dev-util/cproto-4.8

Description

Generate C function prototypes from C source code

Added to portage

2026-06-14

easycrypt - 2026.06
Ebuild name:

sci-mathematics/easycrypt-2026.06

Description

Computer-Aided Cryptographic Proofs

Added to portage

2026-06-14

elementpath - 5.1.2
Ebuild name:

dev-python/elementpath-5.1.2

Description

XPath 1.0/2.0 parsers and selectors for ElementTree and lxml

Added to portage

2026-06-14

filelock - 3.29.4
Ebuild name:

dev-python/filelock-3.29.4

Description

A platform independent file lock for Python

Added to portage

2026-06-14

gallery-dl - 1.32.3
Ebuild name:

net-misc/gallery-dl-1.32.3

Description

Download image galleries and collections from several image hosting site

Added to portage

2026-06-14

kismet - 2025.09.1-r1
Ebuild name:

net-wireless/kismet-2025.09.1-r1

Description

IEEE 802.11 wireless LAN sniffer

Added to portage

2026-06-14

man-pages-l10n - 4.30.2
Ebuild name:

app-i18n/man-pages-l10n-4.30.2

Description

A somewhat comprehensive collection of man page translations

Added to portage

2026-06-14

nss - 3.125
Ebuild name:

dev-libs/nss-3.125

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2026-06-14

peewee - 4.0.8
Ebuild name:

dev-python/peewee-4.0.8

Description

Small Python ORM

Added to portage

2026-06-14

pygit2 - 1.19.3
Ebuild name:

dev-python/pygit2-1.19.3

Description

Python bindings for libgit2

Added to portage

2026-06-14

pyproject-fmt - 2.24.1
Ebuild name:

dev-python/pyproject-fmt-2.24.1

Description

Format your pyproject.toml file

Added to portage

2026-06-14

pyrate-limiter - 4.3.1
Ebuild name:

dev-python/pyrate-limiter-4.3.1

Description

Python Rate-Limiter using Leaky-Bucket Algorimth Family

Added to portage

2026-06-14

pytest - 9.1.0
Ebuild name:

dev-python/pytest-9.1.0

Description

Simple powerful testing with Python

Added to portage

2026-06-14

pytest-order - 1.5.0
Ebuild name:

dev-python/pytest-order-1.5.0

Description

pytest plugin to run your tests in a specific order

Added to portage

2026-06-14

signxml - 4.5.1
Ebuild name:

dev-python/signxml-4.5.1

Description

Python XML Signature and XAdES library

Added to portage

2026-06-14

sybil - 10.1.0
Ebuild name:

dev-python/sybil-10.1.0

Description

Automated testing for the examples in your documentation

Added to portage

2026-06-14

terminus-font - 4.49.1-r3
Ebuild name:

media-fonts/terminus-font-4.49.1-r3

Description

A clean fixed font for the console and X11

Added to portage

2026-06-14

virtualenv - 21.5.0
Ebuild name:

dev-python/virtualenv-21.5.0

Description

Virtual Python Environment builder

Added to portage

2026-06-14

wine-staging - 11.11
Ebuild name:

app-emulation/wine-staging-11.11

Description

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

Added to portage

2026-06-14

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