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:

82760

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-10
attica - 6.22.0
Ebuild name:

kde-frameworks/attica-6.22.0

Description

Framework providing access to Open Collaboration Services

Added to portage

2026-01-10

baloo - 6.22.0
Ebuild name:

kde-frameworks/baloo-6.22.0

Description

Framework for searching and managing metadata

Added to portage

2026-01-10

bluez-qt - 6.22.0
Ebuild name:

kde-frameworks/bluez-qt-6.22.0

Description

Qt wrapper for Bluez 5 DBus API

Added to portage

2026-01-10

breeze-icons - 6.22.0
Ebuild name:

kde-frameworks/breeze-icons-6.22.0

Description

Breeze SVG icon theme

Added to portage

2026-01-10

extra-cmake-modules - 6.22.0
Ebuild name:

kde-frameworks/extra-cmake-modules-6.22.0

Description

Extra modules and scripts for CMake

Added to portage

2026-01-10

filelock - 3.20.3
Ebuild name:

dev-python/filelock-3.20.3

Description

A platform independent file lock for Python

Added to portage

2026-01-10

frameworkintegration - 6.22.0
Ebuild name:

kde-frameworks/frameworkintegration-6.22.0

Description

Framework for integrating Qt applications with KDE Plasm

Added to portage

2026-01-10

fsspec - 2026.1.0
Ebuild name:

dev-python/fsspec-2026.1.0

Description

A specification that python filesystems should adhere to

Added to portage

2026-01-10

kapidox - 6.22.0
Ebuild name:

kde-frameworks/kapidox-6.22.0

Description

Framework for building KDE API documentation in a standard format and

Added to portage

2026-01-10

karchive - 6.22.0
Ebuild name:

kde-frameworks/karchive-6.22.0

Description

Framework for reading, creation, and manipulation of various archive

Added to portage

2026-01-10

kauth - 6.22.0
Ebuild name:

kde-frameworks/kauth-6.22.0

Description

Framework to let applications perform actions as a privileged user

Added to portage

2026-01-10

kbookmarks - 6.22.0
Ebuild name:

kde-frameworks/kbookmarks-6.22.0

Description

Framework for managing bookmarks stored in XBEL format

Added to portage

2026-01-10

kcalendarcore - 6.22.0
Ebuild name:

kde-frameworks/kcalendarcore-6.22.0

Description

Library for interfacing with calendars

Added to portage

2026-01-10

kcmutils - 6.22.0
Ebuild name:

kde-frameworks/kcmutils-6.22.0

Description

Framework to work with KDE System Settings modules

Added to portage

2026-01-10

kcodecs - 6.22.0
Ebuild name:

kde-frameworks/kcodecs-6.22.0

Description

Framework for manipulating strings using various encodings

Added to portage

2026-01-10

kcolorscheme - 6.22.0
Ebuild name:

kde-frameworks/kcolorscheme-6.22.0

Description

Framework for downloading and sharing additional application dat

Added to portage

2026-01-10

kcompletion - 6.22.0
Ebuild name:

kde-frameworks/kcompletion-6.22.0

Description

Framework for common completion tasks such as filename or URL com

Added to portage

2026-01-10

kconfig - 6.22.0
Ebuild name:

kde-frameworks/kconfig-6.22.0

Description

Framework for reading and writing configuration

Added to portage

2026-01-10

kconfigwidgets - 6.22.0
Ebuild name:

kde-frameworks/kconfigwidgets-6.22.0

Description

Framework providing an assortment of configuration-related wid

Added to portage

2026-01-10

kcontacts - 6.22.0
Ebuild name:

kde-frameworks/kcontacts-6.22.0

Description

Address book API based on KDE Frameworks

Added to portage

2026-01-10

kcoreaddons - 6.22.0
Ebuild name:

kde-frameworks/kcoreaddons-6.22.0

Description

Framework for solving common problems such as caching, randomisat

Added to portage

2026-01-10

kcrash - 6.22.0
Ebuild name:

kde-frameworks/kcrash-6.22.0

Description

Framework for intercepting and handling application crashes

Added to portage

2026-01-10

kdav - 6.22.0
Ebuild name:

kde-frameworks/kdav-6.22.0

Description

DAV protocol implemention with KJobs

Added to portage

