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:

87262

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-29
annotated-doc - 0.0.5
Ebuild name:

dev-python/annotated-doc-0.0.5

Description

Document parameters, variables inline, with Annotated

Added to portage

2026-07-29

awkward - 2.12.0
Ebuild name:

dev-python/awkward-2.12.0

Description

Manipulate JSON-like data with NumPy-like idioms

Added to portage

2026-07-29

awkward-cpp - 55
Ebuild name:

dev-python/awkward-cpp-55

Description

CPU kernels and compiled extensions for Awkward Array

Added to portage

2026-07-29

awscli - 1.45.58
Ebuild name:

app-admin/awscli-1.45.58

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-29

borgbackup - 1.4.5
Ebuild name:

app-backup/borgbackup-1.4.5

Description

Deduplicating backup program with compression and authenticated encrypt

Added to portage

2026-07-29

boto3 - 1.43.58
Ebuild name:

dev-python/boto3-1.43.58

Description

The AWS SDK for Python

Added to portage

2026-07-29

botocore - 1.43.58
Ebuild name:

dev-python/botocore-1.43.58

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-29

cfn-lint - 1.53.3
Ebuild name:

dev-python/cfn-lint-1.53.3

Description

CloudFormation Linter

Added to portage

2026-07-29

clang - 23.1.0_rc2
Ebuild name:

dev-python/clang-23.1.0_rc2

Description

Python bindings for llvm-core/clang

Added to portage

2026-07-29

clang - 23.1.0_rc2
Ebuild name:

llvm-core/clang-23.1.0_rc2

Description

C language family frontend for LLVM

Added to portage

2026-07-29

clang-common - 23.1.0_rc2
Ebuild name:

llvm-core/clang-common-23.1.0_rc2

Description

Common files shared between multiple slots of clang

Added to portage

2026-07-29

compiler-rt - 23.1.0_rc2
Ebuild name:

llvm-runtimes/compiler-rt-23.1.0_rc2

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-07-29

compiler-rt-sanitizers - 23.1.0_rc2
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.1.0_rc2

Description

