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:

90373

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-11-18
cloudpickle - 3.1.2-r1
Ebuild name:

dev-python/cloudpickle-3.1.2-r1

Description

Extended pickling support for Python objects

Added to portage

2026-11-18

libdbusmenu-lxqt - 0.5.0-r1
Ebuild name:

dev-libs/libdbusmenu-lxqt-0.5.0-r1

Description

LXQt DBusMenu Implementation

Added to portage

2026-11-18

liblxqt - 2.5.1
Ebuild name:

lxqt-base/liblxqt-2.5.1

Description

Common base library for the LXQt desktop environment

Added to portage

2026-11-18

lxqt-config - 2.5.1
Ebuild name:

lxqt-base/lxqt-config-2.5.1

Description

LXQt system configuration control center

Added to portage

2026-11-18

lxqt-panel - 2.5.1
Ebuild name:

lxqt-base/lxqt-panel-2.5.1

Description

LXQt desktop panel and plugins

Added to portage

2026-11-18

lxsession - 0.5.7
Ebuild name:

lxde-base/lxsession-0.5.7

Description

LXDE session manager

Added to portage

2026-11-18

nxml-gentoo-schemas - 20261117
Ebuild name:

app-emacs/nxml-gentoo-schemas-20261117

Description

Extension for nxml-mode with Gentoo-specific schemas

Added to portage

2026-11-18

openjdk - 11.0.33.1_p1
Ebuild name:

dev-java/openjdk-11.0.33.1_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-11-18

openjdk - 27.0.1.1_p4
Ebuild name:

dev-java/openjdk-27.0.1.1_p4

Description

Open source implementation of the Java programming language

Added to portage

2026-11-18

openjdk - 28_alpha24
Ebuild name:

dev-java/openjdk-28_alpha24

Description

Open source implementation of the Java programming language

Added to portage

2026-11-18

openjdk - 8.514_p01
Ebuild name:

dev-java/openjdk-8.514_p01

Description

Open source implementation of the Java programming language

Added to portage

2026-11-18

pavucontrol-qt - 2.5.1
Ebuild name:

media-sound/pavucontrol-qt-2.5.1

Description

Qt GUI Pulseaudio Mixer

Added to portage

2026-11-18

reaper-bin - 7.86
Ebuild name:

media-sound/reaper-bin-7.86

Description

Digital audio workstation

Added to portage

2026-11-18

tox - 0.2.25
Ebuild name:

net-libs/tox-0.2.25

Description

Encrypted P2P, messaging, and audio/video calling platform

Added to portage

2026-11-18

2026-11-17
R - 4.6.2
Ebuild name:

dev-lang/R-4.6.2

Description

Language and environment for statistical computing and graphics

Added to portage

2026-11-17

assertpy - 2.36.1
Ebuild name:

dev-python/assertpy-2.36.1

Description

Simple assertion library for unit testing in python with a fluent API

Added to portage

2026-11-17

authlib - 1.9.8
Ebuild name:

dev-python/authlib-1.9.8

Description

A Python library in building OAuth and OpenID Connect servers and clients

Added to portage

2026-11-17

aws-c-auth - 1.1.0
Ebuild name:

dev-libs/aws-c-auth-1.1.0

Description

AWS C Auth C99 library implementation of AWS client-side authentication

Added to portage

2026-11-17

aws-sam-translator - 1.117.0
Ebuild name:

dev-python/aws-sam-translator-1.117.0

Description

A library that transform SAM templates into AWS CloudFormatio

Added to portage

2026-11-17

borgbackup - 1.4.6_rc1
Ebuild name:

app-backup/borgbackup-1.4.6_rc1

Description

Deduplicating backup program with compression and authenticated enc

Added to portage

2026-11-17

clang-crossdev-wrappers - 24
Ebuild name:

sys-devel/clang-crossdev-wrappers-24

Description

Symlinks to a Clang crosscompiler

Added to portage

2026-11-17

click-option-group - 0.5.10
Ebuild name:

dev-python/click-option-group-0.5.10

Description

Click-extension package that adds option groups missing in Cli

Added to portage

2026-11-17

configargparse - 1.10.1
Ebuild name:

dev-python/configargparse-1.10.1

Description

Drop-in replacement for argparse supporting config files and env v

Added to portage

2026-11-17

courier - 2.0.10
Ebuild name:

mail-mta/courier-2.0.10

Description

An MTA designed specifically for maildirs

Added to portage

2026-11-17

cvmfs - 2.14.2
Ebuild name:

net-fs/cvmfs-2.14.2

Description

HTTP read-only file system for distributing software

Added to portage

2026-11-17

directx-headers - 1.620.2
Ebuild name:

dev-util/directx-headers-1.620.2

Description

DirectX header files and WSL stubs

Added to portage

2026-11-17

