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:

86713

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-10
duplicity - 3.1.0
Ebuild name:

app-backup/duplicity-3.1.0

Description

Secure backup system using GnuPG to encrypt data

Added to portage

2026-07-10

firewalld - 2.4.4
Ebuild name:

net-firewall/firewalld-2.4.4

Description

Firewall daemon with D-Bus interface providing a dynamic firewall

Added to portage

2026-07-10

libffi - 3.6.0
Ebuild name:

dev-libs/libffi-3.6.0

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-07-10

libffi - 3.7.0
Ebuild name:

dev-libs/libffi-3.7.0

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-07-10

navi2ch - 1.8.4-r2
Ebuild name:

app-emacs/navi2ch-1.8.4-r2

Description

A navigator for the Japanese textboard 2ch

Added to portage

2026-07-10

postfix - 3.12_pre20260709
Ebuild name:

mail-mta/postfix-3.12_pre20260709

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-07-10

tpm2-pytss - 2.3.0-r3
Ebuild name:

dev-python/tpm2-pytss-2.3.0-r3

Description

Python bindings for TSS

Added to portage

2026-07-10

2026-07-09
alertmanager - 0.33.1
Ebuild name:

app-metrics/alertmanager-0.33.1

Description

Alertmanager for alerts sent by client applications such as Prometh

Added to portage

2026-07-09

awscli - 1.45.44
Ebuild name:

app-admin/awscli-1.45.44

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-09

batteries - 3.11.0
Ebuild name:

dev-ml/batteries-3.11.0

Description

A community-maintained standard library extension

Added to portage

2026-07-09

blackbox_exporter - 0.28.0
Ebuild name:

app-metrics/blackbox_exporter-0.28.0

Description

Prometheus exporter for blackbox probing via HTTP, HTTPS, DNS,

Added to portage

2026-07-09

blessed - 1.47.0
Ebuild name:

dev-python/blessed-1.47.0

Description

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

Added to portage

2026-07-09

boto3 - 1.43.44
Ebuild name:

dev-python/boto3-1.43.44

Description

The AWS SDK for Python

Added to portage

2026-07-09

botocore - 1.43.44
Ebuild name:

dev-python/botocore-1.43.44

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-09

c-ares - 1.34.8
Ebuild name:

net-dns/c-ares-1.34.8

Description

C library that resolves names asynchronously

Added to portage

2026-07-09

cloudflared - 2026.7.0
Ebuild name:

net-vpn/cloudflared-2026.7.0

Description

A command-line client and tunneling daemon for Cloudflare Tunnel

Added to portage

2026-07-09

discord - 1.0.146
Ebuild name:

net-im/discord-1.0.146

Description

All-in-one voice and text chat for gamers

Added to portage

2026-07-09

dnsmasq - 2.93
Ebuild name:

net-dns/dnsmasq-2.93

Description

Small forwarding DNS server

Added to portage

2026-07-09

filelock - 3.29.7
Ebuild name:

dev-python/filelock-3.29.7

Description

A platform independent file lock for Python

Added to portage

2026-07-09

flask-caching - 2.4.1
Ebuild name:

dev-python/flask-caching-2.4.1

Description

Adds caching support to Flask applications

Added to portage

2026-07-09

genshi - 0.7.11-r1
Ebuild name:

dev-python/genshi-0.7.11-r1

Description

Python toolkit for stream-based generation of output for the web

Added to portage

2026-07-09

ggml - 0.15.3-r2
Ebuild name:

sci-ml/ggml-0.15.3-r2

Description

Tensor library for machine learning

Added to portage

2026-07-09

grpcio - 1.82.1
Ebuild name:

dev-python/grpcio-1.82.1

Description

HTTP/2-based RPC framework

Added to portage

2026-07-09

grpcio-status - 1.82.1
Ebuild name:

dev-python/grpcio-status-1.82.1

Description

Reference package for GRPC Python status proto mapping

Added to portage

2026-07-09

handbrake - 1.11.1-r2
Ebuild name:

media-video/handbrake-1.11.1-r2

Description

Open-source, GPL-licensed, multiplatform, multithreaded video trans

Added to portage

2026-07-09

handbrake - 1.11.2-r1
Ebuild name:

media-video/handbrake-1.11.2-r1

Description

Open-source, GPL-licensed, multiplatform, multithreaded video trans

Added to portage

2026-07-09

hypothesis - 6.156.4
Ebuild name:

dev-python/hypothesis-6.156.4

Description

A library for property based testing

Added to portage

2026-07-09

joserfc - 1.7.3
Ebuild name:

dev-python/joserfc-1.7.3

Description

A Python library for JOSE RFCs JWS, JWE, JWK, JWA, JWT

Added to portage

2026-07-09

librt - 0.13.0
Ebuild name:

dev-python/librt-0.13.0

Description

Mypyc runtime library

Added to portage

2026-07-09

musescore - 4.7.4
Ebuild name:

media-sound/musescore-4.7.4

Description

WYSIWYG Music Score Typesetter

Added to portage

2026-07-09

musl - 1.2.6-r2
Ebuild name:

sys-libs/musl-1.2.6-r2

Description

Light, fast and, simple C library focused on standards-conformance and safet

Added to portage

2026-07-09

