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:

87947

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-08-26
acr38u - 1.7.11-r5
Ebuild name:

app-crypt/acr38u-1.7.11-r5

Description

Non CCID driver for ACR38 AC1038-based Smart Card Reader

Added to portage

2026-08-26

libmd - 1.1.0
Ebuild name:

app-crypt/libmd-1.1.0

Description

Message Digest functions from BSD systems

Added to portage

2026-08-26

2026-08-25
asymptote - 3.13-r1
Ebuild name:

media-gfx/asymptote-3.13-r1

Description

A vector graphics language that provides a framework for technical draw

Added to portage

2026-08-25

aws-sam-translator - 1.113.0
Ebuild name:

dev-python/aws-sam-translator-1.113.0

Description

A library that transform SAM templates into AWS CloudFormatio

Added to portage

2026-08-25

boto3 - 1.43.79
Ebuild name:

dev-python/boto3-1.43.79

Description

The AWS SDK for Python

Added to portage

2026-08-25

botocore - 1.43.79
Ebuild name:

dev-python/botocore-1.43.79

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-25

btrfs-assistant - 2.3.1
Ebuild name:

app-admin/btrfs-assistant-2.3.1

Description

GUI management tool to make managing a Btrfs filesystem easier

Added to portage

2026-08-25

certbot - 5.5.0-r2
Ebuild name:

app-crypt/certbot-5.5.0-r2

Description

Let's Encrypt client to automate deployment of X.509 certificates

Added to portage

2026-08-25

certbot - 5.6.0-r2
Ebuild name:

app-crypt/certbot-5.6.0-r2

Description

Let's Encrypt client to automate deployment of X.509 certificates

Added to portage

2026-08-25

certbot - 5.7.0-r1
Ebuild name:

app-crypt/certbot-5.7.0-r1

Description

Let's Encrypt client to automate deployment of X.509 certificates

Added to portage

2026-08-25

claude-code - 2.1.241
Ebuild name:

dev-util/claude-code-2.1.241

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-08-25

cliff - 4.16.0
Ebuild name:

dev-python/cliff-4.16.0

Description

Command Line Interface Formulation Framework

Added to portage

2026-08-25

csharp-language-server - 0.27.0
Ebuild name:

dev-dotnet/csharp-language-server-0.27.0

Description

Roslyn-based LSP language server for C

Added to portage

2026-08-25

docker-compose - 5.5.0
Ebuild name:

app-containers/docker-compose-5.5.0

Description

Multi-container orchestration for Docker

Added to portage

2026-08-25

dropbox - 266.4.3911
Ebuild name:

net-misc/dropbox-266.4.3911

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2026-08-25

dulwich - 1.2.13
Ebuild name:

dev-python/dulwich-1.2.13

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2026-08-25

flask-caching - 2.5.0
Ebuild name:

dev-python/flask-caching-2.5.0

Description

Adds caching support to Flask applications

Added to portage

2026-08-25

folium - 0.20.0-r2
Ebuild name:

sci-geosciences/folium-0.20.0-r2

Description

Python Data, Leaflet.js Maps

Added to portage

2026-08-25

gap - 4.16.1
Ebuild name:

sci-mathematics/gap-4.16.1

Description

System for computational discrete algebra (core functionality)

Added to portage

2026-08-25

gdb - 17.2-r1
Ebuild name:

dev-debug/gdb-17.2-r1

Description

GNU debugger

Added to portage

2026-08-25

gfxreconstruct - 1.4.357.0
Ebuild name:

dev-debug/gfxreconstruct-1.4.357.0

Description

Graphics API Capture and Replay Tools

Added to portage

2026-08-25

ggml - 0.22.0
Ebuild name:

sci-ml/ggml-0.22.0

Description

Tensor library for machine learning

Added to portage

2026-08-25

gnuradio - 3.10.9999
Ebuild name:

net-wireless/gnuradio-3.10.9999

Description

Toolkit that provides signal processing blocks to implement softwar

Added to portage

2026-08-25

gnuradio - 9999
Ebuild name:

net-wireless/gnuradio-9999

Description

Toolkit that provides signal processing blocks to implement software rad

Added to portage

2026-08-25

golangci-lint - 2.13.1
Ebuild name:

dev-go/golangci-lint-2.13.1

Description

