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:

86764

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-07-12
at-spi2-core - 2.58.7
Ebuild name:

app-accessibility/at-spi2-core-2.58.7

Description

D-Bus accessibility specifications and registration daemon

Added to portage

2026-07-12

at-spi2-core - 2.60.5
Ebuild name:

app-accessibility/at-spi2-core-2.60.5

Description

D-Bus accessibility specifications and registration daemon

Added to portage

2026-07-12

coredns - 1.14.6
Ebuild name:

net-dns/coredns-1.14.6

Description

CoreDNS is a DNS server that chains plugins

Added to portage

2026-07-12

eclipse-ecj - 4.40
Ebuild name:

dev-java/eclipse-ecj-4.40

Description

Eclipse Compiler for Java

Added to portage

2026-07-12

fonttools - 4.63.0-r1
Ebuild name:

dev-python/fonttools-4.63.0-r1

Description

Library for manipulating TrueType, OpenType, AFM and Type1 fonts

Added to portage

2026-07-12

meson - 1.11.2
Ebuild name:

dev-build/meson-1.11.2

Description

Open source build system

Added to portage

2026-07-12

meson - 1.12.0_rc1
Ebuild name:

dev-build/meson-1.12.0_rc1

Description

Open source build system

Added to portage

2026-07-12

modus-themes - 5.3.0
Ebuild name:

app-emacs/modus-themes-5.3.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-07-12

networkmanager - 1.56.1
Ebuild name:

net-misc/networkmanager-1.56.1

Description

A set of co-operative tools that make networking simple and straight

Added to portage

2026-07-12

pkgconf - 3.0.0
Ebuild name:

dev-util/pkgconf-3.0.0

Description

pkg-config compatible replacement with no dependencies other than C99

Added to portage

2026-07-12

upower - 1.91.2
Ebuild name:

sys-power/upower-1.91.2

Description

D-Bus abstraction for enumerating power devices, querying history and stati

Added to portage

2026-07-12

upower - 1.91.3
Ebuild name:

sys-power/upower-1.91.3

Description

D-Bus abstraction for enumerating power devices, querying history and stati

Added to portage

2026-07-12

2026-07-11
apache-arrow - 25.0.0
Ebuild name:

dev-libs/apache-arrow-25.0.0

Description

A cross-language development platform for in-memory data

Added to portage

2026-07-11

apsw - 3.53.3.1
Ebuild name:

dev-python/apsw-3.53.3.1

Description

APSW - Another Python SQLite Wrapper

Added to portage

2026-07-11

awscli - 1.45.46
Ebuild name:

app-admin/awscli-1.45.46

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-11

bitarray - 3.9.0
Ebuild name:

dev-python/bitarray-3.9.0

Description

Efficient arrays of booleans -- C extension

Added to portage

2026-07-11

bitcoin-core - 29.4
Ebuild name:

net-p2p/bitcoin-core-29.4

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-07-11

bitcoin-core - 30.3
Ebuild name:

net-p2p/bitcoin-core-30.3

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-07-11

bitcoin-core - 31.1
Ebuild name:

net-p2p/bitcoin-core-31.1

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-07-11

boto3 - 1.43.46
Ebuild name:

dev-python/boto3-1.43.46

Description

The AWS SDK for Python

Added to portage

2026-07-11

botocore - 1.43.46
Ebuild name:

dev-python/botocore-1.43.46

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-11

cliff - 4.15.0
Ebuild name:

dev-python/cliff-4.15.0

Description

Command Line Interface Formulation Framework

Added to portage

2026-07-11

conky - 1.24.2
Ebuild name:

app-admin/conky-1.24.2

Description

An advanced, highly configurable system monitor for X

Added to portage

2026-07-11

croniter - 6.2.4
Ebuild name:

dev-python/croniter-6.2.4

Description

Python module to provide iteration for datetime object

Added to portage

2026-07-11

discid - 1.4.2
Ebuild name:

dev-python/discid-1.4.2

Description

Python bindings for libdiscid

Added to portage

2026-07-11

fitsio - 1.4.1
Ebuild name:

dev-python/fitsio-1.4.1

Description

Python library to read from and write to FITS files

Added to portage

2026-07-11

ggml - 0.16.0
Ebuild name:

sci-ml/ggml-0.16.0

Description

Tensor library for machine learning

