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:

87036

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-20
gcc - 17.0.0_p20260719
Ebuild name:

sys-devel/gcc-17.0.0_p20260719

Description

The GNU Compiler Collection

Added to portage

2026-07-20

gherkin-official - 42.0.0
Ebuild name:

dev-python/gherkin-official-42.0.0

Description

Gherkin parser/compiler for Python

Added to portage

2026-07-20

git-sources - 7.2_rc4
Ebuild name:

sys-kernel/git-sources-7.2_rc4

Description

The very latest -git version of the Linux kernel

Added to portage

2026-07-20

gulrak-filesystem - 1.5.16
Ebuild name:

dev-cpp/gulrak-filesystem-1.5.16

Description

Header-only single-file std compatible helper library

Added to portage

2026-07-20

libxmp - 4.7.1
Ebuild name:

media-libs/libxmp-4.7.1

Description

Library that renders module files to PCM data

Added to portage

2026-07-20

sdl2-mixer - 2.8.1-r4
Ebuild name:

media-libs/sdl2-mixer-2.8.1-r4

Description

Simple Direct Media Layer Mixer Library

Added to portage

2026-07-20

sdl2-mixer - 2.8.2-r1
Ebuild name:

media-libs/sdl2-mixer-2.8.2-r1

Description

Simple Direct Media Layer Mixer Library

Added to portage

2026-07-20

stb - 20260415-r1
Ebuild name:

dev-libs/stb-20260415-r1

Description

Single-file C/C++ libraries for various purposes

Added to portage

2026-07-20

2026-07-19
antlr - 4.13.2-r1
Ebuild name:

dev-java/antlr-4.13.2-r1

Description

A parser generator for many languages

Added to portage

2026-07-19

antlr-runtime - 4.13.2-r1
Ebuild name:

dev-java/antlr-runtime-4.13.2-r1

Description

ANTLR 4 Runtime

Added to portage

2026-07-19

antlr-tool - 4.13.2-r2
Ebuild name:

dev-java/antlr-tool-4.13.2-r2

Description

The ANTLR 4 grammar compiler

Added to portage

2026-07-19

binding_of_caller - 2.0.0
Ebuild name:

dev-ruby/binding_of_caller-2.0.0

Description

Retrieve the binding of a method's caller

Added to portage

2026-07-19

chrome-binary-plugins - 150.0.7871.128
Ebuild name:

www-plugins/chrome-binary-plugins-150.0.7871.128

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-07-19

chrome-binary-plugins - 151.0.7922.34_beta
Ebuild name:

www-plugins/chrome-binary-plugins-151.0.7922.34_beta

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-07-19

chrome-binary-plugins - 152.0.7953.3_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-152.0.7953.3_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-07-19

chromedriver-bin - 150.0.7871.128
Ebuild name:

www-apps/chromedriver-bin-150.0.7871.128

Description

WebDriver for Chrome

Added to portage

2026-07-19

chromium - 150.0.7871.128
Ebuild name:

www-client/chromium-150.0.7871.128

Description

Open-source version of Google Chrome web browser

Added to portage

2026-07-19

cpp-httplib - 0.50.1
Ebuild name:

dev-cpp/cpp-httplib-0.50.1

Description

C++ HTTP/HTTPS server and client library

Added to portage

2026-07-19

diffoscope - 325
Ebuild name:

dev-util/diffoscope-325

Description

Will try to get to the bottom of what makes files or directories different

Added to portage

2026-07-19

dist-kernel - 6.12.96
Ebuild name:

virtual/dist-kernel-6.12.96

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

dist-kernel - 6.18.39
Ebuild name:

virtual/dist-kernel-6.18.39

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

dist-kernel - 7.1.4
Ebuild name:

virtual/dist-kernel-7.1.4

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

django-configurations - 2.5.1-r1
Ebuild name:

dev-python/django-configurations-2.5.1-r1

Description

A helper for organizing Django settings