Fast linters runner for Go

Added to portage

2026-08-25

gunicorn - 26.2.0
Ebuild name:

www-servers/gunicorn-26.2.0

Description

A WSGI HTTP Server for UNIX

Added to portage

2026-08-25

imagesize - 2.0.1
Ebuild name:

dev-python/imagesize-2.0.1

Description

Pure Python module for getting image size from png/jpeg/jpeg2000/gif fil

Added to portage

2026-08-25

joplin-desktop - 3.7.12
Ebuild name:

app-office/joplin-desktop-3.7.12

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-08-25

kmscon - 10.0.2
Ebuild name:

sys-apps/kmscon-10.0.2

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-08-25

krb5 - 0.10.0
Ebuild name:

dev-python/krb5-0.10.0

Description

Kerberos API bindings for Python

Added to portage

2026-08-25

kwin - 6.7.4-r2
Ebuild name:

kde-plasma/kwin-6.7.4-r2

Description

Flexible, composited Window Manager for windowing systems on Linux

Added to portage

2026-08-25

libnvidia-container - 1.20.0
Ebuild name:

sys-libs/libnvidia-container-1.20.0

Description

NVIDIA container runtime library

Added to portage

2026-08-25

libva-intel-media-driver - 26.3.2
Ebuild name:

media-libs/libva-intel-media-driver-26.3.2

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-08-25

limine - 12.6.1
Ebuild name:

sys-boot/limine-12.6.1

Description

Modern, secure, portable, multiprotocol bootloader and boot manager

Added to portage

2026-08-25

linkify-it-py - 2.1.1
Ebuild name:

dev-python/linkify-it-py-2.1.1

Description

Links recognition library with full unicode support

Added to portage

2026-08-25

lttng-modules - 2.14.7
Ebuild name:

dev-util/lttng-modules-2.14.7

Description

LTTng Kernel Tracer Modules

Added to portage

2026-08-25

melonds - 1.1-r2
Ebuild name:

games-emulation/melonds-1.1-r2

Description

Nintendo DS emulator, sorta

Added to portage

2026-08-25

motif - 2.5.2-r1
Ebuild name:

x11-libs/motif-2.5.2-r1

Description

The Motif user interface component toolkit

Added to portage

2026-08-25

nushell - 0.115.1
Ebuild name:

app-shells/nushell-0.115.1

Description

A new type of shell, written in Rust

Added to portage

2026-08-25

nvidia-container-toolkit - 1.20.0
Ebuild name:

app-containers/nvidia-container-toolkit-1.20.0

Description

NVIDIA container runtime toolkit

Added to portage

2026-08-25

openlibm - 0.8.7
Ebuild name:

sci-libs/openlibm-0.8.7

Description

High quality system independent, open source libm

Added to portage

2026-08-25

openssl - 3.0.22
Ebuild name:

dev-libs/openssl-3.0.22

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security

Added to portage

2026-08-25

openssl - 3.4.7
Ebuild name:

dev-libs/openssl-3.4.7

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security (

Added to portage

2026-08-25

openssl - 3.5.8
Ebuild name:

dev-libs/openssl-3.5.8

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security (

Added to portage

2026-08-25

openssl - 3.6.4
Ebuild name:

dev-libs/openssl-3.6.4

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security (

Added to portage

2026-08-25

openssl - 4.0.2
Ebuild name:

dev-libs/openssl-4.0.2

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security (

Added to portage

2026-08-25

openssl-compat - 3.6.4
Ebuild name:

dev-libs/openssl-compat-3.6.4

Description

Full-strength general purpose cryptography library (including SSL and

Added to portage

2026-08-25

org-mode - 9.8.9
Ebuild name:

app-emacs/org-mode-9.8.9

Description

An Emacs mode for notes and project planning

Added to portage

2026-08-25

oslo-utils - 10.2.0
Ebuild name:

dev-python/oslo-utils-10.2.0

Description

Oslo Utility library

Added to portage

2026-08-25

pbr - 7.1.1
Ebuild name:

dev-python/pbr-7.1.1

Description

Inject some useful and sensible default behaviors into setuptools

Added to portage

2026-08-25

pixi - 0.77.1
Ebuild name:

dev-util/pixi-0.77.1

Description

A package management and workflow tool

Added to portage

2026-08-25

plasma-nm - 6.7.4-r2
Ebuild name:

kde-plasma/plasma-nm-6.7.4-r2

Description

KDE Plasma applet for NetworkManager

Added to portage

2026-08-25

platformdirs - 4.11.4
Ebuild name:

dev-python/platformdirs-4.11.4

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-08-25

portage - 3.0.82.1
Ebuild name:

sys-apps/portage-3.0.82.1

Description

The package management and distribution system for Gentoo

Added to portage

2026-08-25

postgis - 3.7.0_rc1
Ebuild name:

dev-db/postgis-3.7.0_rc1

Description

Geographic Objects for PostgreSQL

Added to portage

2026-08-25

pyproject-fmt - 2.28.1
Ebuild name:

dev-python/pyproject-fmt-2.28.1

Description

Format your pyproject.toml file

Added to portage

2026-08-25

python-discovery - 1.5.3
Ebuild name:

dev-python/python-discovery-1.5.3

Description

Python interpreter discovery

Added to portage

2026-08-25

qrupdate - 1.2.0
Ebuild name:

sci-libs/qrupdate-1.2.0

Description

Library for updating of QR and Cholesky decompositions

Added to portage

2026-08-25

qtbase - 6.11.2-r1
Ebuild name:

dev-qt/qtbase-6.11.2-r1

Description

Cross-platform application development framework

Added to portage

2026-08-25

r10k - 5.0.2-r1
Ebuild name:

app-admin/r10k-5.0.2-r1

Description

Puppet environment and module deployment

Added to portage

2026-08-25

scalapack - 2.2.2
Ebuild name:

sci-libs/scalapack-2.2.2

Description

Subset of LAPACK routines redesigned for heterogenous (MPI) computing

Added to portage

2026-08-25

scalapack - 2.2.3
Ebuild name:

sci-libs/scalapack-2.2.3

Description

Subset of LAPACK routines redesigned for heterogenous (MPI) computing

Added to portage

2026-08-25

scotch - 7.0.13
Ebuild name:

sci-libs/scotch-7.0.13

Description

Software for graph, mesh and hypergraph partitioning

Added to portage

2026-08-25

securesystemslib - 1.5.0
Ebuild name:

dev-python/securesystemslib-1.5.0

Description

Cryptographic routines for Secure Systems Lab projects at NYU

Added to portage

2026-08-25

shtab - 1.12.0
Ebuild name:

dev-python/shtab-1.12.0

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-08-25

sphinx-autodoc-typehints - 3.13.4
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.13.4

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-08-25

spleen - 2.2.0
Ebuild name:

media-fonts/spleen-2.2.0

Description

Monospaced bitmap fonts for consoles and terminals

Added to portage

2026-08-25

squid - 7.7
Ebuild name:

net-proxy/squid-7.7

Description

Full-featured web proxy cache

Added to portage

2026-08-25

sundials - 7.8.0
Ebuild name:

sci-libs/sundials-7.8.0

Description

Suite of nonlinear solvers

Added to portage

2026-08-25

tavern - 3.6.2
Ebuild name:

dev-python/tavern-3.6.2

Description

A tool, library, and Pytest plugin for testing RESTful APIs

Added to portage

2026-08-25

time-machine - 3.5.0
Ebuild name:

dev-python/time-machine-3.5.0

Description

Travel through time in your tests

Added to portage

2026-08-25

vertico - 2.13
Ebuild name:

app-emacs/vertico-2.13

Description

Vertical interactive completion

Added to portage

2026-08-25

webkit-gtk - 2.52.6-r410
Ebuild name:

net-libs/webkit-gtk-2.52.6-r410

Description

Open source web browser engine

Added to portage

2026-08-25

webkit-gtk - 2.52.6-r600
Ebuild name:

net-libs/webkit-gtk-2.52.6-r600

Description

Open source web browser engine

Added to portage

2026-08-25

zabbix - 7.0.30
Ebuild name:

net-analyzer/zabbix-7.0.30

Description

ZABBIX is software for monitoring of your applications, network and serv

Added to portage

2026-08-25

zabbix - 7.4.14
Ebuild name:

net-analyzer/zabbix-7.4.14

Description

ZABBIX is software for monitoring of your applications, network and serv

Added to portage

2026-08-25

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