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:

88967

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-10-06
aiohttp - 3.14.4
Ebuild name:

dev-python/aiohttp-3.14.4

Description

HTTP client/server for asyncio

Added to portage

2026-10-06

amqp - 5.4.1
Ebuild name:

dev-python/amqp-5.4.1

Description

Low-level AMQP client for Python (fork of amqplib)

Added to portage

2026-10-06

aws-c-s3 - 1.3.1
Ebuild name:

dev-libs/aws-c-s3-1.3.1

Description

AWS C S3 async library

Added to portage

2026-10-06

borgmatic - 2.1.10
Ebuild name:

app-backup/borgmatic-2.1.10

Description

Automatically create, prune and verify backups with borgbackup

Added to portage

2026-10-06

cachetools - 7.2.1
Ebuild name:

dev-python/cachetools-7.2.1

Description

Extensible memoizing collections and decorators

Added to portage

2026-10-06

cloudflare - 5.9.0
Ebuild name:

dev-python/cloudflare-5.9.0

Description

The official Python library for the Cloudflare API

Added to portage

2026-10-06

dkms - 3.4.4
Ebuild name:

sys-kernel/dkms-3.4.4

Description

Dynamic Kernel Module Support

Added to portage

2026-10-06

faker - 40.41.0
Ebuild name:

dev-python/faker-40.41.0

Description

A Python package that generates fake data for you

Added to portage

2026-10-06

filelock - 4.0.12
Ebuild name:

dev-python/filelock-4.0.12

Description

A platform independent file lock for Python

Added to portage

2026-10-06

ggml - 0.26.0
Ebuild name:

sci-ml/ggml-0.26.0

Description

Tensor library for machine learning

Added to portage

2026-10-06

git-bug - 0.11.0
Ebuild name:

dev-util/git-bug-0.11.0

Description

Distributed, offline-first bug tracker embedded in git

Added to portage

2026-10-06

google-api-core - 2.41.0
Ebuild name:

dev-python/google-api-core-2.41.0

Description

Core Library for Google Client Libraries

Added to portage

2026-10-06

google-auth - 2.60.0
Ebuild name:

dev-python/google-auth-2.60.0

Description

Google Authentication Library

Added to portage

2026-10-06

gromacs - 2025.5
Ebuild name:

sci-chemistry/gromacs-2025.5

Description

The ultimate molecular dynamics simulation package

Added to portage

2026-10-06

gromacs - 2026.4
Ebuild name:

sci-chemistry/gromacs-2026.4

Description

The ultimate molecular dynamics simulation package

Added to portage

2026-10-06

gst-plugin-gtk4 - 0.13.4-r1
Ebuild name:

media-plugins/gst-plugin-gtk4-0.13.4-r1

Description

GStreamer GTK 4 sink element

Added to portage

2026-10-06

hcloud - 2.27.0
Ebuild name:

dev-python/hcloud-2.27.0

Description

Official Hetzner Cloud python library

Added to portage

2026-10-06

httpx-aiohttp - 0.2.0
Ebuild name:

dev-python/httpx-aiohttp-0.2.0

Description

Aiohttp transport for HTTPX

Added to portage

2026-10-06

hypothesis - 6.168.4
Ebuild name:

dev-python/hypothesis-6.168.4

Description

A library for property based testing

Added to portage

2026-10-06

hypothesis - 6.168.5
Ebuild name:

dev-python/hypothesis-6.168.5

Description

A library for property based testing

Added to portage

2026-10-06

jellyfin-bin - 12.2
Ebuild name:

www-apps/jellyfin-bin-12.2

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-10-06

jsonpath-ng - 1.9.0
Ebuild name:

dev-python/jsonpath-ng-1.9.0

Description

Python JSONPath Next-Generation

Added to portage

2026-10-06

libcap-ng - 0.9.6
Ebuild name:

sys-libs/libcap-ng-0.9.6

Description

POSIX 1003.1e capabilities

Added to portage

2026-10-06

libfabric - 2.3.1-r1
Ebuild name:

sys-block/libfabric-2.3.1-r1

Description

The Open Fabrics Interfaces (OFI) framework

Added to portage

2026-10-06

mariadb-connector-odbc - 3.1.24
Ebuild name:

dev-db/mariadb-connector-odbc-3.1.24

Description

MariaDB Connector/ODBC

Added to portage

2026-10-06

mariadb-connector-odbc - 3.2.10
Ebuild name:

dev-db/mariadb-connector-odbc-3.2.10

Description

MariaDB Connector/ODBC

Added to portage

2026-10-06

mumps - 5.3.5-r2
Ebuild name:

sci-libs/mumps-5.3.5-r2

Description

MUltifrontal Massively Parallel sparse direct matrix Solver

Added to portage

2026-10-06

nodejs - 26.10.0-r3
Ebuild name:

net-libs/nodejs-26.10.0-r3

Description

A JavaScript runtime built on Chrome's V8 JavaScript engine

Added to portage

2026-10-06

notebook - 7.5.8
Ebuild name:

dev-python/notebook-7.5.8

Description

Jupyter Interactive Notebook

Added to portage

2026-10-06

prismlauncher - 11.1.1
Ebuild name:

games-action/prismlauncher-11.1.1

Description

Custom, open source Minecraft launcher

Added to portage

2026-10-06

protontricks - 1.15.0
Ebuild name:

app-emulation/protontricks-1.15.0

Description

app-emulation/winetricks wrapper for Proton (Steam Play) games

Added to portage

2026-10-06

pycares - 5.1.0
Ebuild name:

dev-python/pycares-5.1.0

Description

Python interface for c-ares

Added to portage

2026-10-06

pytest-httpserver - 1.2.0
Ebuild name:

dev-python/pytest-httpserver-1.2.0

Description

HTTP server for pytest to test HTTP clients

Added to portage

2026-10-06

sphinxcontrib-httpdomain - 2.1.0
Ebuild name:

dev-python/sphinxcontrib-httpdomain-2.1.0

Description

Sphinx domain for documenting HTTP APIs

Added to portage

2026-10-06

svglib - 2.3.0
Ebuild name:

dev-python/svglib-2.3.0

Description

Pure-Python library for reading and converting SVG

Added to portage

2026-10-06

tox - 4.64.9
Ebuild name:

dev-python/tox-4.64.9

Description

virtualenv-based automation of test activities

Added to portage

2026-10-06

urwid - 4.2.5
Ebuild name:

dev-python/urwid-4.2.5

Description

Curses-based user interface library for Python

Added to portage

2026-10-06

2026-10-05
asyncssh - 2.24.1
Ebuild name:

dev-python/asyncssh-2.24.1

Description

Asynchronous SSHv2 client and server library

Added to portage

2026-10-05

b2sdk - 2.13.1
Ebuild name:

dev-python/b2sdk-2.13.1

Description

Library to access Backblaze B2 cloud storage

Added to portage

2026-10-05

bcachefs-tools - 1.39.7
Ebuild name:

sys-fs/bcachefs-tools-1.39.7

Description

Tools for bcachefs

Added to portage

2026-10-05

black - 26.10.0
Ebuild name:

dev-python/black-26.10.0

Description

The uncompromising Python code formatter

Added to portage

2026-10-05

blake3 - 1.8.7
Ebuild name:

dev-libs/blake3-1.8.7

Description

a fast cryptographic hash function

Added to portage

2026-10-05

cppcheck - 2.21.0
Ebuild name:

dev-util/cppcheck-2.21.0

Description

Static analyzer of C/C++ code

Added to portage

2026-10-05

expat - 2.9.0
Ebuild name:

dev-libs/expat-2.9.0

Description

Stream-oriented XML parser library

Added to portage

2026-10-05

filelock - 4.0.11
Ebuild name:

dev-python/filelock-4.0.11

Description

A platform independent file lock for Python

Added to portage

2026-10-05

gcc - 14.4.1_p20261001
Ebuild name:

sys-devel/gcc-14.4.1_p20261001

Description

The GNU Compiler Collection

Added to portage

2026-10-05

gcc - 15.3.1_p20261002
Ebuild name:

sys-devel/gcc-15.3.1_p20261002

Description

The GNU Compiler Collection

Added to portage

2026-10-05

gcc - 16.2.1_p20261003
Ebuild name:

sys-devel/gcc-16.2.1_p20261003

Description

The GNU Compiler Collection

Added to portage

2026-10-05

gcc - 17.0.0_p20261004
Ebuild name:

sys-devel/gcc-17.0.0_p20261004

Description

The GNU Compiler Collection

Added to portage

2026-10-05

git-sources - 7.3_rc6
Ebuild name:

sys-kernel/git-sources-7.3_rc6

Description

The very latest -git version of the Linux kernel

Added to portage

2026-10-05

glycin-loaders - 1.2.4-r1
Ebuild name:

media-libs/glycin-loaders-1.2.4-r1

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2026-10-05

glycin-loaders - 2.2.1-r1
Ebuild name:

media-libs/glycin-loaders-2.2.1-r1

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2026-10-05

gmpy2 - 2.3.2
Ebuild name:

dev-python/gmpy2-2.3.2

Description

Python bindings for GMP, MPC, MPFR and MPIR libraries

Added to portage

2026-10-05

hideousdestructor - 5.0.1a
Ebuild name:

games-fps/hideousdestructor-5.0.1a

Description

UZDoom modification for realistic movement, physics, weapons and

Added to portage

2026-10-05

jitterentropy - 3.6.3
Ebuild name:

app-crypt/jitterentropy-3.6.3

Description

Hardware RNG based on CPU timing jitter

Added to portage

2026-10-05

lrzip - 0.7.3
Ebuild name:

app-arch/lrzip-0.7.3

Description

Long Range ZIP or Lzma RZIP optimized for compressing large files

Added to portage

2026-10-05

mesa - 26.2.4
Ebuild name:

media-libs/mesa-26.2.4

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-05

mesa_clc - 26.2.4
Ebuild name:

dev-util/mesa_clc-26.2.4

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2026-10-05

mongo-c-driver - 1.24.4-r2
Ebuild name:

dev-libs/mongo-c-driver-1.24.4-r2

Description

Client library written in C for MongoDB

Added to portage

2026-10-05

nnn - 5.3
Ebuild name:

app-misc/nnn-5.3

Description

The missing terminal file browser for X

Added to portage

2026-10-05

pbs-installer - 2026.10.3
Ebuild name:

dev-python/pbs-installer-2026.10.3

Description

Installer for Python Build Standalone

Added to portage

2026-10-05

pebble - 5.2.3
Ebuild name:

dev-python/pebble-5.2.3

Description

Threading and multiprocessing eye-candy

Added to portage

2026-10-05

prosody - 13.0.7
Ebuild name:

net-im/prosody-13.0.7

Description

Prosody is a modern XMPP communication server

Added to portage

2026-10-05

pycairo - 1.29.2
Ebuild name:

dev-python/pycairo-1.29.2

Description

Python bindings for the cairo library

Added to portage

2026-10-05

pycryptodome - 3.24.0
Ebuild name:

dev-python/pycryptodome-3.24.0

Description

A self-contained cryptographic library for Python

Added to portage

2026-10-05

pytest-golden - 1.0.2
Ebuild name:

dev-python/pytest-golden-1.0.2

Description

Plugin for pytest that offloads expected outputs to data files

Added to portage

2026-10-05

pytz - 2026.5
Ebuild name:

dev-python/pytz-2026.5

Description

World timezone definitions for Python

Added to portage

2026-10-05

rpds-py - 2026.9.1
Ebuild name:

dev-python/rpds-py-2026.9.1

Description

Python bindings to Rust's persistent data structures (rpds)

Added to portage

2026-10-05

signal-desktop-bin - 8.28.0
Ebuild name:

net-im/signal-desktop-bin-8.28.0

Description

Allows you to send and receive messages of Signal Messenger on you

Added to portage

2026-10-05

thermald - 2.5.13
Ebuild name:

sys-power/thermald-2.5.13

Description

Thermal daemon for Intel architectures

Added to portage

2026-10-05

throttled - 0.13
Ebuild name:

sys-power/throttled-0.13

Description

Daemon to work around throttling issues on some Intel laptops

Added to portage

2026-10-05

tinyssh - 20261001
Ebuild name:

net-misc/tinyssh-20261001

Description

A small SSH server with state-of-the-art cryptography

Added to portage

2026-10-05

virglrenderer - 1.3.0
Ebuild name:

media-libs/virglrenderer-1.3.0

Description

Library used implement a virtual 3D GPU used by qemu

Added to portage

2026-10-05

wcwidth - 0.9.2
Ebuild name:

dev-python/wcwidth-0.9.2

Description

Measures number of Terminal column cells of wide-character codes

Added to portage

2026-10-05

wezterm - 20260929.043349
Ebuild name:

x11-terms/wezterm-20260929.043349

Description

A GPU-accelerated cross-platform terminal emulator and multiplexe

Added to portage

2026-10-05

xorg-proto - 2026.1
Ebuild name:

x11-base/xorg-proto-2026.1

Description

X.Org combined protocol headers

Added to portage

2026-10-05

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