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:

82925

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-23
akonadi - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-25.12.1-r1

Description

Storage service for PIM data and libraries for PIM apps

Added to portage

2026-01-23

akonadi-calendar - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-calendar-25.12.1-r1

Description

Library for akonadi calendar integration

Added to portage

2026-01-23

akonadi-calendar-tools-common - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-calendar-tools-common-25.12.1-r1

Description

Added to portage

2026-01-23

akonadi-contacts - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-contacts-25.12.1-r1

Description

Library for akonadi contact integration

Added to portage

2026-01-23

akonadi-import-wizard - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-import-wizard-25.12.1-r1

Description

Assistant to import PIM data from other applications into

Added to portage

2026-01-23

akonadi-mime - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-mime-25.12.1-r1

Description

Library for akonadi mime types

Added to portage

2026-01-23

akonadi-search - 25.12.1-r1
Ebuild name:

kde-apps/akonadi-search-25.12.1-r1

Description

Libraries and daemons to implement searching in Akonadi

Added to portage

2026-01-23

akonadiconsole - 25.12.1-r1
Ebuild name:

kde-apps/akonadiconsole-25.12.1-r1

Description

Application for debugging Akonadi Resources

Added to portage

2026-01-23

akregator - 25.12.1-r1
Ebuild name:

kde-apps/akregator-25.12.1-r1

Description

News feed aggregator

Added to portage

2026-01-23

bazelisk - 1.28.1
Ebuild name:

dev-build/bazelisk-1.28.1

Description

A user-friendly launcher for Bazel written in Go

Added to portage

2026-01-23

blueprint-compiler - 0.19.0
Ebuild name:

dev-util/blueprint-compiler-0.19.0

Description

Compiler for Blueprint, a markup language for GTK user interface

Added to portage

2026-01-23

calendarjanitor - 25.12.1-r1
Ebuild name:

kde-apps/calendarjanitor-25.12.1-r1

Description

Tool to scan calendar data for buggy instances

Added to portage

2026-01-23

calendarsupport - 25.12.1-r1
Ebuild name:

kde-apps/calendarsupport-25.12.1-r1

Description

Calendar support library

Added to portage

2026-01-23

closure-compiler-bin - 20260120
Ebuild name:

dev-lang/closure-compiler-bin-20260120

Description

JavaScript optimizing compiler

Added to portage

2026-01-23

devcontainer - 0.81.1
Ebuild name:

app-containers/devcontainer-0.81.1

Description

Reference implementation of the Development Containers specifica

Added to portage

2026-01-23

ensurepip-setuptools - 80.10.1
Ebuild name:

dev-python/ensurepip-setuptools-80.10.1

Description

Shared setuptools wheel for ensurepip Python module

Added to portage

2026-01-23

eventviews - 25.12.1-r1
Ebuild name:

kde-apps/eventviews-25.12.1-r1

Description

Calendar viewer for KDE PIM

Added to portage

2026-01-23

fastfetch - 2.58.0
Ebuild name:

app-misc/fastfetch-2.58.0

Description

Fast neofetch-like system information tool

Added to portage

2026-01-23

git-cliff - 2.11.0
Ebuild name:

dev-vcs/git-cliff-2.11.0

Description

A highly customizable changelog generator

Added to portage

2026-01-23

grantlee-editor - 25.12.1-r1
Ebuild name:

kde-apps/grantlee-editor-25.12.1-r1

Description

Utilities and tools to manage themes in KDE PIM applications

Added to portage

2026-01-23

grantleetheme - 25.12.1-r1
Ebuild name:

kde-apps/grantleetheme-25.12.1-r1

Description

Library for Grantlee plugins

Added to portage

2026-01-23

incidenceeditor - 25.12.1-r1
Ebuild name:

kde-apps/incidenceeditor-25.12.1-r1

Description

Incidence editor for KOrganizer

Added to portage

2026-01-23

joplin-desktop - 3.5.12
Ebuild name:

app-office/joplin-desktop-3.5.12

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-01-23

kaddressbook - 25.12.1-r1
Ebuild name:

kde-apps/kaddressbook-25.12.1-r1

Description

Address book application based on KDE Frameworks

Added to portage

2026-01-23

kalarm - 25.12.1-r1
Ebuild name:

kde-apps/kalarm-25.12.1-r1

Description

Application to manage alarms and other timer based alerts for the deskto

Added to portage

2026-01-23

kate - 25.12.1-r1
Ebuild name:

kde-apps/kate-25.12.1-r1

Description

Multi-document editor with network transparency, Plasma integration and mo

Added to portage

2026-01-23

kate-addons - 25.12.1-r1
Ebuild name:

kde-apps/kate-addons-25.12.1-r1

