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:

87009

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-19
diffoscope - 325
Ebuild name:

dev-util/diffoscope-325

Description

Will try to get to the bottom of what makes files or directories different

Added to portage

2026-07-19

dist-kernel - 6.12.96
Ebuild name:

virtual/dist-kernel-6.12.96

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

dist-kernel - 6.18.39
Ebuild name:

virtual/dist-kernel-6.18.39

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

dist-kernel - 7.1.4
Ebuild name:

virtual/dist-kernel-7.1.4

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-07-19

gentoo-kernel - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-6.12.96

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-6.18.39

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-7.1.4

Description

Linux kernel built with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.96

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.39

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-bin - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.1.4

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-07-19

gentoo-kernel-modprep - 6.12.96
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.96

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-07-19

gentoo-kernel-modprep - 6.18.39
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.39

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-07-19

gentoo-kernel-modprep - 7.1.4
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.1.4

Description

Minimal subset of gentoo-kernel-bin for building modules, fo

Added to portage

2026-07-19

intellij-idea - 2026.2
Ebuild name:

dev-util/intellij-idea-2026.2

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-07-19

kdiff3 - 1.12.5
Ebuild name:

kde-misc/kdiff3-1.12.5

Description

Frontend to diff3 based on KDE Frameworks

Added to portage

2026-07-19

openrsync - 0.5.0_p20260706
Ebuild name:

net-misc/openrsync-0.5.0_p20260706

Description

BSD-licensed implementation of rsync

Added to portage

2026-07-19

service-manager - 3
Ebuild name:

virtual/service-manager-3

Description

Virtual for various service managers

Added to portage

2026-07-19

vanilla-kernel - 6.12.96
Ebuild name:

sys-kernel/vanilla-kernel-6.12.96

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

vanilla-kernel - 6.18.39
Ebuild name:

sys-kernel/vanilla-kernel-6.18.39

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

vanilla-kernel - 7.1.4
Ebuild name:

sys-kernel/vanilla-kernel-7.1.4

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-07-19

2026-07-18
Bytes-Random-Secure - 0.290.0-r1
Ebuild name:

dev-perl/Bytes-Random-Secure-0.290.0-r1

Description

Extension to generate cryptographically-secure random bytes

Added to portage

2026-07-18

Crypt-PBKDF2 - 0.261.630
Ebuild name:

dev-perl/Crypt-PBKDF2-0.261.630

Description

The PBKDF2 password hashing algorithm

Added to portage

2026-07-18

CryptX - 0.90.0
Ebuild name:

dev-perl/CryptX-0.90.0

Description

Self-contained crypto toolkit

Added to portage

2026-07-18

HTTP-Date - 6.80.0
Ebuild name:

dev-perl/HTTP-Date-6.80.0

Description

Date conversion for HTTP date formats

Added to portage

2026-07-18

Net-CIDR-Lite - 0.240.0
Ebuild name:

dev-perl/Net-CIDR-Lite-0.240.0

Description

Perl extension for merging IPv4 or IPv6 CIDR addresses

Added to portage

2026-07-18

Net-DNS - 1.560.0
Ebuild name:

dev-perl/Net-DNS-1.560.0

Description

Perl Interface to the Domain Name System

Added to portage

2026-07-18

String-Util - 1.360.0
Ebuild name:

dev-perl/String-Util-1.360.0

Description

String processing utility functions

Added to portage

2026-07-18

alsa-ucm-conf - 1.2.16.1
Ebuild name:

media-libs/alsa-ucm-conf-1.2.16.1

Description

ALSA ucm configuration files

Added to portage

2026-07-18

avrdude - 8.2
Ebuild name:

dev-embedded/avrdude-8.2

Description

AVR Downloader/UploaDEr

Added to portage

2026-07-18

awscli - 1.45.51
Ebuild name:

app-admin/awscli-1.45.51

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-18

boltons - 26.1.0
Ebuild name:

dev-python/boltons-26.1.0

Description

Pure-python utilities in the same spirit as the standard library

Added to portage

2026-07-18

boto3 - 1.43.51
Ebuild name:

dev-python/boto3-1.43.51

Description

The AWS SDK for Python

Added to portage

2026-07-18

botocore - 1.43.51
Ebuild name:

dev-python/botocore-1.43.51

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-18

ca-certificates - 20260601.3.112.5
Ebuild name:

app-misc/ca-certificates-20260601.3.112.5

Description

Common CA Certificates PEM files

Added to portage

2026-07-18

colorlog - 6.11.0
Ebuild name:

dev-python/colorlog-6.11.0

Description

Log formatting with colors

Added to portage

2026-07-18

deno-bin - 2.9.3
Ebuild name:

dev-lang/deno-bin-2.9.3

Description

Modern runtime for JavaScript and TypeScript

Added to portage

2026-07-18

dxvk - 3.0.2
Ebuild name:

app-emulation/dxvk-3.0.2

Description

Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine

Added to portage

2026-07-18

filelock - 3.30.3
Ebuild name:

dev-python/filelock-3.30.3

Description

A platform independent file lock for Python

Added to portage

