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:

82897

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-01-22
2026-01-21
apprise - 1.9.7
Ebuild name:

dev-python/apprise-1.9.7

Description

Push Notifications that work with just about every platform

Added to portage

2026-01-21

asciinema - 3.1.0
Ebuild name:

app-misc/asciinema-3.1.0

Description

Terminal session recorder, streamer, and player

Added to portage

2026-01-21

awscli - 1.44.21
Ebuild name:

app-admin/awscli-1.44.21

Description

Universal Command Line Environment for AWS

Added to portage

2026-01-21

biboumi - 10.0_pre20260110
Ebuild name:

net-im/biboumi-10.0_pre20260110

Description

XMPP gateway to IRC

Added to portage

2026-01-21

bluetui - 0.8.1
Ebuild name:

net-wireless/bluetui-0.8.1

Description

TUI for managing bluetooth on Linux

Added to portage

2026-01-21

boto3 - 1.42.31
Ebuild name:

dev-python/boto3-1.42.31

Description

The AWS SDK for Python

Added to portage

2026-01-21

botocore - 1.42.31
Ebuild name:

dev-python/botocore-1.42.31

Description

Low-level, data-driven core of boto 3

Added to portage

2026-01-21

caffe2 - 2.9.1-r3
Ebuild name:

sci-ml/caffe2-2.9.1-r3

Description

A deep learning framework

Added to portage

2026-01-21

chrome-binary-plugins - 144.0.7559.96
Ebuild name:

www-plugins/chrome-binary-plugins-144.0.7559.96

Description

Binary plugins from Google Chrome for use in Chromi

Added to portage

2026-01-21

chromedriver-bin - 144.0.7559.96
Ebuild name:

www-apps/chromedriver-bin-144.0.7559.96

Description

WebDriver for Chrome

Added to portage

2026-01-21

chromium - 144.0.7559.96
Ebuild name:

www-client/chromium-144.0.7559.96

Description

Open-source version of Google Chrome web browser

Added to portage

2026-01-21

clanbomber - 2.3_p20220703
Ebuild name:

games-action/clanbomber-2.3_p20220703

Description

Bomberman-like multiplayer game

Added to portage

2026-01-21

claude-code - 2.1.14
Ebuild name:

dev-util/claude-code-2.1.14

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-01-21

curl - 8.18.0
Ebuild name:

net-misc/curl-8.18.0

Description

A Client that groks URLs

Added to portage

2026-01-21

django-debug-toolbar - 6.2.0
Ebuild name:

dev-python/django-debug-toolbar-6.2.0

Description

A configurable set of panels that display various debug infor

Added to portage

2026-01-21

dropbox - 240.4.8493
Ebuild name:

net-misc/dropbox-240.4.8493

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2026-01-21

elementpath - 5.1.1
Ebuild name:

dev-python/elementpath-5.1.1

Description

XPath 1.0/2.0 parsers and selectors for ElementTree and lxml

Added to portage

2026-01-21

fastbencode - 0.3.9
Ebuild name:

dev-python/fastbencode-0.3.9

Description

Implementation of bencode with Rust implementation

Added to portage

2026-01-21

ffmpeg-chromium - 145
Ebuild name:

media-video/ffmpeg-chromium-145

Description

FFmpeg built specifically for codec support in Chromium-based brows

Added to portage

2026-01-21

fotocx - 26.1
Ebuild name:

media-gfx/fotocx-26.1

Description

Program for improving image files made with a digital camera

Added to portage

2026-01-21

framework_tool - 0.5.0
Ebuild name:

app-laptop/framework_tool-0.5.0

Description

Tool to control Framework Computer systems

Added to portage

2026-01-21

gn - 0.2318
Ebuild name:

dev-build/gn-0.2318

Description

GN is a meta-build system that generates build files for Ninja

Added to portage

2026-01-21

google-chrome - 144.0.7559.96
Ebuild name:

www-client/google-chrome-144.0.7559.96

Description

The web browser from Google

Added to portage

2026-01-21

hackrf-tools - 2026.01.2
Ebuild name:

net-wireless/hackrf-tools-2026.01.2

Description

tools for communicating with HackRF SDR platform

Added to portage

2026-01-21

harfbuzz - 12.3.1
Ebuild name:

media-libs/harfbuzz-12.3.1

Description

An OpenType text shaping engine

Added to portage

2026-01-21

iotop-c - 1.31
Ebuild name:

sys-process/iotop-c-1.31

Description

top utility for IO (C port)

Added to portage

2026-01-21

ircii - 20260115
Ebuild name:

net-irc/ircii-20260115

