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:

83338

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-02-16
alot - 0.11-r2
Ebuild name:

mail-client/alot-0.11-r2

Description

Experimental terminal UI for net-mail/notmuch written in Python

Added to portage

2026-02-16

atuin - 18.12.1
Ebuild name:

app-shells/atuin-18.12.1

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2026-02-16

cdemu - 3.3.0
Ebuild name:

app-cdr/cdemu-3.3.0

Description

Command-line tool for controlling cdemu-daemon

Added to portage

2026-02-16

cdemu-daemon - 3.3.0
Ebuild name:

app-cdr/cdemu-daemon-3.3.0

Description

Daemon of the CDEmu optical media image mounting suite

Added to portage

2026-02-16

cfv - 3.2.0
Ebuild name:

app-arch/cfv-3.2.0

Description

Command-line File Verify - versatile file checksum creator and verifier

Added to portage

2026-02-16

createrepo_c - 1.2.2-r1
Ebuild name:

app-arch/createrepo_c-1.2.2-r1

Description

C implementation of createrepo

Added to portage

2026-02-16

dist-kernel - 6.12.72
Ebuild name:

virtual/dist-kernel-6.12.72

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-02-16

fastfetch - 2.59.0
Ebuild name:

app-misc/fastfetch-2.59.0

Description

Fast neofetch-like system information tool

Added to portage

2026-02-16

freenet - 0.7.5_p1506
Ebuild name:

net-p2p/freenet-0.7.5_p1506

Description

Freenet REference Daemon

Added to portage

2026-02-16

gcc - 16.0.1_p20260215
Ebuild name:

sys-devel/gcc-16.0.1_p20260215

Description

The GNU Compiler Collection

Added to portage

2026-02-16

gcdemu - 3.3.0
Ebuild name:

app-cdr/gcdemu-3.3.0

Description

Gtk+ GUI for controlling cdemu-daemon

Added to portage

2026-02-16

gentoo-kernel - 6.12.72
Ebuild name:

sys-kernel/gentoo-kernel-6.12.72

Description

Linux kernel built with Gentoo patches

Added to portage

2026-02-16

gentoo-kernel - 6.18.11
Ebuild name:

sys-kernel/gentoo-kernel-6.18.11

Description

Linux kernel built with Gentoo patches

Added to portage

2026-02-16

gentoo-kernel - 6.6.125
Ebuild name:

sys-kernel/gentoo-kernel-6.6.125

Description

Linux kernel built with Gentoo patches

Added to portage

2026-02-16

gentoo-kernel-bin - 6.12.72
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.72

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-02-16

gentoo-kernel-bin - 6.18.11
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.11

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-02-16

gentoo-kernel-bin - 6.6.125
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.125

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-02-16

huggingface_hub - 1.3.7
Ebuild name:

sci-ml/huggingface_hub-1.3.7

Description

a client library to interact with the Hugging Face Hub

Added to portage

2026-02-16

immutabledict - 4.3.1
Ebuild name:

dev-python/immutabledict-4.3.1

Description

An immutable wrapper around dictionaries

Added to portage

2026-02-16

jsonschema-path - 0.4.0_beta6
Ebuild name:

dev-python/jsonschema-path-0.4.0_beta6

Description

JSONSchema Spec with object-oriented paths

Added to portage

2026-02-16

libmirage - 3.3.1
Ebuild name:

dev-libs/libmirage-3.3.1

Description

CD and DVD image access library

Added to portage

2026-02-16

librecad - 2.2.2_alpha1_pre20260215
Ebuild name:

media-gfx/librecad-2.2.2_alpha1_pre20260215

Description

Generic 2D CAD program

Added to portage

2026-02-16

maturin - 1.12.1
Ebuild name:

dev-util/maturin-1.12.1

Description

Build and publish crates with pyo3, rust-cpython and cffi bindings

Added to portage

2026-02-16

maturin - 1.12.2
Ebuild name:

dev-util/maturin-1.12.2

Description

Build and publish crates with pyo3, rust-cpython and cffi bindings