2026-07-18

gentoo-sources - 6.12.96
Ebuild name:

sys-kernel/gentoo-sources-6.12.96

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-07-18

gentoo-sources - 6.18.39
Ebuild name:

sys-kernel/gentoo-sources-6.18.39

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-07-18

gentoo-sources - 7.1.4
Ebuild name:

sys-kernel/gentoo-sources-7.1.4

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-07-18

gpgme - 2.1.2
Ebuild name:

app-crypt/gpgme-2.1.2

Description

GnuPG Made Easy is a library for making GnuPG easier to use

Added to portage

2026-07-18

haveged - 1.9.26
Ebuild name:

sys-apps/haveged-1.9.26

Description

A simple entropy daemon using the HAVEGE algorithm

Added to portage

2026-07-18

installkernel - 70
Ebuild name:

sys-kernel/installkernel-70

Description

Gentoo fork of installkernel script from debianutils

Added to portage

2026-07-18

json-c - 0.19
Ebuild name:

dev-libs/json-c-0.19

Description

A JSON implementation in C

Added to portage

2026-07-18

json-c - 0.19-r2
Ebuild name:

dev-libs/json-c-0.19-r2

Description

A JSON implementation in C

Added to portage

2026-07-18

jupyter-builder - 1.1.1
Ebuild name:

dev-python/jupyter-builder-1.1.1

Description

JupyterLab build tools

Added to portage

2026-07-18

jupyter-server-proxy - 4.5.0
Ebuild name:

dev-python/jupyter-server-proxy-4.5.0

Description

Jupyter notebook server extension to proxy web services

Added to portage

2026-07-18

jupyterlab - 4.6.1
Ebuild name:

dev-python/jupyterlab-4.6.1

Description

JupyterLab computational environment

Added to portage

2026-07-18

jupyterlab-lsp - 5.3.0
Ebuild name:

dev-python/jupyterlab-lsp-5.3.0

Description

Coding assistance for JupyterLab with Language Server Protocol

Added to portage

2026-07-18

kitty - 0.48.0
Ebuild name:

x11-terms/kitty-0.48.0

Description

Fast, feature-rich, GPU-based terminal

Added to portage

2026-07-18

kitty-shell-integration - 0.48.0
Ebuild name:

x11-terms/kitty-shell-integration-0.48.0

Description

Shell integration scripts for kitty, a GPU-based terminal

Added to portage

2026-07-18

kitty-terminfo - 0.48.0
Ebuild name:

x11-terms/kitty-terminfo-0.48.0

Description

Terminfo for kitty, a GPU-based terminal emulator

Added to portage

2026-07-18

libintl-perl - 1.370.0
Ebuild name:

dev-perl/libintl-perl-1.370.0

Description

High-Level Interface to Uniforum Message Translation

Added to portage

2026-07-18

lsof - 4.99.7
Ebuild name:

sys-process/lsof-4.99.7

Description

Lists open files for running Unix processes

Added to portage

2026-07-18

mic-paren - 3.15-r1
Ebuild name:

app-emacs/mic-paren-3.15-r1

Description

Advanced highlighting of matching parentheses

Added to portage

2026-07-18

mitmproxy-linux - 0.12.10
Ebuild name:

net-proxy/mitmproxy-linux-0.12.10

Description

mitmproxy's Rust bits (Linux-specific part)

Added to portage

2026-07-18

mitmproxy-rs - 0.12.10
Ebuild name:

net-proxy/mitmproxy-rs-0.12.10

Description

mitmproxy's Rust bits

Added to portage

2026-07-18

mldonkey - 0.0.4b-r2
Ebuild name:

app-emacs/mldonkey-0.0.4b-r2

Description

An Emacs Lisp interface to the MLDonkey core

Added to portage

2026-07-18

mmm-mode - 0.5.11
Ebuild name:

app-emacs/mmm-mode-0.5.11

Description

Enables the user to edit different parts of a file in different major mod

Added to portage

2026-07-18

moccur-edit - 2.16
Ebuild name:

app-emacs/moccur-edit-2.16

Description

An improved interface to color-moccur for editing

Added to portage

2026-07-18

mocker - 0.5.0
Ebuild name:

app-emacs/mocker-0.5.0

Description

Simple mocking framework for Emacs

Added to portage

2026-07-18

modus-themes - 5.2.0
Ebuild name:

app-emacs/modus-themes-5.2.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-07-18

modus-themes - 5.3.0
Ebuild name:

app-emacs/modus-themes-5.3.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-07-18

ogre - 14.5.2
Ebuild name:

dev-games/ogre-14.5.2

Description

Object-oriented Graphics Rendering Engine

Added to portage

2026-07-18

peewee - 4.2.6
Ebuild name:

dev-python/peewee-4.2.6

Description

Small Python ORM

Added to portage

2026-07-18

python - 0.3.15.0_beta4
Ebuild name:

dev-lang/python-0.3.15.0_beta4

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2026-07-18

python - 3.15.0_beta4
Ebuild name:

dev-lang/python-3.15.0_beta4

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-07-18

