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:

87556

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-10
apache_exporter - 0-r1
Ebuild name:

acct-group/apache_exporter-0-r1

Description

Group used for the apache_exporter prometheus plugin

Added to portage

2026-08-10

apache_exporter - 0-r1
Ebuild name:

acct-user/apache_exporter-0-r1

Description

User for the apache_exporter prometheus plugin

Added to portage

2026-08-10

apache_exporter - 1.1.1
Ebuild name:

app-metrics/apache_exporter-1.1.1

Description

Prometheus exporter for apache metrics

Added to portage

2026-08-10

cjose - 0.6.2.7
Ebuild name:

dev-libs/cjose-0.6.2.7

Description

C library implementing the Javascript Object Signing and Encryption (JOSE)

Added to portage

2026-08-10

dnsdist - 2.1.1
Ebuild name:

net-dns/dnsdist-2.1.1

Description

A highly DNS-, DoS- and abuse-aware loadbalancer

Added to portage

2026-08-10

gajim - 2.5.0
Ebuild name:

net-im/gajim-2.5.0

Description

GTK XMPP Client

Added to portage

2026-08-10

gcc - 16.2.1_p20260808
Ebuild name:

sys-devel/gcc-16.2.1_p20260808

Description

The GNU Compiler Collection

Added to portage

2026-08-10

gcc - 17.0.0_p20260809
Ebuild name:

sys-devel/gcc-17.0.0_p20260809

Description

The GNU Compiler Collection

Added to portage

2026-08-10

gdal - 3.13.2
Ebuild name:

sci-libs/gdal-3.13.2

Description

Translator library for raster geospatial data formats (includes OGR support)

Added to portage

2026-08-10

gdbus-codegen - 2.88.3
Ebuild name:

dev-util/gdbus-codegen-2.88.3

Description

GDBus code and documentation generator

Added to portage

2026-08-10

gentoo-sources - 6.12.103
Ebuild name:

sys-kernel/gentoo-sources-6.12.103

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-10

gentoo-sources - 6.18.44
Ebuild name:

sys-kernel/gentoo-sources-6.18.44

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-10

gentoo-sources - 6.6.151
Ebuild name:

sys-kernel/gentoo-sources-6.6.151

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-10

gentoo-sources - 7.1.8
Ebuild name:

sys-kernel/gentoo-sources-7.1.8

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-10

git-sources - 7.2_rc7
Ebuild name:

sys-kernel/git-sources-7.2_rc7

Description

The very latest -git version of the Linux kernel

Added to portage

2026-08-10

glib - 2.88.3
Ebuild name:

dev-libs/glib-2.88.3

Description

The GLib library of C routines

Added to portage

2026-08-10

glib-utils - 2.88.3
Ebuild name:

dev-util/glib-utils-2.88.3

Description

Build utilities for GLib using projects

Added to portage

2026-08-10

ipmicfg - 1.38.0.260701
Ebuild name:

sys-apps/ipmicfg-1.38.0.260701

Description

An in-band utility for configuring Supermicro IPMI devices

Added to portage

2026-08-10

libcec - 8.1.6
Ebuild name:

dev-libs/libcec-8.1.6

Description

Library for communicating with the Pulse-Eight USB HDMI-CEC Adaptor

Added to portage

2026-08-10

libssh - 0.11.5
Ebuild name:

net-libs/libssh-0.11.5

Description

Access a working SSH implementation by means of a library

Added to portage

2026-08-10

libssh - 0.12.2
Ebuild name:

net-libs/libssh-0.12.2

Description

Access a working SSH implementation by means of a library

Added to portage

2026-08-10

lsp-mode - 10.0.0
Ebuild name:

app-emacs/lsp-mode-10.0.0

Description

Emacs client/library for the Language Server Protocol

Added to portage

2026-08-10

lsp-mode - 9999
Ebuild name:

app-emacs/lsp-mode-9999