Description

An IRC and ICB client that runs under most UNIX platforms

Added to portage

2026-01-21

jenkins-bin - 2.541.1
Ebuild name:

dev-util/jenkins-bin-2.541.1

Description

The leading open source automation server

Added to portage

2026-01-21

kmscon - 9.2.1
Ebuild name:

sys-apps/kmscon-9.2.1

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-01-21

less - 691
Ebuild name:

sys-apps/less-691

Description

Excellent text file viewer

Added to portage

2026-01-21

libhackrf - 2026.01.2
Ebuild name:

net-libs/libhackrf-2026.01.2

Description

library for communicating with HackRF SDR platform

Added to portage

2026-01-21

markdown - 3.10.1
Ebuild name:

dev-python/markdown-3.10.1

Description

Python implementation of the markdown markup language

Added to portage

2026-01-21

mcelog - 210
Ebuild name:

app-admin/mcelog-210

Description

A tool to log and decode Machine Check Exceptions

Added to portage

2026-01-21

memtest86-bin - 11.6
Ebuild name:

sys-apps/memtest86-bin-11.6

Description

Stand alone memory testing software for x86 EFI hardware

Added to portage

2026-01-21

microsoft-edge-beta - 144.0.3719.82
Ebuild name:

www-client/microsoft-edge-beta-144.0.3719.82

Description

The web browser from Microsoft

Added to portage

2026-01-21

mysql - 8.0.45
Ebuild name:

dev-db/mysql-8.0.45

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2026-01-21

mysql - 8.4.8
Ebuild name:

dev-db/mysql-8.4.8

Description

Fast, multi-threaded, multi-user SQL database server

Added to portage

2026-01-21

nghttp3 - 1.15.0
Ebuild name:

net-libs/nghttp3-1.15.0

Description

HTTP/3 library written in C

Added to portage

2026-01-21

ngtcp2 - 1.20.0
Ebuild name:

net-libs/ngtcp2-1.20.0

Description

Implementation of the IETF QUIC Protocol

Added to portage

2026-01-21

openpgp-keys-dshaw - 20260121
Ebuild name:

sec-keys/openpgp-keys-dshaw-20260121

Description

OpenPGP key used by David Shaw

Added to portage

2026-01-21

openpgp-keys-inetutils - 20260120
Ebuild name:

sec-keys/openpgp-keys-inetutils-20260120

Description

OpenPGP keys used for net-misc/inetutils

Added to portage

2026-01-21

openpgp-keys-libssh - 20260121
Ebuild name:

sec-keys/openpgp-keys-libssh-20260121

Description

OpenPGP key used by net-libs/libssh

Added to portage

2026-01-21

openpgp-keys-martinlambers - 20260120
Ebuild name:

sec-keys/openpgp-keys-martinlambers-20260120

Description

OpenPGP key used by Martin Lambers

Added to portage

2026-01-21

openpgp-keys-milanbroz - 20260121
Ebuild name:

sec-keys/openpgp-keys-milanbroz-20260121

Description

OpenPGP key used by Milan Broz

Added to portage

2026-01-21

openpgp-keys-mysql - 20250120
Ebuild name:

sec-keys/openpgp-keys-mysql-20250120

Description

OpenPGP keys used to sign MySQL releases

Added to portage

2026-01-21

openpgp-keys-p11-kit - 20260120
Ebuild name:

sec-keys/openpgp-keys-p11-kit-20260120

Description

OpenPGP key used to sign p11-kit releases

Added to portage

2026-01-21

openpgp-keys-stewartsmith - 20260121
Ebuild name:

sec-keys/openpgp-keys-stewartsmith-20260121

Description

OpenPGP key used by Stewart Smith

Added to portage

2026-01-21

openpgp-keys-stunnel - 20260120
Ebuild name:

sec-keys/openpgp-keys-stunnel-20260120

Description

OpenPGP key used by stunnel

Added to portage

2026-01-21

openpgp-keys-wernerlemberg - 20260121
Ebuild name:

sec-keys/openpgp-keys-wernerlemberg-20260121

Description

OpenPGP key used by Werner Lemberg (wl)

Added to portage

2026-01-21

openpgp-keys-zstd - 20260121
Ebuild name:

sec-keys/openpgp-keys-zstd-20260121

Description

OpenPGP key used by app-arch/zstd

Added to portage

2026-01-21

opera-developer - 128.0.5783.0
Ebuild name:

www-client/opera-developer-128.0.5783.0

Description

A fast and secure web browser

Added to portage

2026-01-21

pandas - 3.0.0
Ebuild name:

dev-python/pandas-3.0.0