Added to portage

2026-07-11

gnome-control-center - 49.8
Ebuild name:

gnome-base/gnome-control-center-49.8

Description

GNOME's main interface to configure various aspects of the des

Added to portage

2026-07-11

gnome-session - 49.3
Ebuild name:

gnome-base/gnome-session-49.3

Description

Gnome session manager

Added to portage

2026-07-11

gnome-shell - 49.8
Ebuild name:

gnome-base/gnome-shell-49.8

Description

Provides core UI functions for the GNOME desktop

Added to portage

2026-07-11

gspell - 1.14.4
Ebuild name:

app-text/gspell-1.14.4

Description

Spell check library for GTK+ applications

Added to portage

2026-07-11

gssdp - 1.6.6
Ebuild name:

net-libs/gssdp-1.6.6

Description

GObject-based API for handling resource discovery and announcement over SSDP

Added to portage

2026-07-11

headscale - 0.29.2
Ebuild name:

net-vpn/headscale-0.29.2

Description

An open source, self-hosted implementation of the Tailscale control server

Added to portage

2026-07-11

hypothesis - 6.156.6
Ebuild name:

dev-python/hypothesis-6.156.6

Description

A library for property based testing

Added to portage

2026-07-11

jq - 1.12.0
Ebuild name:

dev-python/jq-1.12.0

Description

Python bindings for jq

Added to portage

2026-07-11

kpipewire - 6.6.6.1
Ebuild name:

kde-plasma/kpipewire-6.6.6.1

Description

Components relating to Flatpak pipewire use in Plasma

Added to portage

2026-07-11

libffi - 3.7.1
Ebuild name:

dev-libs/libffi-3.7.1

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-07-11

libpeas - 2.2.1
Ebuild name:

dev-libs/libpeas-2.2.1

Description

A GObject plugins library

Added to portage

2026-07-11

libxcrypt - 4.5.2
Ebuild name:

sys-libs/libxcrypt-4.5.2

Description

Extended crypt library for descrypt, md5crypt, bcrypt, and others

Added to portage

2026-07-11

libxfce4ui - 4.21.9
Ebuild name:

xfce-base/libxfce4ui-4.21.9

Description

Unified widget and session management libs for Xfce

Added to portage

2026-07-11

mac - 13.18
Ebuild name:

media-sound/mac-13.18

Description

Monkey's Audio Codecs

Added to portage

2026-07-11

memcached - 1.6.45
Ebuild name:

net-misc/memcached-1.6.45

Description

High-performance, distributed memory object caching system

Added to portage

2026-07-11

mm-common - 1.0.8
Ebuild name:

dev-cpp/mm-common-1.0.8

Description

Build infrastructure and utilities for GNOME C++ bindings

Added to portage

2026-07-11

modus-themes - 9999
Ebuild name:

app-emacs/modus-themes-9999

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-07-11

mpg123-el - 1.65
Ebuild name:

app-emacs/mpg123-el-1.65

Description

Emacs front-end to mpg123 audio player and OggVorbis audio player

Added to portage

2026-07-11

mutter - 49.7
Ebuild name:

x11-wm/mutter-49.7

Description

GNOME compositing window manager based on Clutter

Added to portage

2026-07-11

neard - 0.20
Ebuild name:

net-wireless/neard-0.20

Description

Near Field Communication (NFC) management daemon

Added to portage

2026-07-11

ollama - 0.31.2
Ebuild name:

sci-ml/ollama-0.31.2

Description

Get up and running with Llama 3, Mistral, Gemma, and other language models.

Added to portage

2026-07-11

openvswitch - 3.3.9
Ebuild name:

net-misc/openvswitch-3.3.9

Description

Production quality, multilayer virtual switch

Added to portage

2026-07-11

openvswitch - 3.7.1
Ebuild name:

net-misc/openvswitch-3.7.1

Description

Production quality, multilayer virtual switch

Added to portage

2026-07-11

osc-lib - 4.7.0
Ebuild name:

dev-python/osc-lib-4.7.0

Description

A package of common support modules for writing OSC plugins

Added to portage

2026-07-11

oslo-context - 6.5.0
Ebuild name:

dev-python/oslo-context-6.5.0

Description

Helpers to maintain useful information about a request context

Added to portage

2026-07-11

oslo-i18n - 6.9.0
Ebuild name:

dev-python/oslo-i18n-6.9.0

Description

Oslo i18n library

Added to portage

2026-07-11

oslo-log - 8.3.0
Ebuild name:

dev-python/oslo-log-8.3.0

Description

OpenStack logging config library, configuration for all openstack project

Added to portage

2026-07-11

oslo-serialization - 5.11.0
Ebuild name:

dev-python/oslo-serialization-5.11.0

Description

Oslo Serialization library

Added to portage

2026-07-11

ovs - 3.3.9
Ebuild name:

dev-python/ovs-3.3.9

Description

OVS bindings for python

Added to portage

2026-07-11

ovs - 3.7.1
Ebuild name:

dev-python/ovs-3.7.1

Description

OVS bindings for python

Added to portage

2026-07-11

pangomm - 2.56.2
Ebuild name:

dev-cpp/pangomm-2.56.2

Description

C++ interface for pango

Added to portage

2026-07-11

pikepdf - 10.10.0
Ebuild name:

dev-python/pikepdf-10.10.0

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-07-11

portage - 3.0.81.2
Ebuild name:

sys-apps/portage-3.0.81.2

Description

The package management and distribution system for Gentoo

Added to portage

2026-07-11

power-profiles-daemon - 0.30-r1
Ebuild name:

sys-power/power-profiles-daemon-0.30-r1

Description

Makes power profiles handling available over D-Bus

Added to portage

2026-07-11

pyarrow - 25.0.0
Ebuild name:

dev-python/pyarrow-25.0.0

Description

Python library for Apache Arrow

Added to portage

2026-07-11

python-pkcs11 - 0.9.5
Ebuild name:

dev-python/python-pkcs11-0.9.5

Description

PKCS11/Cryptoki support for Python

Added to portage

2026-07-11

pythran - 0.18.1-r1
Ebuild name:

dev-python/pythran-0.18.1-r1

Description

Ahead of Time compiler for numeric kernels

Added to portage

2026-07-11

regex - 2026.7.10
Ebuild name:

dev-python/regex-2026.7.10

Description

Alternative regular expression module to replace re

Added to portage

2026-07-11

s3transfer - 0.19.1
Ebuild name:

dev-python/s3transfer-0.19.1

Description

An Amazon S3 Transfer Manager

Added to portage

2026-07-11

selenium - 4.46.0
Ebuild name:

dev-python/selenium-4.46.0

Description

Python language binding for Selenium Remote Control

Added to portage

2026-07-11

selenium-manager - 4.46.0
Ebuild name:

dev-util/selenium-manager-4.46.0

Description

CLI tool that manages the browser/driver infrastructure required b

Added to portage

2026-07-11

unifont - 17.0.05
Ebuild name:

media-fonts/unifont-17.0.05

Description

GNU Unifont - a Pan-Unicode X11 bitmap iso10646 font

Added to portage

2026-07-11

virtualenv - 21.6.1
Ebuild name:

dev-python/virtualenv-21.6.1

Description

Virtual Python Environment builder

Added to portage

2026-07-11

wcmatch - 11.0
Ebuild name:

dev-python/wcmatch-11.0

Description

Wildcard/glob file name matcher

Added to portage

2026-07-11

websockets - 16.1
Ebuild name:

dev-python/websockets-16.1

Description

Library for building WebSocket servers and clients in Python

Added to portage

2026-07-11

wine-vanilla - 11.13
Ebuild name:

app-emulation/wine-vanilla-11.13

Description

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

Added to portage

2026-07-11

xpadneo - 0.10.4
Ebuild name:

games-util/xpadneo-0.10.4

Description

Advanced Linux Driver for Xbox One Wireless Controller

Added to portage

2026-07-11

xrdb - 1.2.3
Ebuild name:

x11-apps/xrdb-1.2.3

Description

X server resource database utility

Added to portage

2026-07-11

xrefresh - 1.1.1
Ebuild name:

x11-apps/xrefresh-1.1.1

Description

refresh all or part of an X screen

Added to portage

2026-07-11

xset - 1.2.6
Ebuild name:

x11-apps/xset-1.2.6

Description

X.Org xset application

Added to portage

2026-07-11

xsetroot - 1.1.4
Ebuild name:

x11-apps/xsetroot-1.1.4

Description

X.Org xsetroot application

Added to portage

2026-07-11

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