Description

Addons used by Kate

Added to portage

2026-01-23

kate-lib - 25.12.1-r1
Ebuild name:

kde-apps/kate-lib-25.12.1-r1

Description

Shared library used by Kate/Kwrite and Kate-Addons

Added to portage

2026-01-23

kcalutils - 25.12.1-r1
Ebuild name:

kde-apps/kcalutils-25.12.1-r1

Description

Library providing utility functions for the handling of calendar data

Added to portage

2026-01-23

kdepim-addons - 25.12.1-r1
Ebuild name:

kde-apps/kdepim-addons-25.12.1-r1

Description

Plugins for KDE Personal Information Management Suite

Added to portage

2026-01-23

kdepim-meta - 25.12.1-r1
Ebuild name:

kde-apps/kdepim-meta-25.12.1-r1

Description

KDE PIM - merge this to pull in all kdepim-derived packages

Added to portage

2026-01-23

kdepim-runtime - 25.12.1-r1
Ebuild name:

kde-apps/kdepim-runtime-25.12.1-r1

Description

Runtime plugin collection to extend the functionality of KDE PIM

Added to portage

2026-01-23

kdf - 25.12.1-r1
Ebuild name:

kde-apps/kdf-25.12.1-r1

Description

KDE free disk space utility

Added to portage

2026-01-23

keditbookmarks - 25.12.1-r1
Ebuild name:

kde-apps/keditbookmarks-25.12.1-r1

Description

Bookmarks editor based on KDE Frameworks

Added to portage

2026-01-23

kopeninghours - 25.12.1-r1
Ebuild name:

dev-libs/kopeninghours-25.12.1-r1

Description

Library for parsing and evaluating OSM opening hours expressions

Added to portage

2026-01-23

kosmindoormap - 25.12.1-r1
Ebuild name:

dev-libs/kosmindoormap-25.12.1-r1

Description

Data Model and Extraction System for Travel Reservation informati

Added to portage

2026-01-23

kpublictransport - 25.12.1-r1
Ebuild name:

dev-libs/kpublictransport-25.12.1-r1

Description

Library for accessing public transport timetables and other in

Added to portage

2026-01-23

libtsm - 4.4.1
Ebuild name:

dev-libs/libtsm-4.4.1

Description

Terminal Emulator State Machine

Added to portage

2026-01-23

merkuro - 25.12.1-r1
Ebuild name:

app-office/merkuro-25.12.1-r1

Description

Calendar application using Akonadi

Added to portage

2026-01-23

open-vmdk - 0.3.13
Ebuild name:

app-emulation/open-vmdk-0.3.13

Description

Tools for creating and converting OVA virtual appliance files

Added to portage

2026-01-23

osm - 9999
Ebuild name:

app-emacs/osm-9999

Description

OpenStreetMap tile-based viewer for GNU Emacs

Added to portage

2026-01-23

outline-magic - 0.9
Ebuild name:

app-emacs/outline-magic-0.9

Description

Outline mode extensions for Emacs

Added to portage

2026-01-23

package-build - 4.0.0
Ebuild name:

app-emacs/package-build-4.0.0

Description

Tools for assembling a package archive

Added to portage

2026-01-23

package-lint - 0.26
Ebuild name:

app-emacs/package-lint-0.26

Description

Linting library for Emacs Lisp package metadata

Added to portage

2026-01-23

reason - 3.17.3
Ebuild name:

dev-ml/reason-3.17.3

Description

Simple, fast & type safe language that leverages JavaScript and OCaml

Added to portage

2026-01-23

rpi-eeprom - 28.12_p1
Ebuild name:

dev-embedded/rpi-eeprom-28.12_p1

Description

Updater for Raspberry Pi 4/5 bootloader and the VL805 USB controll

Added to portage

2026-01-23

setuptools - 80.10.1
Ebuild name:

dev-python/setuptools-80.10.1

Description

Collection of extensions to Distutils

Added to portage

2026-01-23

tempel - 1.10
Ebuild name:

app-emacs/tempel-1.10

Description

Templates with in-buffer field editing for GNU Emacs

Added to portage

2026-01-23

vertico - 2.7
Ebuild name:

app-emacs/vertico-2.7

Description

Vertical interactive completion

Added to portage

2026-01-23

xxhash - 0.8.3-r2
Ebuild name:

dev-libs/xxhash-0.8.3-r2

Description

Extremely fast non-cryptographic hash algorithm

Added to portage

2026-01-23

2026-01-22
awscli - 1.44.22
Ebuild name:

app-admin/awscli-1.44.22

Description

Universal Command Line Environment for AWS

Added to portage

2026-01-22

boto3 - 1.42.32
Ebuild name:

dev-python/boto3-1.42.32

Description

The AWS SDK for Python

Added to portage

2026-01-22

botocore - 1.42.32
Ebuild name:

dev-python/botocore-1.42.32

Description

Low-level, data-driven core of boto 3

Added to portage

2026-01-22

cargo-nextest - 0.9.122
Ebuild name:

dev-util/cargo-nextest-0.9.122

Description

Next-generation test runner for Rust

Added to portage

2026-01-22

cargo-tarpaulin - 0.35.1
Ebuild name:

dev-util/cargo-tarpaulin-0.35.1

Description

Cargo-Tarpaulin is a tool to determine code coverage achieved via t

Added to portage

2026-01-22

cfn-lint - 1.43.4
Ebuild name:

dev-python/cfn-lint-1.43.4

Description

CloudFormation Linter

Added to portage

2026-01-22

cmocka - 2.0.2
Ebuild name:

dev-util/cmocka-2.0.2

Description

Unit testing framework for C

Added to portage

2026-01-22

dbeaver-bin - 25.3.3
Ebuild name:

dev-db/dbeaver-bin-25.3.3

Description

Free universal database tool (community edition)

Added to portage

2026-01-22

eggdrop - 1.10.1
Ebuild name:

net-irc/eggdrop-1.10.1

Description

An IRC bot extensible with C or TCL

Added to portage

2026-01-22

ensurepip-wheel - 0.46.2
Ebuild name:

dev-python/ensurepip-wheel-0.46.2

Description

Shared wheel wheel for use in pip tests

Added to portage

2026-01-22

gherkin-official - 38.0.0
Ebuild name:

dev-python/gherkin-official-38.0.0

Description

Gherkin parser/compiler for Python

Added to portage

2026-01-22

krita - 6.0.0_alpha_pre20260121
Ebuild name:

media-gfx/krita-6.0.0_alpha_pre20260121

Description

Free digital painting application. Digital Painting, Creati

Added to portage

2026-01-22

marknote - 1.4.0
Ebuild name:

app-text/marknote-1.4.0

Description

Markdown editor with a wide range of formating options for everyday notes

Added to portage

2026-01-22

mongodb-compass-bin - 1.49.0
Ebuild name:

dev-db/mongodb-compass-bin-1.49.0

Description

GUI for MongoDB

Added to portage

2026-01-22

oath-toolkit - 2.6.13
Ebuild name:

sys-auth/oath-toolkit-2.6.13

Description

Toolkit for using one-time password authentication with HOTP/TOTP algo

Added to portage

2026-01-22

openpgp-keys-libseccomp - 20260122
Ebuild name:

sec-keys/openpgp-keys-libseccomp-20260122

Description

OpenPGP key used for sys-libs/libseccomp

Added to portage

2026-01-22

openpgp-keys-oath-toolkit - 20260122
Ebuild name:

sec-keys/openpgp-keys-oath-toolkit-20260122

Description

OpenPGP keys used for sys-auth/oath-toolkit

Added to portage

2026-01-22

packaging - 26.0
Ebuild name:

dev-python/packaging-26.0

Description

Core utilities for Python packages

Added to portage

2026-01-22

pandoc-mode - 2.35
Ebuild name:

app-emacs/pandoc-mode-2.35

Description

GNU Emacs minor mode for interacting with Pandoc

Added to portage

2026-01-22

pandoc-mode - 2.90.2
Ebuild name:

app-emacs/pandoc-mode-2.90.2

Description

GNU Emacs minor mode for interacting with Pandoc

Added to portage

2026-01-22

pass-otp - 1.2.0-r3
Ebuild name:

app-admin/pass-otp-1.2.0-r3

Description

A pass extension for managing one-time-password (OTP) tokens

Added to portage

2026-01-22

pcl - 1.14.1-r3
Ebuild name:

sci-libs/pcl-1.14.1-r3

Description

2D/3D image and point cloud processing

Added to portage

2026-01-22

pycparser - 3.0
Ebuild name:

dev-python/pycparser-3.0

Description

C parser and AST generator written in Python

Added to portage

2026-01-22

skrooge - 26.1.20
Ebuild name:

app-office/skrooge-26.1.20

Description

Personal finances manager, aiming at being simple and intuitive

Added to portage

2026-01-22

sqlalchemy - 2.0.46
Ebuild name:

dev-python/sqlalchemy-2.0.46

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-01-22

upterm - 0.22.0
Ebuild name:

app-misc/upterm-0.22.0

Description

Instant Terminal Sharing

Added to portage

2026-01-22

wheel - 0.46.2
Ebuild name:

dev-python/wheel-0.46.2

Description

A built-package format for Python

Added to portage

2026-01-22

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