python-tests - 0.3.15.0_beta4
Ebuild name:

dev-python/python-tests-0.3.15.0_beta4

Description

Test modules from dev-lang/python

Added to portage

2026-07-18

python-tests - 3.15.0_beta4
Ebuild name:

dev-python/python-tests-3.15.0_beta4

Description

Test modules from dev-lang/python

Added to portage

2026-07-18

pythontex - 0.19
Ebuild name:

dev-tex/pythontex-0.19

Description

Fast Access to Python from within LaTeX

Added to portage

2026-07-18

qlog - 0.51.1
Ebuild name:

media-radio/qlog-0.51.1

Description

Amateur radio logbook software

Added to portage

2026-07-18

qpwgraph - 1.0.2
Ebuild name:

media-sound/qpwgraph-1.0.2

Description

PipeWire Graph Qt GUI Interface

Added to portage

2026-07-18

rbpdf - 1.21.4-r1
Ebuild name:

dev-ruby/rbpdf-1.21.4-r1

Description

Ruby on Rails RBPDF plugin

Added to portage

2026-07-18

tomlkit - 0.15.1
Ebuild name:

dev-python/tomlkit-0.15.1

Description

Style preserving TOML library

Added to portage

2026-07-18

tortoisehg - 7.2.2
Ebuild name:

dev-vcs/tortoisehg-7.2.2

Description

Set of graphical tools for Mercurial

Added to portage

2026-07-18

tox - 4.57.0
Ebuild name:

dev-python/tox-4.57.0

Description

virtualenv-based automation of test activities

Added to portage

2026-07-18

tqdm - 4.69.0
Ebuild name:

dev-python/tqdm-4.69.0

Description

Add a progress meter to your loops in a second

Added to portage

2026-07-18

tree-sitter-phpdoc - 0.1.8
Ebuild name:

dev-libs/tree-sitter-phpdoc-0.1.8

Description

PHPDoc grammar for Tree-sitter

Added to portage

2026-07-18

ut2004-bonuspack-cbp1 - 1-r4
Ebuild name:

games-fps/ut2004-bonuspack-cbp1-1-r4

Description

UT2003 Community Bonus Pack for UT2004 Volume 1

Added to portage

2026-07-18

ut2004-bonuspack-cbp2 - 1-r4
Ebuild name:

games-fps/ut2004-bonuspack-cbp2-1-r4

Description

UT2004 Community Bonus Pack 2 Volume 1 and 2

Added to portage

2026-07-18

ut2004-bonuspack-ece - 1-r5
Ebuild name:

games-fps/ut2004-bonuspack-ece-1-r5

Description

UT2004 Editor's Choice Edition - Editor's Choice Edition bonus

Added to portage

2026-07-18

ut2004-bonuspack-mega - 1-r4
Ebuild name:

games-fps/ut2004-bonuspack-mega-1-r4

Description

UT2004 Megapack - Megapack bonus pack

Added to portage

2026-07-18

vanilla-sources - 6.12.96
Ebuild name:

sys-kernel/vanilla-sources-6.12.96

Description

Full sources for the Linux kernel

Added to portage

2026-07-18

vanilla-sources - 6.18.39
Ebuild name:

sys-kernel/vanilla-sources-6.18.39

Description

Full sources for the Linux kernel

Added to portage

2026-07-18

vanilla-sources - 7.1.4
Ebuild name:

sys-kernel/vanilla-sources-7.1.4

Description

Full sources for the Linux kernel

Added to portage

2026-07-18

virt-firmware - 26.7.1
Ebuild name:

app-emulation/virt-firmware-26.7.1

Description

Tools for ovmf/armvirt firmware volumes

Added to portage

2026-07-18

volk - 3.3.0
Ebuild name:

sci-libs/volk-3.3.0

Description

vector optimized library of kernels

Added to portage

2026-07-18

vpl-gpu-rt - 26.2.4
Ebuild name:

media-libs/vpl-gpu-rt-26.2.4

Description

Intel Video Processing Library GPU Runtime

Added to portage

2026-07-18

websockets - 16.1.1
Ebuild name:

dev-python/websockets-16.1.1

Description

Library for building WebSocket servers and clients in Python

Added to portage

2026-07-18

weston - 16.0.0
Ebuild name:

dev-libs/weston-16.0.0

Description

Wayland reference compositor

Added to portage

2026-07-18

whenever - 0.10.3
Ebuild name:

dev-python/whenever-0.10.3

Description

Modern datetime library for Python

Added to portage

2026-07-18

wireless-regdb - 20260530
Ebuild name:

net-wireless/wireless-regdb-20260530

Description

Wireless Regulatory database for Linux

Added to portage

2026-07-18

wordpress - 7.0.2
Ebuild name:

www-apps/wordpress-7.0.2

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-07-18

xrdb - 1.2.3-r2
Ebuild name:

x11-apps/xrdb-1.2.3-r2

Description

X server resource database utility

Added to portage

2026-07-18

z3 - 5.0.0
Ebuild name:

sci-mathematics/z3-5.0.0

Description

An efficient theorem prover

Added to portage

2026-07-18

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