2026-01-10

kdbusaddons - 6.22.0
Ebuild name:

kde-frameworks/kdbusaddons-6.22.0

Description

Framework for registering services and applications per freedeskt

Added to portage

2026-01-10

kdeclarative - 6.22.0
Ebuild name:

kde-frameworks/kdeclarative-6.22.0

Description

Framework providing integration of QML and KDE work spaces

Added to portage

2026-01-10

kded - 6.22.0
Ebuild name:

kde-frameworks/kded-6.22.0

Description

Central daemon of KDE workspaces

Added to portage

2026-01-10

kdesu - 6.22.0
Ebuild name:

kde-frameworks/kdesu-6.22.0

Description

Framework to handle super user actions

Added to portage

2026-01-10

kdnssd - 6.22.0
Ebuild name:

kde-frameworks/kdnssd-6.22.0

Description

Framework for network service discovery using Zeroconf

Added to portage

2026-01-10

kdoctools - 6.22.0
Ebuild name:

kde-frameworks/kdoctools-6.22.0

Description

Tools to generate documentation in various formats from DocBook fil

Added to portage

2026-01-10

kfilemetadata - 6.22.0
Ebuild name:

kde-frameworks/kfilemetadata-6.22.0

Description

Library for extracting file metadata

Added to portage

2026-01-10

kglobalaccel - 6.22.0
Ebuild name:

kde-frameworks/kglobalaccel-6.22.0

Description

Framework to handle global shortcuts

Added to portage

2026-01-10

kguiaddons - 6.22.0
Ebuild name:

kde-frameworks/kguiaddons-6.22.0

Description

Framework providing assorted high-level user interface components

Added to portage

2026-01-10

kholidays - 6.22.0
Ebuild name:

kde-frameworks/kholidays-6.22.0

Description

Library to determine holidays and other special events for a geogra

Added to portage

2026-01-10

ki18n - 6.22.0
Ebuild name:

kde-frameworks/ki18n-6.22.0

Description

Framework based on Gettext for internationalizing user interface text

Added to portage

2026-01-10

kiconthemes - 6.22.0
Ebuild name:

kde-frameworks/kiconthemes-6.22.0

Description

Framework for icon theming and configuration

Added to portage

2026-01-10

kidletime - 6.22.0
Ebuild name:

kde-frameworks/kidletime-6.22.0

Description

Framework for detection and notification of device idle time

Added to portage

2026-01-10

kimageformats - 6.22.0
Ebuild name:

kde-frameworks/kimageformats-6.22.0

Description

Framework providing additional format plugins for Qt's image I/

Added to portage

2026-01-10

pathspec - 1.0.3
Ebuild name:

dev-python/pathspec-1.0.3

Description

Utility library for gitignore style pattern matching of file paths

Added to portage

2026-01-10

pypdf - 6.6.0
Ebuild name:

dev-python/pypdf-6.6.0

Description

Python library to work with PDF files

Added to portage

2026-01-10

pytest-regressions - 2.9.1
Ebuild name:

dev-python/pytest-regressions-2.9.1

Description

Easy to use fixtures to write regression tests

Added to portage

2026-01-10

sbctl - 0.15.4
Ebuild name:

app-crypt/sbctl-0.15.4

Description

Secure Boot key manager

Added to portage

2026-01-10

sbctl - 0.16
Ebuild name:

app-crypt/sbctl-0.16

Description

Secure Boot key manager

Added to portage

2026-01-10

sbctl - 0.18
Ebuild name:

app-crypt/sbctl-0.18

Description

Secure Boot key manager

Added to portage

2026-01-10

sbsigntools - 0.9.5
Ebuild name:

app-crypt/sbsigntools-0.9.5

Description

Utilities for signing and verifying files for UEFI Secure Boot

Added to portage

2026-01-10

scdrand - 0.3.5
Ebuild name:

app-crypt/scdrand-0.3.5

Description

Feed kernel entropy pool from smartcard's TRNG

Added to portage

2026-01-10

sddm-gentoo-config - 0
Ebuild name:

gui-apps/sddm-gentoo-config-0

Description

Gentoo defaults for SDDM (Simple Desktop Display Manager)

Added to portage

2026-01-10

tox - 4.34.1
Ebuild name:

dev-python/tox-4.34.1