Added to portage

2026-02-16

mumble - 1.6.0_pre20260215
Ebuild name:

net-voip/mumble-1.6.0_pre20260215

Description

Mumble is an open source, low-latency, high quality voice chat so

Added to portage

2026-02-16

murmur - 1.6.0_pre20260215
Ebuild name:

net-voip/murmur-1.6.0_pre20260215

Description

Mumble is an open source, low-latency, high quality voice chat so

Added to portage

2026-02-16

ninja-mode - 1.11.1-r2
Ebuild name:

app-emacs/ninja-mode-1.11.1-r2

Description

GNU Emacs mode for handling Ninja build files

Added to portage

2026-02-16

notmuch - 0.40
Ebuild name:

net-mail/notmuch-0.40

Description

Thread-based e-mail indexer, supporting quick search and tagging

Added to portage

2026-02-16

nzbget - 26.0
Ebuild name:

net-nntp/nzbget-26.0

Description

A command-line based binary newsgrabber supporting .nzb files

Added to portage

2026-02-16

p11-kit - 0.26.2
Ebuild name:

app-crypt/p11-kit-0.26.2

Description

Provides a standard configuration setup for installing PKCS11

Added to portage

2026-02-16

paperkey - 1.6
Ebuild name:

app-crypt/paperkey-1.6

Description

OpenPGP key archiver

Added to portage

2026-02-16

pathable - 0.5.0_beta6
Ebuild name:

dev-python/pathable-0.5.0_beta6

Description

Object-oriented paths

Added to portage

2026-02-16

platformdirs - 4.9.2
Ebuild name:

dev-python/platformdirs-4.9.2

Description

A small Python module for determining appropriate platform-specific d

Added to portage

2026-02-16

prismlauncher - 10.0.5
Ebuild name:

games-action/prismlauncher-10.0.5

Description

Custom, open source Minecraft launcher

Added to portage

2026-02-16

pymdown-extensions - 10.21
Ebuild name:

dev-python/pymdown-extensions-10.21

Description

Extensions for Python Markdown

Added to portage

2026-02-16

python-socks - 2.8.1
Ebuild name:

dev-python/python-socks-2.8.1

Description

SOCKS4, SOCKS5, HTTP tunneling functionality for Python

Added to portage

2026-02-16

rubber - 1.6.7-r1
Ebuild name:

dev-tex/rubber-1.6.7-r1

Description

LaTeX wrapper for automatically building documents

Added to portage

2026-02-16

sipp - 3.7.7
Ebuild name:

net-misc/sipp-3.7.7

Description

A free Open Source test tool / traffic generator for the SIP protocol

Added to portage

2026-02-16

smb4k - 4.0.6
Ebuild name:

net-misc/smb4k-4.0.6

Description

Advanced network neighborhood browser

Added to portage

2026-02-16

stalwart-cli - 0.15.5
Ebuild name:

net-mail/stalwart-cli-0.15.5

Description

Stalwart Mail Server command line utility

Added to portage

2026-02-16

stalwart-mail - 0.15.5
Ebuild name:

net-mail/stalwart-mail-0.15.5

Description

Stalwart Mail Server

Added to portage

2026-02-16

tifffile - 2026.2.15
Ebuild name:

dev-python/tifffile-2026.2.15

Description

Read and write TIFF files

Added to portage

2026-02-16

tox - 4.36.0
Ebuild name:

dev-python/tox-4.36.0

Description

virtualenv-based automation of test activities

Added to portage

2026-02-16

vanilla-kernel - 6.12.72
Ebuild name:

sys-kernel/vanilla-kernel-6.12.72

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-02-16

vanilla-kernel - 6.18.11
Ebuild name:

sys-kernel/vanilla-kernel-6.18.11

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-02-16

vanilla-kernel - 6.6.125
Ebuild name:

sys-kernel/vanilla-kernel-6.6.125

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-02-16

vimpc - 0.09.2_p20230330
Ebuild name:

media-sound/vimpc-0.09.2_p20230330

Description