Description

Emacs client/library for the Language Server Protocol

Added to portage

2026-08-10

mycli - 2.9.0
Ebuild name:

dev-db/mycli-2.9.0

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2026-08-10

nwjs - 0.114.0
Ebuild name:

dev-libs/nwjs-0.114.0

Description

Framework that lets you call all Node.js modules directly from the DOM

Added to portage

2026-08-10

odamex - 12.3.0
Ebuild name:

games-engines/odamex-12.3.0

Description

Online multiplayer free software engine for DOOM

Added to portage

2026-08-10

owntracks-recorder - 1.0.2
Ebuild name:

sci-geosciences/owntracks-recorder-1.0.2

Description

Stores and accesses location data published by the OwnTrac

Added to portage

2026-08-10

pysequoia - 0.1.34
Ebuild name:

dev-python/pysequoia-0.1.34

Description

Provides OpenPGP facilities using Sequoia-PGP library

Added to portage

2026-08-10

telega - 0.8.660_p20260806
Ebuild name:

app-emacs/telega-0.8.660_p20260806

Description

Full-featured unofficial GNU Emacs client for Telegram

Added to portage

2026-08-10

vanilla-sources - 6.12.103
Ebuild name:

sys-kernel/vanilla-sources-6.12.103

Description

Full sources for the Linux kernel

Added to portage

2026-08-10

vanilla-sources - 6.18.44
Ebuild name:

sys-kernel/vanilla-sources-6.18.44

Description

Full sources for the Linux kernel

Added to portage

2026-08-10

vanilla-sources - 6.6.151
Ebuild name:

sys-kernel/vanilla-sources-6.6.151

Description

Full sources for the Linux kernel

Added to portage

2026-08-10

vanilla-sources - 7.1.8
Ebuild name:

sys-kernel/vanilla-sources-7.1.8

Description

Full sources for the Linux kernel

Added to portage

2026-08-10

vivaldi - 8.1.4087.61-r1
Ebuild name:

www-client/vivaldi-8.1.4087.61-r1

Description

A browser for our friends

Added to portage

2026-08-10

zxing-cpp - 3.1.0
Ebuild name:

media-libs/zxing-cpp-3.1.0

Description

C++ Multi-format 1D/2D barcode image processing library

Added to portage

2026-08-10

2026-08-09
ada - 4.0.0
Ebuild name:

dev-cpp/ada-4.0.0

Description

WHATWG-compliant and fast URL parser written in modern C++

Added to portage

2026-08-09

alembic - 1.19.1
Ebuild name:

dev-python/alembic-1.19.1

Description

Database migrations tool, written by the author of SQLAlchemy

Added to portage

2026-08-09

authheaders - 0.16.3
Ebuild name:

dev-python/authheaders-0.16.3

Description

A library wrapping email authentication header verification and gener

Added to portage

2026-08-09

cachelib - 0.15.4
Ebuild name:

dev-python/cachelib-0.15.4

Description

Collection of cache libraries in the same API interface. Extracted from

Added to portage

2026-08-09

cappa - 0.32.2
Ebuild name:

dev-python/cappa-0.32.2

Description

Declarative CLI argument parser

Added to portage

2026-08-09

coturn - 4.17.2
Ebuild name:

net-im/coturn-4.17.2

Description

coturn TURN server project

Added to portage

2026-08-09

cppgir - 2.0_p20260518
Ebuild name:

dev-cpp/cppgir-2.0_p20260518

Description

GObject-Introspection C++ binding wrapper generator

Added to portage

2026-08-09

docstring-parser - 0.18.0
Ebuild name:

dev-python/docstring-parser-0.18.0

Description

Parse Python docstrings in reST, Google and Numpydoc format

Added to portage

2026-08-09

elementpath - 5.1.4
Ebuild name:

dev-python/elementpath-5.1.4

Description

XPath 1.0/2.0 parsers and selectors for ElementTree and lxml