Description

Powerful data structures for data analysis and statistics

Added to portage

2026-01-21

paredit - 26-r1
Ebuild name:

app-emacs/paredit-26-r1

Description

Minor mode for performing structured editing of S-expressions

Added to portage

2026-01-21

pariemacs - 3.14-r1
Ebuild name:

app-emacs/pariemacs-3.14-r1

Description

sci-mathematics/pari emacs mode

Added to portage

2026-01-21

parsebib - 6.7
Ebuild name:

app-emacs/parsebib-6.7

Description

Emacs Lisp library for reading .bib files

Added to portage

2026-01-21

parseclj - 1.1.1
Ebuild name:

app-emacs/parseclj-1.1.1

Description

Clojure Parser for Emacs Lisp

Added to portage

2026-01-21

pass - 1.7.4-r3
Ebuild name:

app-admin/pass-1.7.4-r3

Description

Stores, retrieves, generates, and synchronizes passwords securely

Added to portage

2026-01-21

pass - 2.0_p20260109
Ebuild name:

app-emacs/pass-2.0_p20260109

Description

Major mode for password-store

Added to portage

2026-01-21

password-store-otp - 0.1.5
Ebuild name:

app-emacs/password-store-otp-0.1.5

Description

Major mode for password-store

Added to portage

2026-01-21

php - 8.3.30
Ebuild name:

dev-lang/php-8.3.30

Description

The PHP language runtime engine

Added to portage

2026-01-21

php - 8.4.17
Ebuild name:

dev-lang/php-8.4.17

Description

The PHP language runtime engine

Added to portage

2026-01-21

php - 8.5.2
Ebuild name:

dev-lang/php-8.5.2

Description

The PHP language runtime engine

Added to portage

2026-01-21

podman - 5.7.0
Ebuild name:

dev-python/podman-5.7.0

Description

A library to interact with a Podman server

Added to portage

2026-01-21

poetry - 2.3.1
Ebuild name:

dev-python/poetry-2.3.1

Description

A frontend for poetry - a python dependency management and packaging tool

Added to portage

2026-01-21

portage - 3.0.76-r1
Ebuild name:

sys-apps/portage-3.0.76-r1

Description

The package management and distribution system for Gentoo

Added to portage

2026-01-21

pyparsing - 3.3.2
Ebuild name:

dev-python/pyparsing-3.3.2

Description

Easy-to-use Python module for text parsing

Added to portage

2026-01-21

pytokens - 0.4.0-r1
Ebuild name:

dev-python/pytokens-0.4.0-r1

Description

A fast, spec compliant Python 3.13+ tokenizer that runs on older Pytho

Added to portage

2026-01-21

qbittorrent - 5.0.5-r1
Ebuild name:

net-p2p/qbittorrent-5.0.5-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-01-21

qbittorrent - 5.1.2-r1
Ebuild name:

net-p2p/qbittorrent-5.1.2-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-01-21

quiche - 0.24.8
Ebuild name:

net-libs/quiche-0.24.8

Description

Implementation of the QUIC transport protocol and HTTP/3

Added to portage

2026-01-21

sarge - 0.1.8
Ebuild name:

dev-python/sarge-0.1.8

Description

Wrapper for subprocess which provides command pipeline functionality

Added to portage

2026-01-21

soupsieve - 2.8.3
Ebuild name:

dev-python/soupsieve-2.8.3

Description

A modern CSS selector implementation for BeautifulSoup

Added to portage

2026-01-21

sslscan - 2.2.1
Ebuild name:

net-analyzer/sslscan-2.2.1

Description

Fast SSL configuration scanner

Added to portage

2026-01-21

tomcat-native - 1.3.5
Ebuild name:

dev-java/tomcat-native-1.3.5

Description

Allows Tomcat to use certain native resources for better performance

Added to portage

2026-01-21

udiskie - 2.6.1
Ebuild name:

sys-fs/udiskie-2.6.1

Description

An automatic disk mounting service using udisks

Added to portage

2026-01-21

wcwidth - 0.3.0
Ebuild name:

dev-python/wcwidth-0.3.0

Description

Measures number of Terminal column cells of wide-character codes

Added to portage

2026-01-21

wsjtx_improved - 3.0.0_p20251212
Ebuild name:

media-radio/wsjtx_improved-3.0.0_p20251212

Description

Weak signal ham radio communication with improvements

Added to portage

2026-01-21

xkcdpass - 1.30.0
Ebuild name:

app-admin/xkcdpass-1.30.0

Description

Password generator inspired by XKCD 936

Added to portage

2026-01-21

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