ncurses based mpd client with vi-like key bindings

Added to portage

2026-02-16

vlc - 4.0.0_pre20260215
Ebuild name:

media-video/vlc-4.0.0_pre20260215

Description

Media player and framework with support for most multimedia files

Added to portage

2026-02-16

winbox - 4.0.1
Ebuild name:

app-admin/winbox-4.0.1

Description

Management Software for MikroTik RouterOS

Added to portage

2026-02-16

xmltodict - 1.0.3
Ebuild name:

dev-python/xmltodict-1.0.3

Description

Makes working with XML feel like you are working with JSON

Added to portage

2026-02-16

2026-02-15
amarok - 3.3.2-r1
Ebuild name:

media-sound/amarok-3.3.2-r1

Description

Advanced audio player based on KDE Frameworks

Added to portage

2026-02-15

android-studio - 2025.3.1.8
Ebuild name:

dev-util/android-studio-2025.3.1.8

Description

Android development environment based on IntelliJ IDEA

Added to portage

2026-02-15

anydesk - 7.1.4
Ebuild name:

net-misc/anydesk-7.1.4

Description

Feature rich multi-platform remote desktop application

Added to portage

2026-02-15

catalyst - 4.1.1
Ebuild name:

dev-util/catalyst-4.1.1

Description

Release metatool used for creating releases based on Gentoo Linux

Added to portage

2026-02-15

chromium - 145.0.7632.75
Ebuild name:

www-client/chromium-145.0.7632.75

Description

Open-source version of Google Chrome web browser

Added to portage

2026-02-15

etherape - 0.9.21
Ebuild name:

net-analyzer/etherape-0.9.21

Description

A graphical network monitor for Unix modeled after etherman

Added to portage

2026-02-15

filelock - 3.24.0
Ebuild name:

dev-python/filelock-3.24.0

Description

A platform independent file lock for Python

Added to portage

2026-02-15

gcc - 15.2.1_p20260214
Ebuild name:

sys-devel/gcc-15.2.1_p20260214

Description

The GNU Compiler Collection

Added to portage

2026-02-15

gdbus-codegen - 2.86.4
Ebuild name:

dev-util/gdbus-codegen-2.86.4

Description

GDBus code and documentation generator

Added to portage

2026-02-15

gentoo-sources - 6.12.71
Ebuild name:

sys-kernel/gentoo-sources-6.12.71

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-02-15

glib - 2.86.4
Ebuild name:

dev-libs/glib-2.86.4

Description

The GLib library of C routines

Added to portage

2026-02-15

glib-utils - 2.86.4
Ebuild name:

dev-util/glib-utils-2.86.4

Description

Build utilities for GLib using projects

Added to portage

2026-02-15

hsqldb - 2.7.4-r1
Ebuild name:

dev-db/hsqldb-2.7.4-r1

Description

HSQLDB - Lightweight 100% Java SQL Database Engine

Added to portage

2026-02-15

huggingface_hub - 0.36.2-r1
Ebuild name:

sci-ml/huggingface_hub-0.36.2-r1

Description

a client library to interact with the Hugging Face Hub

Added to portage

2026-02-15

huggingface_hub - 1.1.7
Ebuild name:

sci-ml/huggingface_hub-1.1.7

Description

a client library to interact with the Hugging Face Hub

Added to portage

2026-02-15

huggingface_hub - 1.2.4
Ebuild name:

sci-ml/huggingface_hub-1.2.4

Description

a client library to interact with the Hugging Face Hub

Added to portage

2026-02-15

indilib - 2.1.9
Ebuild name:

sci-libs/indilib-2.1.9

Description

INDI Astronomical Control Protocol library

Added to portage

2026-02-15

libgcrypt - 1.12.0-r3
Ebuild name:

dev-libs/libgcrypt-1.12.0-r3

Description

General purpose crypto library based on the code used in GnuPG

Added to portage

2026-02-15

libssh - 0.11.4
Ebuild name:

net-libs/libssh-0.11.4

Description

Access a working SSH implementation by means of a library