Description

virtualenv-based automation of test activities

Added to portage

2026-01-10

translate-toolkit - 3.18.0
Ebuild name:

dev-python/translate-toolkit-3.18.0

Description

Toolkit to convert between many translation formats

Added to portage

2026-01-10

virtualenv - 20.36.1
Ebuild name:

dev-python/virtualenv-20.36.1

Description

Virtual Python Environment builder

Added to portage

2026-01-10

zope-interface - 8.2
Ebuild name:

dev-python/zope-interface-8.2

Description

Interfaces for Python

Added to portage

2026-01-10

2026-01-09
build - 1.4.0
Ebuild name:

dev-python/build-1.4.0

Description

A simple, correct PEP517 package builder

Added to portage

2026-01-09

closure-compiler-bin - 20260106
Ebuild name:

dev-lang/closure-compiler-bin-20260106

Description

JavaScript optimizing compiler

Added to portage

2026-01-09

confuse - 2.1.0
Ebuild name:

dev-python/confuse-2.1.0

Description

Confuse is a configuration library for Python that uses YAML

Added to portage

2026-01-09

django-polymorphic - 4.8.0
Ebuild name:

dev-python/django-polymorphic-4.8.0

Description

Seamless Polymorphic Inheritance for Django Models

Added to portage

2026-01-09

dry-inflector - 1.3.0
Ebuild name:

dev-ruby/dry-inflector-1.3.0

Description

String inflections for dry-rb

Added to portage

2026-01-09

dry-types - 1.9.0
Ebuild name:

dev-ruby/dry-types-1.9.0

Description

Type system for Ruby supporting coercions, constraints and complex types.

Added to portage

2026-01-09

etcd - 3.5.26
Ebuild name:

dev-db/etcd-3.5.26

Description

Highly-available key value store for shared configuration and service discovery

Added to portage

2026-01-09

etcd - 3.6.7
Ebuild name:

dev-db/etcd-3.6.7

Description

Highly-available key value store for shared configuration and service discovery

Added to portage

2026-01-09

exo - 1.90.0
Ebuild name:

app-admin/exo-1.90.0

Description

Command-line tool for everything at Exoscale compute, storage, dns

Added to portage

2026-01-09

hcloud - 2.14.0
Ebuild name:

dev-python/hcloud-2.14.0

Description

Official Hetzner Cloud python library

Added to portage

2026-01-09

icinga2 - 2.15.0-r2
Ebuild name:

net-analyzer/icinga2-2.15.0-r2

Description

Distributed, general purpose, network monitoring engine

Added to portage

2026-01-09

image_processing - 1.14.0-r1
Ebuild name:

dev-ruby/image_processing-1.14.0-r1

Description

High-level image processing helper methods with libvips and Ima

Added to portage

2026-01-09

intellij-idea - 2025.3.1.1
Ebuild name:

dev-util/intellij-idea-2025.3.1.1

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-01-09

iterable-io - 1.0.1
Ebuild name:

dev-python/iterable-io-1.0.1

Description

Adapt generators and other iterables to a file-like interface

Added to portage

2026-01-09

jj - 0.37.0
Ebuild name:

dev-vcs/jj-0.37.0

Description

Jujutsu - an experimental version control system

Added to portage

2026-01-09

jupyter-client - 8.8.0
Ebuild name:

dev-python/jupyter-client-8.8.0

Description

Jupyter protocol implementation and client libraries

Added to portage

2026-01-09

krita - 6.0.0_alpha_pre20260108
Ebuild name:

media-gfx/krita-6.0.0_alpha_pre20260108

Description

Free digital painting application. Digital Painting, Creati

Added to portage

2026-01-09

maturin - 1.11.5
Ebuild name:

dev-util/maturin-1.11.5

Description

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

Added to portage

2026-01-09

multi_xml - 0.8.1
Ebuild name:

dev-ruby/multi_xml-0.8.1

Description

A generic swappable back-end for XML parsing

Added to portage

2026-01-09

nss - 3.120
Ebuild name:

dev-libs/nss-3.120

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2026-01-09

oslo-concurrency - 7.3.0
Ebuild name:

dev-python/oslo-concurrency-7.3.0

Description

Oslo Concurrency library

Added to portage

2026-01-09