Added to portage

2026-07-19

ffmpeg-chromium - 150.0.7871.124
Ebuild name:

media-video/ffmpeg-chromium-150.0.7871.124

Description

FFmpeg built specifically for codec support in Chromium-

Added to portage

2026-07-19

filelock - 3.31.0
Ebuild name:

dev-python/filelock-3.31.0

Description

A platform independent file lock for Python

Added to portage

2026-07-19

fzf - 0.74.1
Ebuild name:

app-shells/fzf-0.74.1

Description

General-purpose command-line fuzzy finder, written in Golang

Added to portage

2026-07-19

gcc - 13.4.1_p20260715
Ebuild name:

sys-devel/gcc-13.4.1_p20260715

Description

The GNU Compiler Collection

Added to portage

2026-07-19

gcc - 14.4.1_p20260716
Ebuild name:

sys-devel/gcc-14.4.1_p20260716

Description

The GNU Compiler Collection

Added to portage

2026-07-19

gcc - 15.3.1_p20260717
Ebuild name:

sys-devel/gcc-15.3.1_p20260717

Description

The GNU Compiler Collection

Added to portage

2026-07-19

gcc - 16.1.1_p20260718
Ebuild name:

sys-devel/gcc-16.1.1_p20260718

Description

The GNU Compiler Collection

Added to portage

2026-07-19

gentoo-kernel - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-6.12.96

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-6.18.39

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-7.1.4

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.96

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.39

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.1.4

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-modprep - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.96

Description

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

Added to portage

2026-07-19

gentoo-kernel-modprep - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.39

Description

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

Added to portage

2026-07-19

gentoo-kernel-modprep - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.1.4

Description

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

Added to portage

2026-07-19

google-chrome - 150.0.7871.128
Ebuild name:

www-client/google-chrome-150.0.7871.128

Description

The web browser from Google

Added to portage

2026-07-19

google-chrome-beta - 151.0.7922.34
Ebuild name:

www-client/google-chrome-beta-151.0.7922.34

Description

The web browser from Google

Added to portage

2026-07-19

google-chrome-unstable - 152.0.7953.3
Ebuild name:

www-client/google-chrome-unstable-152.0.7953.3

Description

The web browser from Google

Added to portage

2026-07-19

gopls - 0.23.0
Ebuild name:

dev-go/gopls-0.23.0

Description

Added to portage

2026-07-19

gpep517 - 20
Ebuild name:

dev-python/gpep517-20

Description

A backend script to aid installing Python packages in Gentoo

Added to portage

2026-07-19

hypothesis - 6.156.9
Ebuild name:

dev-python/hypothesis-6.156.9

Description

A library for property based testing

Added to portage

2026-07-19

icinga-php-thirdparty - 0.15.3
Ebuild name:

dev-libs/icinga-php-thirdparty-0.15.3

Description

Icinga PHP libraries for Icinga Web 2

Added to portage

2026-07-19

icingaweb2-module-director - 1.11.9
Ebuild name:

www-apps/icingaweb2-module-director-1.11.9

Description

Icinga Web 2 plugin for configuration

Added to portage

2026-07-19

intellij-idea - 2026.2
Ebuild name:

dev-util/intellij-idea-2026.2

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-07-19

jsonb-api - 2.0.0-r1
Ebuild name:

dev-java/jsonb-api-2.0.0-r1

Description

Jakarta JSON Binding

Added to portage

2026-07-19

jwt - 2.10.3
Ebuild name:

dev-ruby/jwt-2.10.3

Description

A Ruby implementation of JSON Web Token draft 06

Added to portage

2026-07-19

jwt - 3.2.0
Ebuild name:

dev-ruby/jwt-3.2.0

Description

A Ruby implementation of JSON Web Token draft 06

Added to portage

2026-07-19

kdiff3 - 1.12.5
Ebuild name:

kde-misc/kdiff3-1.12.5

Description