Added to portage

2026-02-15

mariadb-connector-odbc - 3.2.8
Ebuild name:

dev-db/mariadb-connector-odbc-3.2.8

Description

MariaDB Connector/ODBC

Added to portage

2026-02-15

mpd - 0.24.8
Ebuild name:

media-sound/mpd-0.24.8

Description

The Music Player Daemon (mpd)

Added to portage

2026-02-15

nh3 - 0.3.3
Ebuild name:

dev-python/nh3-0.3.3

Description

Ammonia HTML sanitizer Python binding

Added to portage

2026-02-15

ninja-mode - 1.12.0
Ebuild name:

app-emacs/ninja-mode-1.12.0

Description

GNU Emacs mode for handling Ninja build files

Added to portage

2026-02-15

ninja-mode - 1.12.1
Ebuild name:

app-emacs/ninja-mode-1.12.1

Description

GNU Emacs mode for handling Ninja build files

Added to portage

2026-02-15

nuitka - 4.0.1
Ebuild name:

dev-python/nuitka-4.0.1

Description

Python to native compiler

Added to portage

2026-02-15

openapi-spec-validator - 0.8.0_beta2
Ebuild name:

dev-python/openapi-spec-validator-0.8.0_beta2

Description

OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0 spec valida

Added to portage

2026-02-15

par2cmdline-turbo - 1.4.0
Ebuild name:

app-arch/par2cmdline-turbo-1.4.0

Description

par2cmdline × ParPar speed focused par2cmdline fork

Added to portage

2026-02-15

pass - 2.0_p20260214
Ebuild name:

app-emacs/pass-2.0_p20260214

Description

Major mode for password-store

Added to portage

2026-02-15

platformdirs - 4.9.1
Ebuild name:

dev-python/platformdirs-4.9.1

Description

A small Python module for determining appropriate platform-specific d

Added to portage

2026-02-15

pmacct - 1.7.9
Ebuild name:

net-analyzer/pmacct-1.7.9

Description

A network tool to gather IP traffic information

Added to portage

2026-02-15

pycxx - 7.2.1
Ebuild name:

dev-python/pycxx-7.2.1

Description

Set of facilities to extend Python with C++

Added to portage

2026-02-15

pytest-django - 4.12.0
Ebuild name:

dev-python/pytest-django-4.12.0

Description

A Django plugin for pytest

Added to portage

2026-02-15

pytest-httpserver - 1.1.5
Ebuild name:

dev-python/pytest-httpserver-1.1.5

Description

HTTP server for pytest to test HTTP clients

Added to portage

2026-02-15

qcoro - 0.13.0
Ebuild name:

dev-libs/qcoro-0.13.0

Description

C++ Coroutine Library for Qt

Added to portage

2026-02-15

tomcat-native - 1.3.6
Ebuild name:

dev-java/tomcat-native-1.3.6

Description

Allows Tomcat to use certain native resources for better performance

Added to portage

2026-02-15

trio - 0.33.0
Ebuild name:

dev-python/trio-0.33.0

Description

Python library for async concurrency and I/O

Added to portage

2026-02-15

typeguard - 4.5.0
Ebuild name:

dev-python/typeguard-4.5.0

Description

Run-time type checker for Python

Added to portage

2026-02-15

vanilla-sources - 6.12.71
Ebuild name:

sys-kernel/vanilla-sources-6.12.71

Description

Full sources for the Linux kernel

Added to portage

2026-02-15

w3m - 0.5.6
Ebuild name:

www-client/w3m-0.5.6

Description

Text based WWW browser, supports tables and frames

Added to portage

2026-02-15

wireless-regdb - 20260204
Ebuild name:

net-wireless/wireless-regdb-20260204

Description

Wireless Regulatory database for Linux

Added to portage

2026-02-15

xl2tpd - 1.3.20
Ebuild name:

net-dialup/xl2tpd-1.3.20

Description

A modern version of the Layer 2 Tunneling Protocol (L2TP) daemon

Added to portage

2026-02-15

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