Added to portage

2026-08-09

ensurepip-setuptools - 84.0.0
Ebuild name:

dev-python/ensurepip-setuptools-84.0.0

Description

Shared setuptools wheel for ensurepip Python module

Added to portage

2026-08-09

gradle-bin - 9.7.0
Ebuild name:

dev-java/gradle-bin-9.7.0

Description

A project automation and build tool with a Groovy based DSL

Added to portage

2026-08-09

huggingface_hub - 1.26.0-r1
Ebuild name:

sci-ml/huggingface_hub-1.26.0-r1

Description

a client library to interact with the Hugging Face Hub

Added to portage

2026-08-09

kicad - 10.0.5
Ebuild name:

sci-electronics/kicad-10.0.5

Description

Electronic Schematic and PCB design tools

Added to portage

2026-08-09

kicad-footprints - 10.0.5
Ebuild name:

sci-electronics/kicad-footprints-10.0.5

Description

Electronic Schematic and PCB design tools footprint librari

Added to portage

2026-08-09

kicad-meta - 10.0.5
Ebuild name:

sci-electronics/kicad-meta-10.0.5

Description

Electronic Schematic and PCB design tools (meta package)

Added to portage

2026-08-09

kicad-packages3d - 10.0.5
Ebuild name:

sci-electronics/kicad-packages3d-10.0.5

Description

Electronic Schematic and PCB design tools 3D package librar

Added to portage

2026-08-09

kicad-symbols - 10.0.5
Ebuild name:

sci-electronics/kicad-symbols-10.0.5

Description

Electronic Schematic and PCB design tools symbol libraries

Added to portage

2026-08-09

kicad-templates - 10.0.5
Ebuild name:

sci-electronics/kicad-templates-10.0.5

Description

Electronic Schematic and PCB design tools project templates

Added to portage

2026-08-09

levenshtein - 0.27.4
Ebuild name:

dev-python/levenshtein-0.27.4

Description

Functions for fast computation of Levenshtein distance, and edit oper

Added to portage

2026-08-09

lfe - 2.2.2
Ebuild name:

dev-lang/lfe-2.2.2

Description

Lisp-flavoured Erlang, a lisp syntax front-end to the Erlang compiler

Added to portage

2026-08-09

lsp-treemacs - 0.5
Ebuild name:

app-emacs/lsp-treemacs-0.5

Description

Integration between lsp-mode and treemacs

Added to portage

2026-08-09

lsp-ui - 8.0.1
Ebuild name:

app-emacs/lsp-ui-8.0.1

Description

UI modules for lsp-mode

Added to portage

2026-08-09

lsp-ui - 9.0.0
Ebuild name:

app-emacs/lsp-ui-9.0.0

Description

UI modules for lsp-mode

Added to portage

2026-08-09

lua-mode - 20210802
Ebuild name:

app-emacs/lua-mode-20210802

Description

An Emacs major mode for editing Lua scripts

Added to portage

2026-08-09

marshmallow - 4.3.1
Ebuild name:

dev-python/marshmallow-4.3.1

Description

A library for converting to and from native Python datatypes

Added to portage

2026-08-09

opera - 134.0.5954.46-r1
Ebuild name:

www-client/opera-134.0.5954.46-r1

Description

A fast and secure web browser

Added to portage

2026-08-09

opera-developer - 136.0.5981.0-r2
Ebuild name:

www-client/opera-developer-136.0.5981.0-r2

Description

A fast and secure web browser

Added to portage

2026-08-09

pdns - 5.0.7
Ebuild name:

net-dns/pdns-5.0.7

Description

The PowerDNS Daemon

Added to portage

2026-08-09

pdns - 5.1.4
Ebuild name:

net-dns/pdns-5.1.4

Description

The PowerDNS Daemon

Added to portage

2026-08-09

pdns-recursor - 5.3.10
Ebuild name:

net-dns/pdns-recursor-5.3.10

Description

The PowerDNS Recursor

Added to portage

2026-08-09

pdns-recursor - 5.4.5
Ebuild name:

net-dns/pdns-recursor-5.4.5

Description

The PowerDNS Recursor

Added to portage

2026-08-09

pkgcore - 0.12.38
Ebuild name:

sys-apps/pkgcore-0.12.38

Description

a framework for package management

Added to portage

2026-08-09

polychromatic - 0.9.8
Ebuild name:

sys-apps/polychromatic-0.9.8

Description

RGB lighting management software for GNU/Linux powered by OpenRazer

Added to portage

2026-08-09

pygit2 - 1.20.0
Ebuild name:

dev-python/pygit2-1.20.0

Description

Python bindings for libgit2

Added to portage

2026-08-09

pytest-forked - 1.7.5
Ebuild name:

dev-python/pytest-forked-1.7.5

Description

Run tests in isolated forked subprocesses

Added to portage

2026-08-09

setuptools - 84.0.0
Ebuild name:

dev-python/setuptools-84.0.0

Description

Collection of extensions to Distutils

Added to portage

2026-08-09

shell-maker - 0.96.1
Ebuild name:

app-emacs/shell-maker-0.96.1

Description

Interaction mode for making comint shells for GNU Emacs

Added to portage

2026-08-09

snakeoil - 0.11.4
Ebuild name:

dev-python/snakeoil-0.11.4

Description

misc common functionality and useful optimizations

Added to portage

2026-08-09

starlette - 1.6.0
Ebuild name:

dev-python/starlette-1.6.0

Description

The little ASGI framework that shines

Added to portage

2026-08-09

tdlib - 1.8.66
Ebuild name:

net-libs/tdlib-1.8.66

Description

Cross-platform library for building Telegram clients

Added to portage

2026-08-09

telegram-desktop - 7.0.9
Ebuild name:

net-im/telegram-desktop-7.0.9

Description

Official desktop client for Telegram

Added to portage

2026-08-09

telegram-desktop-bin - 7.0.9
Ebuild name:

net-im/telegram-desktop-bin-7.0.9

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-08-09

tldextract - 5.3.2
Ebuild name:

dev-python/tldextract-5.3.2

Description

Accurately separate the TLD from the registered domain and subdomains o

Added to portage

2026-08-09

transient - 0.13.7
Ebuild name:

app-emacs/transient-0.13.7

Description

Transient commands abstraction for GNU Emacs

Added to portage

2026-08-09

type-lens - 0.2.6
Ebuild name:

dev-python/type-lens-0.2.6

Description

A library that allows for utilizing Python types at runtime

Added to portage

2026-08-09

unicode-segmentation-rs - 0.3.3
Ebuild name:

dev-python/unicode-segmentation-rs-0.3.3

Description

Unicode segmentation and width for Python using Rust

Added to portage

2026-08-09

vertico - 2.12
Ebuild name:

app-emacs/vertico-2.12

Description

Vertical interactive completion

Added to portage

2026-08-09

virtualenv - 21.7.3
Ebuild name:

dev-python/virtualenv-21.7.3

Description

Virtual Python Environment builder

Added to portage

2026-08-09

wine-staging - 11.15
Ebuild name:

app-emulation/wine-staging-11.15

Description

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

Added to portage

2026-08-09

wine-vanilla - 11.15
Ebuild name:

app-emulation/wine-vanilla-11.15

Description

Free implementation of Windows(tm) on Unix, without external patch

Added to portage

2026-08-09

yaxmldiff - 0.3.0
Ebuild name:

dev-python/yaxmldiff-0.3.0

Description

Yet Another XML Differ

Added to portage

2026-08-09

ytmusicapi - 1.12.2
Ebuild name:

dev-python/ytmusicapi-1.12.2

Description

Unofficial API for YouTube Music

Added to portage

2026-08-09

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