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:

84106

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 (26 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-03-31
awscli - 1.44.69
Ebuild name:

app-admin/awscli-1.44.69

Description

Universal Command Line Environment for AWS

Added to portage

2026-03-31

bash - 5.3_p9-r1
Ebuild name:

app-shells/bash-5.3_p9-r1

Description

The standard GNU Bourne again shell

Added to portage

2026-03-31

bash - 5.4_alpha_pre20251202-r1
Ebuild name:

app-shells/bash-5.4_alpha_pre20251202-r1

Description

The standard GNU Bourne again shell

Added to portage

2026-03-31

bcachefs-tools - 1.37.4
Ebuild name:

sys-fs/bcachefs-tools-1.37.4

Description

Tools for bcachefs

Added to portage

2026-03-31

blessed - 1.38.0
Ebuild name:

dev-python/blessed-1.38.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-03-31

boto3 - 1.42.79
Ebuild name:

dev-python/boto3-1.42.79

Description

The AWS SDK for Python

Added to portage

2026-03-31

botocore - 1.42.79
Ebuild name:

dev-python/botocore-1.42.79

Description

Low-level, data-driven core of boto 3

Added to portage

2026-03-31

chrome-binary-plugins - 148.0.7753.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-148.0.7753.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-03-31

chromium - 148.0.7753.0
Ebuild name:

www-client/chromium-148.0.7753.0

Description

Open-source version of Google Chrome web browser

Added to portage

2026-03-31

claws-mail - 4.4.0
Ebuild name:

mail-client/claws-mail-4.4.0

Description

An email client (and news reader) based on GTK+

Added to portage

2026-03-31

discid - 1.4.0
Ebuild name:

dev-python/discid-1.4.0

Description

Python bindings for libdiscid

Added to portage

2026-03-31

evisum - 1.2.0
Ebuild name:

sys-process/evisum-1.2.0

Description

System and process monitor written with EFL

Added to portage

2026-03-31

exaile - 4.2.2
Ebuild name:

media-sound/exaile-4.2.2

Description

GTK+ based media player aiming to be similar to Amarok

Added to portage

2026-03-31

faker - 40.12.0
Ebuild name:

dev-python/faker-40.12.0

Description

A Python package that generates fake data for you

Added to portage

2026-03-31

gajim - 2.4.5
Ebuild name:

net-im/gajim-2.4.5

Description

GTK XMPP Client

Added to portage

2026-03-31

google-api-core - 2.30.1
Ebuild name:

dev-python/google-api-core-2.30.1

Description

Core Library for Google Client Libraries

Added to portage

2026-03-31

google-auth-httplib2 - 0.3.1
Ebuild name:

dev-python/google-auth-httplib2-0.3.1

Description

httplib2 Transport for Google Auth

Added to portage

2026-03-31

google-auth-oauthlib - 1.3.1
Ebuild name:

dev-python/google-auth-oauthlib-1.3.1

Description

Google Authentication Library

Added to portage

2026-03-31

google-chrome-unstable - 148.0.7753.0
Ebuild name:

www-client/google-chrome-unstable-148.0.7753.0

Description

The web browser from Google

Added to portage

2026-03-31

gr-fosphor - 0.0_p20260330
Ebuild name:

net-analyzer/gr-fosphor-0.0_p20260330

Description

gnuradio fosphor block (GPU spectrum display)

Added to portage

2026-03-31

grpcio - 1.80.0
Ebuild name:

dev-python/grpcio-1.80.0

Description

HTTP/2-based RPC framework

Added to portage

2026-03-31

grpcio-status - 1.80.0
Ebuild name:

dev-python/grpcio-status-1.80.0

Description

Reference package for GRPC Python status proto mapping

Added to portage

2026-03-31

gshisen - 1.3.0-r3
Ebuild name:

gnustep-apps/gshisen-1.3.0-r3

Description

The first GNUstep game, similar to Mahjongg

Added to portage

2026-03-31

krita - 6.0.1
Ebuild name:

media-gfx/krita-6.0.1

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-03-31

libetpan - 1.9.4-r3
Ebuild name:

net-libs/libetpan-1.9.4-r3

Description

A portable, efficient middleware for different kinds of mail access

Added to portage

2026-03-31

microsoft-edge - 146.0.3856.84
Ebuild name:

www-client/microsoft-edge-146.0.3856.84

Description

The web browser from Microsoft

Added to portage

2026-03-31

mimalloc - 2.2.7-r1
Ebuild name:

dev-libs/mimalloc-2.2.7-r1

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-31

mimalloc - 3.2.8-r1
Ebuild name:

dev-libs/mimalloc-3.2.8-r1

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-31

moccur-edit - 2.16
Ebuild name:

app-emacs/moccur-edit-2.16

Description

An improved interface to color-moccur for editing

Added to portage

2026-03-31

ngspice - 46
Ebuild name:

sci-electronics/ngspice-46

Description

The Next Generation Spice (Electronic Circuit Simulator)

Added to portage

2026-03-31

ntp - 4.2.8_p18-r3
Ebuild name:

net-misc/ntp-4.2.8_p18-r3

Description

Network Time Protocol suite/programs

Added to portage

2026-03-31

pf-sources - 6.19_p4
Ebuild name:

sys-kernel/pf-sources-6.19_p4

Description

Added to portage

2026-03-31

requests - 2.33.1
Ebuild name:

dev-python/requests-2.33.1

Description

HTTP library for human beings

Added to portage

2026-03-31

unzip - 6.0_p29-r2
Ebuild name:

app-arch/unzip-6.0_p29-r2

Description

unzipper for pkzip-compressed files

Added to portage

2026-03-31

urwid - 4.0.0
Ebuild name:

dev-python/urwid-4.0.0

Description

Curses-based user interface library for Python

Added to portage

2026-03-31

vcsi - 7.0.17
Ebuild name:

media-video/vcsi-7.0.17

Description

Create thumbnail sheets from video files

Added to portage

2026-03-31

xfce4-terminal - 1.2.0-r1
Ebuild name:

x11-terms/xfce4-terminal-1.2.0-r1

Description

A terminal emulator for the Xfce desktop environment

Added to portage

2026-03-31

2026-03-30
ada - 3.4.4
Ebuild name:

dev-cpp/ada-3.4.4

Description

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

Added to portage

2026-03-30

asterisk - 21.12.2
Ebuild name:

net-misc/asterisk-21.12.2

Description

Asterisk A Modular Open Source PBX System

Added to portage

2026-03-30

atuin - 18.13.5
Ebuild name:

app-shells/atuin-18.13.5

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2026-03-30

bolt - 0.9.11
Ebuild name:

sys-apps/bolt-0.9.11

Description

Userspace system daemon to enable security levels for Thunderbolt 3

Added to portage

2026-03-30

ccache - 4.13.2
Ebuild name:

dev-util/ccache-4.13.2

Description

Fast compiler cache

Added to portage

2026-03-30

cmake - 4.1.5
Ebuild name:

dev-build/cmake-4.1.5

Description

Cross platform Make

Added to portage

2026-03-30

cmake - 4.2.4
Ebuild name:

dev-build/cmake-4.2.4

Description

Cross platform Make

Added to portage

2026-03-30

cmake - 4.3.1
Ebuild name:

dev-build/cmake-4.3.1

Description

Cross platform Make

Added to portage

2026-03-30

cppgir - 2.0_p20260321
Ebuild name:

dev-cpp/cppgir-2.0_p20260321

Description

GObject-Introspection C++ binding wrapper generator

Added to portage

2026-03-30

cyme - 2.3.0
Ebuild name:

sys-apps/cyme-2.3.0

Description

List system USB buses and devices; a modern cross-platform `lsusb`

Added to portage

2026-03-30

edk2 - 202511-r1
Ebuild name:

sys-firmware/edk2-202511-r1

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-03-30

edk2-bin - 202511
Ebuild name:

sys-firmware/edk2-bin-202511

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-03-30

evaluate - 0.4.4
Ebuild name:

sci-ml/evaluate-0.4.4

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

evaluate - 0.4.5
Ebuild name:

sci-ml/evaluate-0.4.5

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

evaluate - 0.4.6
Ebuild name:

sci-ml/evaluate-0.4.6

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

exfatprogs - 1.3.2
Ebuild name:

sys-fs/exfatprogs-1.3.2

Description

Userspace utilities for the exFAT filesystem

Added to portage

2026-03-30

fcft - 3.3.3
Ebuild name:

media-libs/fcft-3.3.3

Description

Simple library for font loading and glyph rasterization

Added to portage

2026-03-30

firecracker-bin - 1.15.0
Ebuild name:

app-emulation/firecracker-bin-1.15.0

Description

Secure and fast microVMs for serverless computing (static buil

Added to portage

2026-03-30

fuse - 3.18.2
Ebuild name:

sys-fs/fuse-3.18.2

Description

An interface for filesystems implemented in userspace

Added to portage

2026-03-30

gcc - 16.0.1_p20260329
Ebuild name:

sys-devel/gcc-16.0.1_p20260329

Description

The GNU Compiler Collection

Added to portage

2026-03-30

git-sources - 7.0_rc6
Ebuild name:

sys-kernel/git-sources-7.0_rc6

Description

The very latest -git version of the Linux kernel

Added to portage

2026-03-30

grub - 2.14-r4
Ebuild name:

sys-boot/grub-2.14-r4

Description

GNU GRUB boot loader

Added to portage

2026-03-30

inxi - 3.3.40.1
Ebuild name:

sys-apps/inxi-3.3.40.1

Description

The CLI inxi collects and prints hardware and system information

Added to portage

2026-03-30

libpng - 1.6.56
Ebuild name:

media-libs/libpng-1.6.56

Description

Portable Network Graphics library

Added to portage

2026-03-30

mbuffer - 20260301
Ebuild name:

sys-block/mbuffer-20260301

Description

M(easuring)buffer is a replacement for buffer with additional functional

Added to portage

2026-03-30

mdadm - 4.6
Ebuild name:

sys-fs/mdadm-4.6

Description

Tool for running RAID systems - replacement for the raidtools

Added to portage

2026-03-30

mocker - 0.5.0
Ebuild name:

app-emacs/mocker-0.5.0

Description

Simple mocking framework for Emacs

Added to portage

2026-03-30

modus-themes - 5.1.0
Ebuild name:

app-emacs/modus-themes-5.1.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-30

nethack - 3.6.7-r1
Ebuild name:

games-roguelike/nethack-3.6.7-r1

Description

The ultimate old-school single player dungeon exploration game

Added to portage

2026-03-30

pylsqpack - 0.3.24
Ebuild name:

dev-python/pylsqpack-0.3.24

Description

Python wrapper for the ls-qpack QPACK library

Added to portage

2026-03-30

pyqt6 - 6.11.0
Ebuild name:

dev-python/pyqt6-6.11.0

Description

Python bindings for the Qt framework

Added to portage

2026-03-30

pyqt6-webengine - 6.11.0
Ebuild name:

dev-python/pyqt6-webengine-6.11.0

Description

Python bindings for QtWebEngine

Added to portage

2026-03-30

qbe - 1.2-r1
Ebuild name:

sys-devel/qbe-1.2-r1

Description

Pure-C embeddable compiler backend

Added to portage

2026-03-30

synapse - 1.150.0
Ebuild name:

net-im/synapse-1.150.0

Description

Reference implementation of Matrix homeserver

Added to portage

2026-03-30

sysvinit - 3.18
Ebuild name:

sys-apps/sysvinit-3.18

Description

/sbin/init - parent of all processes

Added to portage

2026-03-30

tdlib - 1.8.62
Ebuild name:

net-libs/tdlib-1.8.62

Description

Cross-platform library for building Telegram clients

Added to portage

2026-03-30

transformers - 5.3.0
Ebuild name:

sci-ml/transformers-5.3.0

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-03-30

winbox - 4.1_rc1
Ebuild name:

app-admin/winbox-4.1_rc1

Description

Management Software for MikroTik RouterOS

Added to portage

2026-03-30

xrootd - 5.9.2
Ebuild name:

net-libs/xrootd-5.9.2

Description

Extended ROOT remote file server

Added to portage

2026-03-30

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