from small one page howto to huge articles all in one place
 

search text in:







Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

3790

userrating:

no votes yet


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 (1 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back
comment this article
Please read "Why adblockers are bad".



to the forum.
:
:
other Ads
Stellenangebote
Stellenangebote
für Fach- und
Führungskräfte
www.nachoben.com
Trace My Cash
Wenn Sie sich schon immer mal gefragt haben, wo eigentlich Ihr geliebtes Bargeld geblieben ist, finden Sie hier vielleicht die Antwort.
www.tracemycash.com
Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
FeedCollector
Combine various newsfeeds to one customized webpage
www.feedcollector.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2008-11-21
bash - 3.2_p48
Ebuild name:

app-shells/bash-3.2_p48

Description

The standard GNU Bourne again shell

Added to portage

2008-11-21

busybox - 1.12.2-r1
Ebuild name:

sys-apps/busybox-1.12.2-r1

Description

Utilities for rescue and embedded systems

Added to portage

2008-11-21

checkrestart - 0.47
Ebuild name:

app-admin/checkrestart-0.47

Description

the sysadmin's rolling upgrade tool

Added to portage

2008-11-21

kazehakase - 0.5.6
Ebuild name:

www-client/kazehakase-0.5.6

Description

a browser with gecko engine like Epiphany or Galeon.

Added to portage

2008-11-21

kicker - 3.5.10-r1
Ebuild name:

kde-base/kicker-3.5.10-r1

Description

Kicker is the KDE application starter panel, also capable of some useful

Added to portage

2008-11-21

lightning - 0.9
Ebuild name:

x11-plugins/lightning-0.9

Description

Calendar extension for Mozilla Thunderbird.

Added to portage

2008-11-21

mozilla-thunderbird - 2.0.0.18
Ebuild name:

mail-client/mozilla-thunderbird-2.0.0.18

Description

Thunderbird Mail Client

Added to portage

2008-11-21

netbeans - 6.5
Ebuild name:

dev-util/netbeans-6.5

Description

NetBeans IDE for Java

Added to portage

2008-11-21

pkgcore-checks - 0.4.5
Ebuild name:

dev-util/pkgcore-checks-0.4.5

Description

pkgcore developmental repoman replacement

Added to portage

2008-11-21

w_scan - 20081106
Ebuild name:

media-tv/w_scan-20081106

Description

Scan for DVB-C/DVB-T channels without prior knowledge of frequencies and m

Added to portage

2008-11-21

xfce4-timer - 0.6.1
Ebuild name:

xfce-extra/xfce4-timer-0.6.1

Description

Timer panel plugin

Added to portage

2008-11-21

2008-11-20
Text-Markdown - 1.0.24
Ebuild name:

dev-perl/Text-Markdown-1.0.24

Description

Convert MultiMarkdown syntax to (X)HTML

Added to portage

2008-11-20

XML-SAX-Writer - 0.52
Ebuild name:

dev-perl/XML-SAX-Writer-0.52

Description

SAX2 Writer

Added to portage

2008-11-20

aria2 - 1.0.0
Ebuild name:

net-misc/aria2-1.0.0

Description

A download utility with resuming and segmented downloading with HTTP/HTTPS/FTP

Added to portage

2008-11-20

ati-drivers - 8.552-r2
Ebuild name:

x11-drivers/ati-drivers-8.552-r2

Description

Ati precompiled drivers for recent chipsets

Added to portage

2008-11-20

bind - 9.4.3
Ebuild name:

net-dns/bind-9.4.3

Description

BIND - Berkeley Internet Name Domain - Name Server

Added to portage

2008-11-20

bind-tools - 9.4.3
Ebuild name:

net-dns/bind-tools-9.4.3

Description

bind tools: dig, nslookup, host, nsupdate, dnssec-keygen

Added to portage

2008-11-20

conntrack-tools - 0.9.8-r1
Ebuild name:

net-firewall/conntrack-tools-0.9.8-r1

Description

Connection tracking userspace tools

Added to portage

2008-11-20

cutils - 1.6-r3
Ebuild name:

dev-util/cutils-1.6-r3

Description

C language utilities

Added to portage

2008-11-20

cyphesis - 0.5.17
Ebuild name:

games-server/cyphesis-0.5.17

Description

WorldForge server running small games

Added to portage

2008-11-20

evince - 2.24.1
Ebuild name:

app-text/evince-2.24.1

Description

Simple document viewer for GNOME

Added to portage

2008-11-20

galleryadd - 2.30
Ebuild name:

media-gfx/galleryadd-2.30

Description

Perl script to recursively adds directories/images to Gallery

Added to portage

2008-11-20

git-sources - 2.6.28_rc5-r4
Ebuild name:

sys-kernel/git-sources-2.6.28_rc5-r4

Description

The very latest -git version of the Linux kernel

Added to portage

2008-11-20

glabels - 2.2.3
Ebuild name:

app-office/glabels-2.2.3

Description

Program for creating labels and business cards

Added to portage

2008-11-20

glade-sharp - 9999
Ebuild name:

dev-dotnet/glade-sharp-9999

Description

Dummy ebuild to understand the package move to gtk-sharp[glade]

Added to portage

2008-11-20

gmime - 2.4.3
Ebuild name:

dev-libs/gmime-2.4.3

Description

Utilities for creating and parsing messages using MIME

Added to portage

2008-11-20

gnustep-base - 1.16.5
Ebuild name:

gnustep-base/gnustep-base-1.16.5

Description

A library of general-purpose, non-graphical Objective C objects.

Added to portage

2008-11-20

gtk-sharp - 2.12.6
Ebuild name:

dev-dotnet/gtk-sharp-2.12.6

Description

Gtk is a C language binding for the GTK2 toolkit and GNOME libraries

Added to portage

2008-11-20

gtkhtml - 3.24.1.1
Ebuild name:

gnome-extra/gtkhtml-3.24.1.1

Description

Lightweight HTML Rendering/Printing/Editing Engine

Added to portage

2008-11-20

kvm - 79
Ebuild name:

app-emulation/kvm-79

Description

Kernel-based Virtual Machine userland tools

Added to portage

2008-11-20

libgdiplus - 2.0
Ebuild name:

dev-dotnet/libgdiplus-2.0

Description

Library for using System.Drawing with mono

Added to portage

2008-11-20

libnotify - 0.4.5
Ebuild name:

x11-libs/libnotify-0.4.5

Description

Notifications library

Added to portage

2008-11-20

lilypond - 2.11.64
Ebuild name:

media-sound/lilypond-2.11.64

Description

GNU Music Typesetter

Added to portage

2008-11-20

lv2core - 3.0
Ebuild name:

media-libs/lv2core-3.0

Description

LV2 is a simple but extensible successor of LADSPA

Added to portage

2008-11-20

mono - 2.0.1
Ebuild name:

dev-lang/mono-2.0.1

Description

Mono runtime and class libraries, a C compiler/interpreter

Added to portage

2008-11-20

mono-basic - 2.0
Ebuild name:

dev-lang/mono-basic-2.0

Description

Visual Basic .NET Runtime and Class Libraries

Added to portage

2008-11-20

mono-debugger - 2.0
Ebuild name:

dev-util/mono-debugger-2.0

Description

Debugger for .NET managed and unmanaged applications

Added to portage

2008-11-20

mono-tools - 2.0
Ebuild name:

dev-util/mono-tools-2.0

Description

Set of useful Mono related utilities

Added to portage

2008-11-20

monodoc - 2.0
Ebuild name:

dev-util/monodoc-2.0

Description

Documentation for mono's .Net class library

Added to portage

2008-11-20

mozilla-thunderbird-bin - 2.0.0.18
Ebuild name:

mail-client/mozilla-thunderbird-bin-2.0.0.18

Description

Thunderbird Mail Client

Added to portage

2008-11-20

multitalk - 1.4
Ebuild name:

app-office/multitalk-1.4

Description

A new type of presentation program

Added to portage

2008-11-20

notification-daemon - 0.3.7-r1
Ebuild name:

x11-misc/notification-daemon-0.3.7-r1

Description

Notifications daemon

Added to portage

2008-11-20

quilt - 0.47-r1
Ebuild name:

dev-util/quilt-0.47-r1

Description

quilt patch manager

Added to portage

2008-11-20

quota - 3.16
Ebuild name:

sys-fs/quota-3.16

Description

Linux quota tools

Added to portage

2008-11-20

slv2 - 0.6.1
Ebuild name:

media-libs/slv2-0.6.1

Description

A library to make the use of LV2 plugins as simple as possible for applicatio

Added to portage

2008-11-20

sound-theme-freedesktop - 0.2
Ebuild name:

x11-themes/sound-theme-freedesktop-0.2

Description

Default freedesktop.org sound theme following the XDG themin

Added to portage

2008-11-20

ssh-askpass-fullscreen - 0.4-r1
Ebuild name:

net-misc/ssh-askpass-fullscreen-0.4-r1

Description

A small SSH Askpass replacement written with GTK2.

Added to portage

2008-11-20

sympy - 0.6.3
Ebuild name:

dev-python/sympy-0.6.3

Description

Computer algebra system (CAS) in Python

Added to portage

2008-11-20

texlive-core - 2008-r4
Ebuild name:

app-text/texlive-core-2008-r4

Description

A complete TeX distribution

Added to portage

2008-11-20

udev - 133
Ebuild name:

sys-fs/udev-133

Description

Linux dynamic and persistent device naming support (aka userspace devfs)

Added to portage

2008-11-20

wfmath - 0.3.8
Ebuild name:

dev-games/wfmath-0.3.8

Description

Worldforge math library

Added to portage

2008-11-20

xsp - 2.0
Ebuild name:

dev-dotnet/xsp-2.0

Description

XSP ASP.NET host

Added to portage

2008-11-20

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004 S&P Softwaredesign
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: 34.5 ms
system status display
Stellenangebote
Ärger mit Freenet.de