Compiler runtime libraries for clang (sanitizers &a

Added to portage

2026-07-29

fastapi - 0.140.13
Ebuild name:

dev-python/fastapi-0.140.13

Description

High performance framework, easy to learn, fast to code, ready for prod

Added to portage

2026-07-29

flang - 23.1.0_rc2
Ebuild name:

llvm-core/flang-23.1.0_rc2

Description

LLVM's Fortran frontend

Added to portage

2026-07-29

flang-rt - 23.1.0_rc2
Ebuild name:

llvm-runtimes/flang-rt-23.1.0_rc2

Description

LLVM's Fortran runtime

Added to portage

2026-07-29

flatpak-builder - 1.4.10-r1
Ebuild name:

dev-util/flatpak-builder-1.4.10-r1

Description

Tool to build flatpaks from source

Added to portage

2026-07-29

fsspec - 2026.7.0
Ebuild name:

dev-python/fsspec-2026.7.0

Description

A specification that python filesystems should adhere to

Added to portage

2026-07-29

hypothesis - 6.163.0
Ebuild name:

dev-python/hypothesis-6.163.0

Description

A library for property based testing

Added to portage

2026-07-29

jansson - 2.15.1
Ebuild name:

dev-libs/jansson-2.15.1

Description

C library for encoding, decoding and manipulating JSON data

Added to portage

2026-07-29

kirigami-app-components - 1.0.2
Ebuild name:

dev-libs/kirigami-app-components-1.0.2

Description

Kirigami addons and modules necessary to do a full featured

Added to portage

2026-07-29

knot-resolver - 5.7.7-r1
Ebuild name:

net-dns/knot-resolver-5.7.7-r1

Description

A scaleable caching DNS resolver

Added to portage

2026-07-29

knot-resolver - 6.4.1-r1
Ebuild name:

net-dns/knot-resolver-6.4.1-r1

Description

Scaleable caching DNS resolver

Added to portage

2026-07-29

libarchive - 3.8.9
Ebuild name:

app-arch/libarchive-3.8.9

Description

Multi-format archive and compression library

Added to portage

2026-07-29

libclc - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libclc-23.1.0_rc2

Description

OpenCL C library

Added to portage

2026-07-29

libcxx - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libcxx-23.1.0_rc2

Description

New implementation of the C++ standard library, targeting C++11

Added to portage

2026-07-29

libcxxabi - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libcxxabi-23.1.0_rc2

Description

Low level support for a standard C++ library

Added to portage

2026-07-29

libgcc - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libgcc-23.1.0_rc2

Description

Compiler runtime library for clang, compatible with libgcc_s

Added to portage

2026-07-29

libunwind - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libunwind-23.1.0_rc2

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-07-29

lit - 23.1.0_rc2
Ebuild name:

dev-python/lit-23.1.0_rc2

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-07-29

lld - 23.1.0_rc2
Ebuild name:

llvm-core/lld-23.1.0_rc2

Description

The LLVM linker (link editor)

Added to portage

2026-07-29

lldb - 23.1.0_rc2
Ebuild name:

llvm-core/lldb-23.1.0_rc2

Description

The LLVM debugger

Added to portage

2026-07-29

llvm - 23.1.0_rc2
Ebuild name:

dev-ml/llvm-23.1.0_rc2

Description

OCaml bindings for LLVM

Added to portage

2026-07-29

llvm - 23.1.0_rc2
Ebuild name:

llvm-core/llvm-23.1.0_rc2

Description

Low Level Virtual Machine

Added to portage

2026-07-29

llvm-common - 23.1.0_rc2
Ebuild name:

llvm-core/llvm-common-23.1.0_rc2

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-07-29

matlab - 9999
Ebuild name:

app-emacs/matlab-9999

Description

Major modes for MATLAB .m and .tlc files

Added to portage

2026-07-29

mediawiki - 2.3.1
Ebuild name:

app-emacs/mediawiki-2.3.1

Description

MediaWiki client for Emacs

Added to portage

2026-07-29

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-07-29

mlir - 23.1.0_rc2
Ebuild name:

llvm-core/mlir-23.1.0_rc2

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-07-29

openmp - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-23.1.0_rc2

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-07-29

openmp-amdgcn-amd-amdhsa - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.1.0_rc2

Description

OpenMP target library for amdgcn devices

Added to portage

2026-07-29

openmp-nvptx64-nvidia-cuda - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.1.0_rc2

Description

OpenMP target library for nvptx64 devices

Added to portage

2026-07-29

openmp-spirv64-intel - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.1.0_rc2

Description

OpenMP target library for spirv64 Intel devices

Added to portage

2026-07-29

openpgp-keys-unrealircd - 20241118
Ebuild name:

sec-keys/openpgp-keys-unrealircd-20241118

Description

OpenPGP keys used to sign UnrealIRCd releases

Added to portage

2026-07-29

pbs-installer - 2026.7.28
Ebuild name:

dev-python/pbs-installer-2026.7.28

Description

Installer for Python Build Standalone

Added to portage

2026-07-29

polly - 23.1.0_rc2
Ebuild name:

llvm-core/polly-23.1.0_rc2

Description

Polyhedral optimizations for LLVM

Added to portage

2026-07-29

pypi-attestations - 0.0.30
Ebuild name:

dev-python/pypi-attestations-0.0.30

Description

Convert between Sigstore Bundles and PEP-740 Attestation object

Added to portage

2026-07-29

pyzotero - 1.13.3
Ebuild name:

dev-python/pyzotero-1.13.3

Description

A Python client for the Zotero API

Added to portage

2026-07-29

unrealircd - 6.2.6
Ebuild name:

net-irc/unrealircd-6.2.6

Description

An advanced Internet Relay Chat daemon

Added to portage

2026-07-29

yara - 4.5.8
Ebuild name:

app-forensics/yara-4.5.8

Description

A malware identification and classification tool

Added to portage

2026-07-29

2026-07-28
accountsservice - 23.13.9-r1
Ebuild name:

sys-apps/accountsservice-23.13.9-r1

Description

D-Bus interfaces for querying and manipulating user account inf

Added to portage

2026-07-28

accountsservice - 26.27.3
Ebuild name:

sys-apps/accountsservice-26.27.3

Description

D-Bus interfaces for querying and manipulating user account inform

Added to portage

2026-07-28

awscli - 1.45.57
Ebuild name:

app-admin/awscli-1.45.57

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-28

boto3 - 1.43.57
Ebuild name:

dev-python/boto3-1.43.57

Description

The AWS SDK for Python

Added to portage

2026-07-28

botocore - 1.43.57
Ebuild name:

dev-python/botocore-1.43.57

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-28

brotli - 0.8.0-r1
Ebuild name:

dev-ruby/brotli-0.8.0-r1

Description

Brotli compressor/decompressor

Added to portage

2026-07-28

c-blosc2 - 3.3.0
Ebuild name:

dev-libs/c-blosc2-3.3.0

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-07-28

cachebox - 6.2.1
Ebuild name:

dev-python/cachebox-6.2.1

Description

The fastest memoizing and caching Python library written in Rust

Added to portage

2026-07-28

cssselect - 1.5.0
Ebuild name:

dev-python/cssselect-1.5.0

Description

Parse CSS3 Selectors and translate them to XPath 1.0

Added to portage

2026-07-28

deepdiff - 9.1.0
Ebuild name:

dev-python/deepdiff-9.1.0

Description

A library for comparing dictionaries, iterables, strings and other object

Added to portage

2026-07-28

fastapi - 0.140.7
Ebuild name:

dev-python/fastapi-0.140.7

Description

High performance framework, easy to learn, fast to code, ready for produ

Added to portage

2026-07-28

fastbencode - 0.3.11
Ebuild name:

dev-python/fastbencode-0.3.11

Description

Implementation of bencode with Rust implementation

Added to portage

2026-07-28

fastjsonschema - 2.22.1
Ebuild name:

dev-python/fastjsonschema-2.22.1

Description

Fast JSON schema validator for Python

Added to portage

2026-07-28

gdm - 49.3-r2
Ebuild name:

gnome-base/gdm-49.3-r2

Description

GNOME Display Manager for managing graphical display servers and user logins

Added to portage

2026-07-28

gnome-control-center - 49.8-r1
Ebuild name:

gnome-base/gnome-control-center-49.8-r1

Description

GNOME's main interface to configure various aspects of the

Added to portage

2026-07-28

gnome-flashback-herbstluftwm - 1.0
Ebuild name:

x11-wm/gnome-flashback-herbstluftwm-1.0

Description

GNOME Herbstluftwm session (via GNOME Flashback)

Added to portage

2026-07-28

gnome-shell-extension-appindicator - 65
Ebuild name:

gnome-extra/gnome-shell-extension-appindicator-65

Description

Support legacy, AppIndicators and KStatusNotifier

Added to portage

2026-07-28

guile - 3.0.11-r1
Ebuild name:

dev-scheme/guile-3.0.11-r1

Description

GNU Ubiquitous Intelligent Language for Extensions

Added to portage

2026-07-28

hypothesis - 6.161.8
Ebuild name:

dev-python/hypothesis-6.161.8

Description

A library for property based testing

Added to portage

2026-07-28

inline-snapshot - 0.35.3
Ebuild name:

dev-python/inline-snapshot-0.35.3

Description

Create and update inline snapshots in your Python tests

Added to portage

2026-07-28

krita - 6.0.3
Ebuild name:

media-gfx/krita-6.0.3

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-07-28

libwebsockets - 5.0.0-r1
Ebuild name:

net-libs/libwebsockets-5.0.0-r1

Description

A flexible pure-C library for implementing network protocols

Added to portage

2026-07-28

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-07-28

psych - 5.4.0
Ebuild name:

dev-ruby/psych-5.4.0

Description

A YAML parser and emitter

Added to portage

2026-07-28

pyproject-fmt - 2.26.0
Ebuild name:

dev-python/pyproject-fmt-2.26.0

Description

Format your pyproject.toml file

Added to portage

2026-07-28

pyquery - 2.0.2
Ebuild name:

dev-python/pyquery-2.0.2

Description

A jQuery-like library for python

Added to portage

2026-07-28

pyquery - 2.1.0
Ebuild name:

dev-python/pyquery-2.1.0

Description

A jQuery-like library for python

Added to portage

2026-07-28

python-lsp-server - 1.15.0
Ebuild name:

dev-python/python-lsp-server-1.15.0

Description

Python Language Server for the Language Server Protocol

Added to portage

2026-07-28

ruff - 0.16.0
Ebuild name:

dev-util/ruff-0.16.0

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-07-28

samba - 4.23.10
Ebuild name:

net-fs/samba-4.23.10

Description

Samba Suite Version 4

Added to portage

2026-07-28

samba - 4.24.5
Ebuild name:

net-fs/samba-4.24.5

Description

Samba Suite Version 4

Added to portage

2026-07-28

sqlglot - 30.14.0
Ebuild name:

dev-python/sqlglot-30.14.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-07-28

tailscale - 1.102.0
Ebuild name:

net-vpn/tailscale-1.102.0

Description

Tailscale vpn client

Added to portage

2026-07-28

tekore - 6.2.0
Ebuild name:

dev-python/tekore-6.2.0

Description

Spotify Web API client

Added to portage

2026-07-28

tqdm - 4.70.0
Ebuild name:

dev-python/tqdm-4.70.0

Description

Add a progress meter to your loops in a second

Added to portage

2026-07-28

ttyd - 1.7.7-r2
Ebuild name:

www-apps/ttyd-1.7.7-r2

Description

ttyd, a simple command-line tool for sharing terminal over the web

Added to portage

2026-07-28

twine - 7.0.0
Ebuild name:

dev-python/twine-7.0.0

Description

Collection of utilities for publishing packages on PyPI

Added to portage

2026-07-28

zoom - 7.0.0.1666-r2
Ebuild name:

net-im/zoom-7.0.0.1666-r2

Description

Video conferencing and web conferencing service

Added to portage

2026-07-28

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