mycli - 2.1.1
Ebuild name:

dev-db/mycli-2.1.1

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2026-07-09

navi2ch - 1.8.4-r2
Ebuild name:

app-emacs/navi2ch-1.8.4-r2

Description

A navigator for the Japanese textboard 2ch

Added to portage

2026-07-09

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-09

onak - 0.6.3
Ebuild name:

app-crypt/onak-0.6.3

Description

onak is an OpenPGP keyserver

Added to portage

2026-07-09

onak - 0.6.4
Ebuild name:

app-crypt/onak-0.6.4

Description

onak is an OpenPGP keyserver

Added to portage

2026-07-09

patch - 3.1.2
Ebuild name:

dev-ml/patch-3.1.2

Description

Patch library purely in OCaml

Added to portage

2026-07-09

perl - 5.44.0_rc2
Ebuild name:

dev-lang/perl-5.44.0_rc2

Description

Larry Wall's Practical Extraction and Report Language

Added to portage

2026-07-09

perl-IO-Compress - 2.220.0-r1
Ebuild name:

virtual/perl-IO-Compress-2.220.0-r1

Description

Virtual for

Added to portage

2026-07-09

perl-IO-Compress - 2.223.0
Ebuild name:

virtual/perl-IO-Compress-2.223.0

Description

Virtual for

Added to portage

2026-07-09

perl-Module-CoreList - 5.202.607.80
Ebuild name:

virtual/perl-Module-CoreList-5.202.607.80

Description

Virtual for

Added to portage

2026-07-09

pipewire - 1.6.8
Ebuild name:

media-video/pipewire-1.6.8

Description

Multimedia processing graphs

Added to portage

2026-07-09

pkixssh - 19.0
Ebuild name:

net-misc/pkixssh-19.0

Description

OpenSSH fork with X.509 v3 certificate support

Added to portage

2026-07-09

proto-plus - 1.28.1
Ebuild name:

dev-python/proto-plus-1.28.1

Description

Beautiful, Pythonic protocol buffers

Added to portage

2026-07-09

pwvucontrol - 0.5.3
Ebuild name:

media-sound/pwvucontrol-0.5.3

Description

Volume control applet for Pipewire

Added to portage

2026-07-09

pyasn1 - 0.6.4
Ebuild name:

dev-python/pyasn1-0.6.4

Description

ASN.1 library for Python

Added to portage

2026-07-09

pypresence - 4.6.2
Ebuild name:

dev-python/pypresence-4.6.2

Description

Complete Discord IPC and Rich Presence wrapper library in Python

Added to portage

2026-07-09

pyproject-fmt - 2.25.2
Ebuild name:

dev-python/pyproject-fmt-2.25.2

Description

Format your pyproject.toml file

Added to portage

2026-07-09

python-discovery - 1.4.4
Ebuild name:

dev-python/python-discovery-1.4.4

Description

Python interpreter discovery

Added to portage

2026-07-09

radicale - 3.7.6
Ebuild name:

www-apps/radicale-3.7.6

Description

A simple CalDAV calendar server

Added to portage

2026-07-09

rarfile - 4.3
Ebuild name:

dev-python/rarfile-4.3

Description

Module for RAR archive reading

Added to portage

2026-07-09

rust-parallel - 1.23.0
Ebuild name:

sys-process/rust-parallel-1.23.0

Description

Fast command line app to run commands in parallel

Added to portage

2026-07-09

rutorrent - 5.3.5
Ebuild name:

www-apps/rutorrent-5.3.5

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2026-07-09

scripttest - 3.0
Ebuild name:

dev-python/scripttest-3.0

Description

Helper to test command-line scripts

Added to portage

2026-07-09

solaar - 1.1.20
Ebuild name:

app-misc/solaar-1.1.20

Description

Linux Device Manager for Logitech Unifying Receivers and Paired Devices

Added to portage

2026-07-09

testfixtures - 12.3.0
Ebuild name:

dev-python/testfixtures-12.3.0

Description

A collection of helpers and mock objects for unit tests and doc test

Added to portage

2026-07-09

textx - 4.4.0
Ebuild name:

dev-python/textx-4.4.0

Description

Meta-language for DSL implementation inspired by Xtext

Added to portage

2026-07-09

throttled - 0.12
Ebuild name:

sys-power/throttled-0.12

Description

Daemon to work around throttling issues on some Intel laptops

Added to portage

2026-07-09

timezone-data - 2026c
Ebuild name:

sys-libs/timezone-data-2026c

Description

Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)

Added to portage

2026-07-09

tox - 4.56.4
Ebuild name:

dev-python/tox-4.56.4

Description

virtualenv-based automation of test activities

Added to portage

2026-07-09

uvicorn - 0.51.0
Ebuild name:

dev-python/uvicorn-0.51.0

Description

Lightning-fast ASGI server implementation

Added to portage

2026-07-09

visual-fill-column - 2.7.1
Ebuild name:

app-emacs/visual-fill-column-2.7.1

Description

GNU Emacs mode for wrapping visual-line-mode buffers at fill-col

Added to portage

2026-07-09

winbox - 4.2
Ebuild name:

app-admin/winbox-4.2

Description

Management Software for MikroTik RouterOS

Added to portage

2026-07-09

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