oslo-config - 10.2.0
Ebuild name:

dev-python/oslo-config-10.2.0

Description

Oslo Configuration API

Added to portage

2026-01-09

pathspec - 1.0.2
Ebuild name:

dev-python/pathspec-1.0.2

Description

Utility library for gitignore style pattern matching of file paths

Added to portage

2026-01-09

pdf-tools - 1.3.0
Ebuild name:

app-emacs/pdf-tools-1.3.0

Description

Emacs Lisp support library for PDF documents

Added to portage

2026-01-09

pdm - 2.26.4
Ebuild name:

dev-python/pdm-2.26.4

Description

Python package and dependency manager supporting the latest PEP standards

Added to portage

2026-01-09

puremd5 - 2.1.4
Ebuild name:

dev-haskell/puremd5-2.1.4

Description

A Haskell-only implementation of the MD5 digest (hash) algorithm

Added to portage

2026-01-09

pyqt6 - 6.10.2
Ebuild name:

dev-python/pyqt6-6.10.2

Description

Python bindings for the Qt framework

Added to portage

2026-01-09

pyside - 6.10.1-r5
Ebuild name:

dev-python/pyside-6.10.1-r5

Description

Python bindings for the Qt framework

Added to portage

2026-01-09

pytest-regressions - 2.9.0
Ebuild name:

dev-python/pytest-regressions-2.9.0

Description

Easy to use fixtures to write regression tests

Added to portage

2026-01-09

python-neutronclient - 11.7.0
Ebuild name:

dev-python/python-neutronclient-11.7.0

Description

A client for the OpenStack Quantum API

Added to portage

2026-01-09

python-openstackclient - 8.3.0
Ebuild name:

dev-python/python-openstackclient-8.3.0

Description

A client for the OpenStack APIs

Added to portage

2026-01-09

qiskit - 2.3.0
Ebuild name:

dev-python/qiskit-2.3.0

Description

An open-source SDK for working with quantum computers

Added to portage

2026-01-09

rotix - 0.83-r3
Ebuild name:

app-crypt/rotix-0.83-r3

Description

Rotix allows you to generate rotational obfuscations

Added to portage

2026-01-09

rpm-sequoia - 1.10.0
Ebuild name:

app-crypt/rpm-sequoia-1.10.0

Description

Implementation of the RPM PGP interface using Sequoia

Added to portage

2026-01-09

rpm-sequoia - 1.9.0
Ebuild name:

app-crypt/rpm-sequoia-1.9.0

Description

Implementation of the RPM PGP interface using Sequoia

Added to portage

2026-01-09

rspamd - 3.14.3
Ebuild name:

mail-filter/rspamd-3.14.3

Description

Rapid spam filtering system

Added to portage

2026-01-09

sabctools - 9.3.0
Ebuild name:

dev-python/sabctools-9.3.0

Description

Module providing raw yEnc encoding/decoding for SABnzbd

Added to portage

2026-01-09

solaar - 1.1.19
Ebuild name:

app-misc/solaar-1.1.19

Description

Linux Device Manager for Logitech Unifying Receivers and Paired Devices

Added to portage

2026-01-09

telegram-desktop-bin - 6.4.1
Ebuild name:

net-im/telegram-desktop-bin-6.4.1

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-01-09

tox - 4.34.0
Ebuild name:

dev-python/tox-4.34.0

Description

virtualenv-based automation of test activities

Added to portage

2026-01-09

transient - 0.12.0
Ebuild name:

app-emacs/transient-0.12.0

Description

Transient commands abstraction for GNU Emacs

Added to portage

2026-01-09

types-gdb - 16.3.0.20260109
Ebuild name:

dev-python/types-gdb-16.3.0.20260109

Description

Typing stubs for gdb

Added to portage

2026-01-09

upterm - 0.21.1
Ebuild name:

app-misc/upterm-0.21.1

Description

Instant Terminal Sharing

Added to portage

2026-01-09

werkzeug - 3.1.5
Ebuild name:

dev-python/werkzeug-3.1.5

Description

Collection of various utilities for WSGI applications

Added to portage

2026-01-09

with-editor - 3.4.8
Ebuild name:

app-emacs/with-editor-3.4.8

Description

Use the Emacsclient as the of child processes

Added to portage

2026-01-09

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