Frontend to diff3 based on KDE Frameworks

Added to portage

2026-07-19

kimageformats - 6.28.0-r1
Ebuild name:

kde-frameworks/kimageformats-6.28.0-r1

Description

Framework providing additional format plugins for Qt's image

Added to portage

2026-07-19

libgit2 - 1.9.6
Ebuild name:

dev-libs/libgit2-1.9.6

Description

A linkable library for Git

Added to portage

2026-07-19

libssh2 - 1.11.1-r2
Ebuild name:

net-libs/libssh2-1.11.1-r2

Description

Library implementing the SSH2 protocol

Added to portage

2026-07-19

matplotlib - 3.11.1
Ebuild name:

dev-python/matplotlib-3.11.1

Description

Pure python plotting library with matlab like syntax

Added to portage

2026-07-19

mattermost-desktop-bin - 6.3.0_rc1
Ebuild name:

net-im/mattermost-desktop-bin-6.3.0_rc1

Description

Mattermost Desktop application

Added to portage

2026-07-19

mergiraf - 0.18.0
Ebuild name:

dev-vcs/mergiraf-0.18.0

Description

Syntax-aware git merge driver

Added to portage

2026-07-19

metasm - 1.0.5-r3
Ebuild name:

dev-ruby/metasm-1.0.5-r3

Description

Cross-architecture assembler, disassembler, linker, and debugger

Added to portage

2026-07-19

microsoft-edge - 150.0.4078.83
Ebuild name:

www-client/microsoft-edge-150.0.4078.83

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-beta - 150.0.4078.65
Ebuild name:

www-client/microsoft-edge-beta-150.0.4078.65

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-beta - 151.0.4129.15
Ebuild name:

www-client/microsoft-edge-beta-151.0.4129.15

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-beta - 151.0.4129.21
Ebuild name:

www-client/microsoft-edge-beta-151.0.4129.21

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-dev - 151.0.4129.21
Ebuild name:

www-client/microsoft-edge-dev-151.0.4129.21

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-dev - 151.0.4129.8
Ebuild name:

www-client/microsoft-edge-dev-151.0.4129.8

Description

The web browser from Microsoft

Added to portage

2026-07-19

microsoft-edge-dev - 152.0.4148.0
Ebuild name:

www-client/microsoft-edge-dev-152.0.4148.0

Description

The web browser from Microsoft

Added to portage

2026-07-19

multipart - 2.0.0
Ebuild name:

dev-python/multipart-2.0.0

Description

Parser for multipart/form-data

Added to portage

2026-07-19

mycli - 2.3.0
Ebuild name:

dev-db/mycli-2.3.0

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2026-07-19

ngircd - 28
Ebuild name:

net-irc/ngircd-28

Description

An IRC server written from scratch

Added to portage

2026-07-19

nss - 3.126
Ebuild name:

dev-libs/nss-3.126

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2026-07-19

numexpr - 2.14.2
Ebuild name:

dev-python/numexpr-2.14.2

Description

Fast numerical array expression evaluator for Python and NumPy

Added to portage

2026-07-19

nwipe - 0.41
Ebuild name:

app-crypt/nwipe-0.41

Description

Securely erase disks using a variety of recognized methods

Added to portage

2026-07-19

onak - 0.6.3
Ebuild name:

app-crypt/onak-0.6.3

Description

onak is an OpenPGP keyserver

Added to portage

2026-07-19

openpgp-keys-alexbarton - 20260718
Ebuild name:

sec-keys/openpgp-keys-alexbarton-20260718

Description

OpenPGP keys used by Alex Barton

Added to portage

2026-07-19

openpgp-keys-nabijaczleweli - 20260717
Ebuild name:

sec-keys/openpgp-keys-nabijaczleweli-20260717

Description

OpenPGP keys used by ??? (nabijaczleweli)

Added to portage

2026-07-19

openrsync - 0.5.0_p20260706
Ebuild name:

net-misc/openrsync-0.5.0_p20260706

Description

BSD-licensed implementation of rsync

Added to portage

2026-07-19

openrsync - 9999
Ebuild name:

net-misc/openrsync-9999

Description

BSD-licensed implementation of rsync

Added to portage

2026-07-19

openssh - 10.4_p1-r1
Ebuild name:

net-misc/openssh-10.4_p1-r1

Description

Port of OpenBSD's free SSH release

Added to portage

2026-07-19

opera - 133.0.5932.60
Ebuild name:

www-client/opera-133.0.5932.60

Description

A fast and secure web browser

Added to portage

2026-07-19

opera-developer - 134.0.5945.0
Ebuild name:

www-client/opera-developer-134.0.5945.0

Description

A fast and secure web browser

Added to portage

2026-07-19

opera-developer - 134.0.5952.0
Ebuild name:

www-client/opera-developer-134.0.5952.0

Description

A fast and secure web browser

Added to portage

2026-07-19

opera-developer - 135.0.5960.0
Ebuild name:

www-client/opera-developer-135.0.5960.0

Description

A fast and secure web browser

Added to portage

2026-07-19

ossp-uuid - 1.6.6
Ebuild name:

dev-libs/ossp-uuid-1.6.6

Description

An ISO-C API with CLI for generating DCE, ISO/IEC and RFC compliant UUID

Added to portage

2026-07-19

pbs-installer - 2026.7.18
Ebuild name:

dev-python/pbs-installer-2026.7.18

Description

Installer for Python Build Standalone

Added to portage

2026-07-19

pecl-xattr - 1.4.1-r1
Ebuild name:

dev-php/pecl-xattr-1.4.1-r1

Description

Extended attributes for PHP

Added to portage

2026-07-19

platformdirs - 4.10.1
Ebuild name:

dev-python/platformdirs-4.10.1

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-07-19

regex - 2026.7.19
Ebuild name:

dev-python/regex-2026.7.19

Description

Alternative regular expression module to replace re

Added to portage

2026-07-19

service-manager - 3
Ebuild name:

virtual/service-manager-3

Description

Virtual for various service managers

Added to portage

2026-07-19

sigil - 2.8.1
Ebuild name:

app-text/sigil-2.8.1

Description

Multi-platform WYSIWYG ebook editor for ePub format

Added to portage

2026-07-19

solfege - 3.23.4-r1
Ebuild name:

media-sound/solfege-3.23.4-r1

Description

GNU program to help practicing ear training

Added to portage

2026-07-19

sphinxcontrib-mermaid - 2.1.0
Ebuild name:

dev-python/sphinxcontrib-mermaid-2.1.0

Description

Sphinx spelling extension

Added to portage

2026-07-19

strawberry - 1.2.23
Ebuild name:

media-sound/strawberry-1.2.23

Description

Modern music player and library organizer based on Clementine and Qt

Added to portage

2026-07-19

telegram-desktop - 7.0.2
Ebuild name:

net-im/telegram-desktop-7.0.2

Description

Official desktop client for Telegram

Added to portage

2026-07-19

telegram-desktop-bin - 7.0.1
Ebuild name:

net-im/telegram-desktop-bin-7.0.1

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-07-19

tibs - 1.1.0
Ebuild name:

dev-python/tibs-1.1.0

Description

A sleek Python library for your binary data

Added to portage

2026-07-19

valijson - 1.1.2
Ebuild name:

dev-cpp/valijson-1.1.2

Description

Header-only C++ library for JSON Schema validation

Added to portage

2026-07-19

vanilla-kernel - 6.12.96
Ebuild name:

sys-kernel/vanilla-kernel-6.12.96

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

vanilla-kernel - 6.18.39
Ebuild name:

sys-kernel/vanilla-kernel-6.18.39

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

vanilla-kernel - 7.1.4
Ebuild name:

sys-kernel/vanilla-kernel-7.1.4

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

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