dist-kernel - 6.12.118
Ebuild name:

virtual/dist-kernel-6.12.118

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-11-17

dist-kernel - 6.18.64
Ebuild name:

virtual/dist-kernel-6.18.64

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-11-17

dist-kernel - 7.3.5
Ebuild name:

virtual/dist-kernel-7.3.5

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-11-17

ezgb - 0.2.2
Ebuild name:

dev-python/ezgb-0.2.2

Description

A standalone Python library for working with git-bug repositories

Added to portage

2026-11-17

firefox - 160.0.1
Ebuild name:

www-client/firefox-160.0.1

Description

Firefox Web Browser

Added to portage

2026-11-17

firefox-bin - 160.0.1
Ebuild name:

www-client/firefox-bin-160.0.1

Description

Firefox Web Browser

Added to portage

2026-11-17

firefox-l10n - 160.0.1
Ebuild name:

www-client/firefox-l10n-160.0.1

Description

Firefox Web Browser's translation files

Added to portage

2026-11-17

gentoo-kernel - 6.12.118
Ebuild name:

sys-kernel/gentoo-kernel-6.12.118

Description

Linux kernel built with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel - 6.18.64
Ebuild name:

sys-kernel/gentoo-kernel-6.18.64

Description

Linux kernel built with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel - 7.3.5
Ebuild name:

sys-kernel/gentoo-kernel-7.3.5

Description

Linux kernel built with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel-bin - 6.12.118
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.118

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel-bin - 6.18.64
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.64

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel-bin - 7.3.5
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.3.5

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-11-17

gentoo-kernel-modprep - 6.12.118
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.118

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-11-17

gentoo-kernel-modprep - 6.18.64
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.64

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-11-17

gentoo-kernel-modprep - 7.3.5
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.3.5

Description

Minimal subset of gentoo-kernel-bin for building modules, fo

Added to portage

2026-11-17

gentoo-sources - 6.12.118
Ebuild name:

sys-kernel/gentoo-sources-6.12.118

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-11-17

gentoo-sources - 6.18.64
Ebuild name:

sys-kernel/gentoo-sources-6.18.64

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-11-17

gentoo-sources - 7.3.5
Ebuild name:

sys-kernel/gentoo-sources-7.3.5

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-11-17

golly - 5.1
Ebuild name:

app-misc/golly-5.1

Description

Simulator for Conway's Game of Life and other cellular automata

Added to portage

2026-11-17

gucharmap - 18.0.0
Ebuild name:

gnome-extra/gucharmap-18.0.0

Description

Unicode character map viewer and library

Added to portage

2026-11-17

httpx2 - 2.16.2
Ebuild name:

dev-python/httpx2-2.16.2

Description

The next generation HTTP client (Pydantic fork)

Added to portage

2026-11-17

hyperfine - 2.0.0
Ebuild name:

app-benchmarks/hyperfine-2.0.0

Description

A command-line benchmarking tool

Added to portage

2026-11-17

imageio - 2.38.2
Ebuild name:

dev-python/imageio-2.38.2

Description

Python library for reading and writing image data

Added to portage

2026-11-17

indent-bars - 1.0.1
Ebuild name:

app-emacs/indent-bars-1.0.1

Description

Fast, configurable indentation guide-bars for Emacs

Added to portage

2026-11-17

inf-clojure - 3.3.0
Ebuild name:

app-emacs/inf-clojure-3.3.0

Description

Major mode for Clojure code

Added to portage

2026-11-17

inf-clojure - 3.4.0
Ebuild name:

app-emacs/inf-clojure-3.4.0

Description

Major mode for Clojure code

Added to portage

2026-11-17

libansilove - 1.4.6
Ebuild name:

dev-libs/libansilove-1.4.6

Description

library to convert ANSi and artscene related file formats into PNG image

Added to portage

2026-11-17

liblore - 0.10.2
Ebuild name:

dev-python/liblore-0.10.2

Description

Shared library for public-inbox / lore.kernel.org access

Added to portage

2026-11-17

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

media-libs/libva-intel-media-driver-26.4.2

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-11-17

libwebsockets - 5.1.0-r1
Ebuild name:

net-libs/libwebsockets-5.1.0-r1

Description

A flexible pure-C library for implementing network protocols

Added to portage

2026-11-17

lsp-plugins - 1.2.37
Ebuild name:

media-libs/lsp-plugins-1.2.37

Description

Linux Studio Plugins

Added to portage

2026-11-17

luau - 0.747
Ebuild name:

dev-lang/luau-0.747

Description

Gradually typed embeddable scripting language derived from Lua

Added to portage

2026-11-17

man-db - 2.13.3
Ebuild name:

sys-apps/man-db-2.13.3

Description

A man replacement that utilizes dbm instead of flat files

Added to portage

2026-11-17

mesa - 26.2.7
Ebuild name:

media-libs/mesa-26.2.7

Description

OpenGL-like graphic library for Linux

Added to portage

2026-11-17

mesa_clc - 26.2.7
Ebuild name:

dev-util/mesa_clc-26.2.7

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2026-11-17

miniupnpc - 2.3.5
Ebuild name:

dev-python/miniupnpc-2.3.5

Description

Python bindings for UPnP client library

Added to portage

2026-11-17

miniupnpc - 2.3.5
Ebuild name:

net-libs/miniupnpc-2.3.5

Description

UPnP client library and a simple UPnP client

Added to portage

2026-11-17

onionrouter - 0.6.2-r2
Ebuild name:

net-mail/onionrouter-0.6.2-r2

Description

.onion discovery via SRV DNS lookups for use with postfix

Added to portage

2026-11-17

openvpn - 2.7.9
Ebuild name:

net-vpn/openvpn-2.7.9

Description

Robust and highly flexible tunneling application compatible with many OSes

Added to portage

2026-11-17

pacparser - 1.5.4
Ebuild name:

net-libs/pacparser-1.5.4

Description

Library to parse proxy auto-config files

Added to portage

2026-11-17

puremagic - 2.3.0
Ebuild name:

dev-python/puremagic-2.3.0

Description

Pure python implementation of magic file detection

Added to portage

2026-11-17

python-multipart - 0.0.34
Ebuild name:

dev-python/python-multipart-0.0.34

Description

A streaming multipart parser for Python

Added to portage

2026-11-17

rizin - 0.8.2-r1
Ebuild name:

dev-util/rizin-0.8.2-r1

Description

reverse engineering framework for binary analysis

Added to portage

2026-11-17

rutorrent - 5.3.23
Ebuild name:

www-apps/rutorrent-5.3.23

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2026-11-17

sqlalchemy - 2.0.58
Ebuild name:

dev-python/sqlalchemy-2.0.58

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-11-17

sqlalchemy - 2.1.9
Ebuild name:

dev-python/sqlalchemy-2.1.9

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-11-17

sqlglot - 30.32.0
Ebuild name:

dev-python/sqlglot-30.32.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-11-17

syrupy - 7.0.2
Ebuild name:

dev-python/syrupy-7.0.2

Description

The sweeter pytest snapshot plugin

Added to portage

2026-11-17

tellico - 4.3.1
Ebuild name:

kde-misc/tellico-4.3.1

Description

Collection manager based on KDE Frameworks

Added to portage

2026-11-17

tomcat - 10.1.62
Ebuild name:

www-servers/tomcat-10.1.62

Description

Tomcat Servlet-6.0/JSP-3.1/EL-5.0/WebSocket-2.1/JASPIC-3.0 Container

Added to portage

2026-11-17

tree-sitter - 0.26.1-r1
Ebuild name:

dev-python/tree-sitter-0.26.1-r1

Description

Python bindings to the Tree-sitter parsing library

Added to portage

2026-11-17

ttyd - 1.7.7-r4
Ebuild name:

www-apps/ttyd-1.7.7-r4

Description

ttyd, a simple command-line tool for sharing terminal over the web

Added to portage

2026-11-17

types-gdb - 16.3.0.20261116
Ebuild name:

dev-python/types-gdb-16.3.0.20261116

Description

Typing stubs for gdb

Added to portage

2026-11-17

types-python-dateutil - 2.9.0.20261116
Ebuild name:

dev-python/types-python-dateutil-2.9.0.20261116

Description

Typing stubs for python-dateutil

Added to portage

2026-11-17

vanilla-kernel - 6.12.118
Ebuild name:

sys-kernel/vanilla-kernel-6.12.118

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-11-17

vanilla-kernel - 6.18.64
Ebuild name:

sys-kernel/vanilla-kernel-6.18.64

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-11-17

vanilla-kernel - 7.3.5
Ebuild name:

sys-kernel/vanilla-kernel-7.3.5

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-11-17

vanilla-sources - 6.12.118
Ebuild name:

sys-kernel/vanilla-sources-6.12.118

Description

Full sources for the Linux kernel

Added to portage

2026-11-17

vanilla-sources - 6.18.64
Ebuild name:

sys-kernel/vanilla-sources-6.18.64

Description

Full sources for the Linux kernel

Added to portage

2026-11-17

vanilla-sources - 7.3.5
Ebuild name:

sys-kernel/vanilla-sources-7.3.5

Description

Full sources for the Linux kernel

Added to portage

2026-11-17

xmag - 1.0.9
Ebuild name:

x11-apps/xmag-1.0.9

Description

X.Org xmag application

Added to portage

2026-11-17

zoom - 7.2.1.5760
Ebuild name:

net-im/zoom-7.2.1.5760

Description

Video conferencing and web conferencing service

Added to portage

2026-11-17

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