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:

61804

userrating:

average rating: 1.5 (4 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.0 (2 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
2022-08-20
cfn-lint - 0.62.0
Ebuild name:

dev-python/cfn-lint-0.62.0

Description

CloudFormation Linter

Added to portage

2022-08-20

f - 0.20.0-r1
Ebuild name:

app-emacs/f-0.20.0-r1

Description

Modern API for working with files and directories in Emacs

Added to portage

2022-08-20

gawk - 5.1.65
Ebuild name:

sys-apps/gawk-5.1.65

Description

GNU awk pattern-matching language

Added to portage

2022-08-20

glibc - 2.33-r14
Ebuild name:

sys-libs/glibc-2.33-r14

Description

GNU libc C library

Added to portage

2022-08-20

glibc - 2.34-r14
Ebuild name:

sys-libs/glibc-2.34-r14

Description

GNU libc C library

Added to portage

2022-08-20

gsd - 2.6.0
Ebuild name:

dev-python/gsd-2.6.0

Description

GSD - file format specification and a library to read and write it

Added to portage

2022-08-20

jupyter_kernel_test - 0.4.4
Ebuild name:

dev-python/jupyter_kernel_test-0.4.4

Description

Jupyter kernel for octave

Added to portage

2022-08-20

microsoft-edge - 104.0.1293.63
Ebuild name:

www-client/microsoft-edge-104.0.1293.63

Description

The web browser from Microsoft

Added to portage

2022-08-20

microsoft-edge-beta - 105.0.1343.10
Ebuild name:

www-client/microsoft-edge-beta-105.0.1343.10

Description

The web browser from Microsoft

Added to portage

2022-08-20

mold - 1.4.1
Ebuild name:

sys-devel/mold-1.4.1

Description

A Modern Linker

Added to portage

2022-08-20

networkmanager-l2tp - 1.20.4-r1
Ebuild name:

net-vpn/networkmanager-l2tp-1.20.4-r1

Description

NetworkManager L2TP plugin

Added to portage

2022-08-20

networkmanager-l2tp - 1.8.8
Ebuild name:

net-vpn/networkmanager-l2tp-1.8.8

Description

NetworkManager L2TP plugin

Added to portage

2022-08-20

nextcloud - 23.0.8
Ebuild name:

www-apps/nextcloud-23.0.8

Description

Personal cloud that runs on your own server

Added to portage

2022-08-20

nextcloud - 24.0.4
Ebuild name:

www-apps/nextcloud-24.0.4

Description

Personal cloud that runs on your own server

Added to portage

2022-08-20

openconnect - 9.01-r1
Ebuild name:

net-vpn/openconnect-9.01-r1

Description

Free client for Cisco AnyConnect SSL VPN software

Added to portage

2022-08-20

opentelemetry-cpp - 1.6.0
Ebuild name:

dev-cpp/opentelemetry-cpp-1.6.0

Description

The OpenTelemetry C++ Client

Added to portage

2022-08-20

opera - 90.0.4480.48
Ebuild name:

www-client/opera-90.0.4480.48

Description

A fast and secure web browser

Added to portage

2022-08-20

palo - 2.22
Ebuild name:

sys-boot/palo-2.22

Description

PALO PArisc Linux Loader

Added to portage

2022-08-20

phonenumbers - 8.12.54
Ebuild name:

dev-python/phonenumbers-8.12.54

Description

Python port of Google's libphonenumber

Added to portage

2022-08-20

sphinx-gallery - 0.11.1
Ebuild name:

dev-python/sphinx-gallery-0.11.1

Description

Sphinx extension to automatically generate an examples gallery

Added to portage

2022-08-20

streamlink - 4.3.0
Ebuild name:

net-misc/streamlink-4.3.0

Description

CLI for extracting streams from websites to a video player of your choice

Added to portage

2022-08-20

userspace-rcu - 0.13.2
Ebuild name:

dev-libs/userspace-rcu-0.13.2

Description

Userspace RCU (read-copy-update) library

Added to portage

2022-08-20

virt-manager - 4.1.0
Ebuild name:

app-emulation/virt-manager-4.1.0

Description

A graphical tool for administering virtual machines

Added to portage

2022-08-20

widgetsnbextension - 4.0.2
Ebuild name:

dev-python/widgetsnbextension-4.0.2

Description

IPython HTML widgets for Jupyter

Added to portage

2022-08-20

2022-08-19
Email-Address-XS - 1.50.0
Ebuild name:

dev-perl/Email-Address-XS-1.50.0

Description

Parse and format RFC 2822 email addresses and groups

Added to portage

2022-08-19

Email-MIME - 1.952.0
Ebuild name:

dev-perl/Email-MIME-1.952.0

Description

Easy MIME message parsing

Added to portage

2022-08-19

Email-Valid - 1.203.0
Ebuild name:

dev-perl/Email-Valid-1.203.0

Description

Check validity of Internet email addresses

Added to portage

2022-08-19

awscli - 1.25.54
Ebuild name:

app-admin/awscli-1.25.54

Description

Universal Command Line Environment for AWS

Added to portage

2022-08-19

awscli - 1.25.55
Ebuild name:

app-admin/awscli-1.25.55

Description

Universal Command Line Environment for AWS

Added to portage

2022-08-19

awscli-bin - 2.7.24
Ebuild name:

app-admin/awscli-bin-2.7.24

Description

command line interface for Amazon Web Services

Added to portage

2022-08-19

bgpq4 - 1.5
Ebuild name:

net-misc/bgpq4-1.5

Description

Generate access-lists for various routers, maintained fork of bgpq3

Added to portage

2022-08-19

boto3 - 1.24.54
Ebuild name:

dev-python/boto3-1.24.54

Description

The AWS SDK for Python

Added to portage

2022-08-19

boto3 - 1.24.55
Ebuild name:

dev-python/boto3-1.24.55

Description

The AWS SDK for Python

Added to portage

2022-08-19

botocore - 1.27.54
Ebuild name:

dev-python/botocore-1.27.54

Description

Low-level, data-driven core of boto 3

Added to portage

2022-08-19

botocore - 1.27.55
Ebuild name:

dev-python/botocore-1.27.55

Description

Low-level, data-driven core of boto 3

Added to portage

2022-08-19

chrome-binary-plugins - 106.0.5245.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-106.0.5245.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2022-08-19

citus - 10.2.7
Ebuild name:

dev-db/citus-10.2.7

Description

Open-source postgresql extension for clustering/multi-node setups

Added to portage

2022-08-19

citus - 11.0.6
Ebuild name:

dev-db/citus-11.0.6

Description

Open-source postgresql extension for clustering/multi-node setups

Added to portage

2022-08-19

cleo - 0.8.1-r1
Ebuild name:

dev-python/cleo-0.8.1-r1

Description

Python tool for building testable command-line interfaces

Added to portage

2022-08-19

clikit - 0.6.2-r1
Ebuild name:

dev-python/clikit-0.6.2-r1

Description

Group of utilities to build beautiful and testable command line interfac

Added to portage

2022-08-19

cpu-x - 4.3.1
Ebuild name:

sys-apps/cpu-x-4.3.1

Description

A Free software that gathers information on CPU, motherboard and more

Added to portage

2022-08-19

emacspeak - 56.0-r1
Ebuild name:

app-accessibility/emacspeak-56.0-r1

Description

The emacspeak audio desktop

Added to portage

2022-08-19

ensurepip-setuptools - 65.1.0
Ebuild name:

dev-python/ensurepip-setuptools-65.1.0

Description

Shared setuptools wheel for ensurepip Python module

Added to portage

2022-08-19

exo - 1.59.0
Ebuild name:

app-admin/exo-1.59.0

Description

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

Added to portage

2022-08-19

fennel-mode - 0.4.1-r1
Ebuild name:

app-emacs/fennel-mode-0.4.1-r1

Description

Emacs support for the Fennel programming language

Added to portage

2022-08-19

fennel-mode - 0.5.0
Ebuild name:

app-emacs/fennel-mode-0.5.0

Description

Emacs support for the Fennel programming language

Added to portage

2022-08-19

fff - 20050517
Ebuild name:

app-emacs/fff-20050517

Description

Fast file finder for Emacs

Added to portage

2022-08-19

fff - 20050517
Ebuild name:

app-emacs/fff-20050517

Description

Fast file finder for Emacs

Added to portage

2022-08-19

gamescope - 3.11.36
Ebuild name:

gui-wm/gamescope-3.11.36

Description

Efficient micro-compositor for running games

Added to portage

2022-08-19

gcc - 12.2.0
Ebuild name:

sys-devel/gcc-12.2.0

Description

The GNU Compiler Collection

Added to portage

2022-08-19

gcc - 12.3.9999
Ebuild name:

sys-devel/gcc-12.3.9999

Description

The GNU Compiler Collection

Added to portage

2022-08-19

gentoo-sources - 5.19.2-r1
Ebuild name:

sys-kernel/gentoo-sources-5.19.2-r1

Description

Full sources including the Gentoo patchset for the . kernel tre

Added to portage

2022-08-19

git - 1.12.0
Ebuild name:

dev-ruby/git-1.12.0

Description

Library for using Git in Ruby

Added to portage

2022-08-19

glusterfs - 10.2-r2
Ebuild name:

sys-cluster/glusterfs-10.2-r2

Description

GlusterFS is a powerful network/cluster filesystem

Added to portage

2022-08-19

google-chrome-unstable - 106.0.5245.0
Ebuild name:

www-client/google-chrome-unstable-106.0.5245.0

Description

The web browser from Google

Added to portage

2022-08-19

gr-iqbal - 0.38.2_p20210108
Ebuild name:

net-wireless/gr-iqbal-0.38.2_p20210108

Description

gnuradio I/Q balancing

Added to portage

2022-08-19

gr-osmosdr - 0.2.3_p20210128
Ebuild name:

net-wireless/gr-osmosdr-0.2.3_p20210128

Description

GNU Radio source block for OsmoSDR and rtlsdr and hackrf

Added to portage

2022-08-19

hatch-fancy-pypi-readme - 22.3.0
Ebuild name:

dev-python/hatch-fancy-pypi-readme-22.3.0

Description

Fancy PyPI READMEs with Hatch

Added to portage

2022-08-19

hcloud - 1.30.3
Ebuild name:

app-admin/hcloud-1.30.3

Description

A command-line interface for Hetzner Cloud

Added to portage

2022-08-19

idea-community - 2022.2.1.222.3739.54
Ebuild name:

dev-util/idea-community-2022.2.1.222.3739.54

Description

A complete toolset for web, mobile and enterprise deve

Added to portage

2022-08-19

iotop-c - 1.22
Ebuild name:

sys-process/iotop-c-1.22

Description

top utility for IO (C port)

Added to portage

2022-08-19

ipywidgets - 8.0.1
Ebuild name:

dev-python/ipywidgets-8.0.1

Description

IPython HTML widgets for Jupyter

Added to portage

2022-08-19

iwdevtools - 0.11.7
Ebuild name:

app-portage/iwdevtools-0.11.7

Description

Small tools to aid with Gentoo development, primarily intended for QA

Added to portage

2022-08-19

jsonschema - 4.12.1
Ebuild name:

dev-python/jsonschema-4.12.1

Description

An implementation of JSON-Schema validation for Python

Added to portage

2022-08-19

jsonschema - 4.13.0
Ebuild name:

dev-python/jsonschema-4.13.0

Description

An implementation of JSON-Schema validation for Python

Added to portage

2022-08-19

libcpuid - 0.5.1
Ebuild name:

dev-libs/libcpuid-0.5.1

Description

A small C library for x86 (and x86_64) CPU detection and feature extraction

Added to portage

2022-08-19

libewf - 20171104-r2
Ebuild name:

app-forensics/libewf-20171104-r2

Description

Implementation of the EWF (SMART and EnCase) image format

Added to portage

2022-08-19

libiio - 0.24
Ebuild name:

net-libs/libiio-0.24

Description

Library for interfacing with IIO devices

Added to portage

2022-08-19

libliftoff - 0.3.0
Ebuild name:

dev-libs/libliftoff-0.3.0

Description

Lightweight KMS plane library

Added to portage

2022-08-19

libtracefs - 1.4.2
Ebuild name:

dev-libs/libtracefs-1.4.2

Description

Linux kernel trace file system library

Added to portage

2022-08-19

liquidprompt - 2.1.2
Ebuild name:

app-shells/liquidprompt-2.1.2

Description

Full-featured & carefully designed adaptive prompt for Bash & Zsh

Added to portage

2022-08-19

lldpd - 1.0.15-r1
Ebuild name:

net-misc/lldpd-1.0.15-r1

Description

Implementation of IEEE 802.1ab (LLDP)

Added to portage

2022-08-19

matplotlib-inline - 0.1.6
Ebuild name:

dev-python/matplotlib-inline-0.1.6

Description

Inline Matplotlib backend for Jupyter

Added to portage

2022-08-19

meson - 0.63.1
Ebuild name:

dev-util/meson-0.63.1

Description

Open source build system

Added to portage

2022-08-19

mosquitto - 2.0.15
Ebuild name:

app-misc/mosquitto-2.0.15

Description

An Open Source MQTT v3 Broker

Added to portage

2022-08-19

mpd - 0.23.9
Ebuild name:

media-sound/mpd-0.23.9

Description

The Music Player Daemon (mpd)

Added to portage

2022-08-19

nss - 3.82
Ebuild name:

dev-libs/nss-3.82

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2022-08-19

pandoc-bin - 2.19.1
Ebuild name:

app-text/pandoc-bin-2.19.1

Description

Conversion between markup formats (binary package)

Added to portage

2022-08-19

paste - 3.5.2
Ebuild name:

dev-python/paste-3.5.2

Description

Tools for using a Web Server Gateway Interface stack

Added to portage

2022-08-19

pastel - 0.2.1-r1
Ebuild name:

dev-python/pastel-0.2.1-r1

Description

Bring colors to your terminal

Added to portage

2022-08-19

pgbouncer - 1.17.0
Ebuild name:

dev-db/pgbouncer-1.17.0

Description

Lightweight connection pooler for PostgreSQL

Added to portage

2022-08-19

postgis - 3.0.7
Ebuild name:

dev-db/postgis-3.0.7

Description

Geographic Objects for PostgreSQL

Added to portage

2022-08-19

postgis - 3.1.7
Ebuild name:

dev-db/postgis-3.1.7

Description

Geographic Objects for PostgreSQL

Added to portage

2022-08-19

postgis - 3.2.3
Ebuild name:

dev-db/postgis-3.2.3

Description

Geographic Objects for PostgreSQL

Added to portage

2022-08-19

pylev - 1.4.0-r1
Ebuild name:

dev-python/pylev-1.4.0-r1

Description

Python Levenshtein implementation

Added to portage

2022-08-19

pyspnego - 0.6.0
Ebuild name:

dev-python/pyspnego-0.6.0

Description

Library to handle SPNEGO and CredSSP authentication

Added to portage

2022-08-19

python-openstackclient - 6.0.0
Ebuild name:

dev-python/python-openstackclient-6.0.0

Description

A client for the OpenStack APIs

Added to portage

2022-08-19

pyupgrade - 2.37.3
Ebuild name:

dev-python/pyupgrade-2.37.3

Description

Tool + pre-commit hook to automatically upgrade syntax for newer Python

Added to portage

2022-08-19

regex - 2022.8.17
Ebuild name:

dev-python/regex-2022.8.17

Description

Alternative regular expression module to replace re

Added to portage

2022-08-19

setuptools - 65.1.0
Ebuild name:

dev-python/setuptools-65.1.0

Description

Collection of extensions to Distutils

Added to portage

2022-08-19

shadow - 4.12.2
Ebuild name:

sys-apps/shadow-4.12.2

Description

Utilities to deal with user accounts

Added to portage

2022-08-19

spacemacs-theme - 0.3
Ebuild name:

app-emacs/spacemacs-theme-0.3

Description

Emacs color theme that started as a theme for Spacemacs

Added to portage

2022-08-19

spidermonkey - 102.1.0-r1
Ebuild name:

dev-lang/spidermonkey-102.1.0-r1

Description

SpiderMonkey is Mozilla's JavaScript engine written in C and C++

Added to portage

2022-08-19

timescaledb - 2.7.2
Ebuild name:

dev-db/timescaledb-2.7.2

Description

Open-source time-series SQL database

Added to portage

2022-08-19

tokenize-rt - 4.2.1
Ebuild name:

dev-python/tokenize-rt-4.2.1

Description

A wrapper around the stdlib 'tokenize' which roundtrips

Added to portage

2022-08-19

toybox - 0.8.8
Ebuild name:

sys-apps/toybox-0.8.8

Description

Common linux commands in a multicall binary

Added to portage

2022-08-19

uglifyjs - 3.17.0
Ebuild name:

dev-util/uglifyjs-3.17.0

Description

JavaScript parser, minifier, compressor and beautifier toolkit

Added to portage

2022-08-19

vivaldi - 5.4.2753.37
Ebuild name:

www-client/vivaldi-5.4.2753.37

Description

A browser for our friends

Added to portage

2022-08-19

yt-dlp - 2022.8.19
Ebuild name:

net-misc/yt-dlp-2022.8.19

Description

youtube-dl fork with additional features and fixes

Added to portage

2022-08-19

z3 - 4.11.0
Ebuild name:

sci-mathematics/z3-4.11.0

Description

An efficient theorem prover

Added to portage

2022-08-19

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 66.8 ms