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:

87236

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

4. Startup File


Having explored vi commands somewhat, we are now ready to create
a default editing environment through the use of .exrc,
the configuration file which resides in user's home directory.


.exrc typically contains at least three types of entries:



  1. set commands to create preferred editing environment
  2. map commands to assign functions or macros to keys
  3. ab commands to either map abbreviations or automatically
    correct common spelling errors

When mapping escape sequences of some keys, we may need to
quote them, that is, to insert them literally. This can
be accomplished in vi by issuing a text input command and pressing
Ctrl-V before the key we wish to quote is pressed.


Now let's look at a sample .exrc:



set autoindent
set wrapmargin=8
set ignorecase
map #4 !}fmt^M
ab teh the
ab cutsomer customer

Lines 1 and 2 set autoindent mode on and turn on wordwrap at column
72. Line 3 specifies that all searches are to be case insensitive.
Line 4 maps function key 4 to reformat from the cursor position
to the end of the paragraph
. Finally, lines 5 and 6 map some
common misspellings to the correct spelling. Note that ^M
on lines 4 and 5 are created by pressing Ctrl-V and then
hitting Ctrl-M.


With a little creativity you can make vi look as personal as you wish.


NOTE: After creating .exrc make sure that EXINIT
environment variable is not set as it would overwrite whatever
settings you entered into .exrc. You can verify whether
the EXINIT variable is set using this command from the UNIX command
prompt:



$ set | grep EXINIT

If you see no output, you're fine.


Make sure that .exrc contains no blank lines - they
are not allowed.



/* 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 (63 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-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

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

2026-07-27
atari800 - 7.1.2
Ebuild name:

games-emulation/atari800-7.1.2

Description

Emulator of Atari 8-bit computer systems and 5200 game console

Added to portage

2026-07-27

backrefs - 8.0
Ebuild name:

dev-python/backrefs-8.0

Description

Wrapper around re or regex that adds additional back references

Added to portage

2026-07-27

cares-tools - 0.4
Ebuild name:

net-dns/cares-tools-0.4

Description

c-ares tools host, nslookup

Added to portage

2026-07-27

courier - 2.0.6
Ebuild name:

mail-mta/courier-2.0.6

Description

An MTA designed specifically for maildirs

Added to portage

2026-07-27

fastjsonschema - 2.22.0
Ebuild name:

dev-python/fastjsonschema-2.22.0

Description

Fast JSON schema validator for Python

Added to portage

2026-07-27

gamescope - 3.16.25-r1
Ebuild name:

gui-wm/gamescope-3.16.25-r1

Description

Efficient micro-compositor for running games

Added to portage

2026-07-27

gcc - 13.4.1_p20260722
Ebuild name:

sys-devel/gcc-13.4.1_p20260722

Description

The GNU Compiler Collection

Added to portage

2026-07-27

gcc - 14.4.1_p20260723
Ebuild name:

sys-devel/gcc-14.4.1_p20260723

Description

The GNU Compiler Collection

Added to portage

2026-07-27

gcc - 15.3.1_p20260724
Ebuild name:

sys-devel/gcc-15.3.1_p20260724

Description

The GNU Compiler Collection

Added to portage

2026-07-27

gcc - 16.1.1_p20260725
Ebuild name:

sys-devel/gcc-16.1.1_p20260725

Description

The GNU Compiler Collection

Added to portage

2026-07-27

gcc - 17.0.0_p20260726
Ebuild name:

sys-devel/gcc-17.0.0_p20260726

Description

The GNU Compiler Collection

Added to portage

2026-07-27

geekbench-ai - 1.7.0
Ebuild name:

app-benchmarks/geekbench-ai-1.7.0

Description

A Cross-Platform AI Benchmark for Android, iOS, Linux, MacOS and

Added to portage

2026-07-27

git-sources - 7.2_rc5
Ebuild name:

sys-kernel/git-sources-7.2_rc5

Description

The very latest -git version of the Linux kernel

Added to portage

2026-07-27

gitpython - 3.1.57
Ebuild name:

dev-python/gitpython-3.1.57

Description

Library used to interact with Git repositories

Added to portage

2026-07-27

gnome-flashback - 3.58.0-r1
Ebuild name:

gnome-base/gnome-flashback-3.58.0-r1

Description

GNOME Flashback session

Added to portage

2026-07-27

herbstluftwm - 0.9.6-r1
Ebuild name:

x11-wm/herbstluftwm-0.9.6-r1

Description

A manual tiling window manager for X

Added to portage

2026-07-27

jupyterlab-desktop-bin - 4.6.2.1
Ebuild name:

sci-misc/jupyterlab-desktop-bin-4.6.2.1

Description

JupyterLab desktop application, based on Electron

Added to portage

2026-07-27

libGLw - 8.0.0-r2
Ebuild name:

x11-libs/libGLw-8.0.0-r2

Description

Mesa GLw library

Added to portage

2026-07-27

libxmp - 4.7.2
Ebuild name:

media-libs/libxmp-4.7.2

Description

Library that renders module files to PCM data

Added to portage

2026-07-27

libzia - 4.72-r1
Ebuild name:

dev-libs/libzia-4.72-r1

Description

Platform abstraction code for tucnak package

Added to portage

2026-07-27

mattermost-desktop-bin - 6.3.0_rc2
Ebuild name:

net-im/mattermost-desktop-bin-6.3.0_rc2

Description

Mattermost Desktop application

Added to portage

2026-07-27

nghttp3 - 1.18.0
Ebuild name:

net-libs/nghttp3-1.18.0

Description

HTTP/3 library written in C

Added to portage

2026-07-27

ngtcp2 - 1.25.0
Ebuild name:

net-libs/ngtcp2-1.25.0

Description

Implementation of the IETF QUIC Protocol

Added to portage

2026-07-27

phonenumbers - 9.0.35
Ebuild name:

dev-python/phonenumbers-9.0.35

Description

Python port of Google's libphonenumber

Added to portage

2026-07-27

prompt-toolkit - 3.0.53
Ebuild name:

dev-python/prompt-toolkit-3.0.53

Description

Building powerful interactive command lines in Python

Added to portage

2026-07-27

pygments - 2.20.0
Ebuild name:

dev-python/pygments-2.20.0

Description

Pygments is a syntax highlighting package written in Python

Added to portage

2026-07-27

pyproject-fmt - 2.25.4
Ebuild name:

dev-python/pyproject-fmt-2.25.4

Description

Format your pyproject.toml file

Added to portage

2026-07-27

svxlink - 26.05.1
Ebuild name:

media-radio/svxlink-26.05.1

Description

Multi Purpose Voice Services System, including Qtel for EchoLink

Added to portage

2026-07-27

typeguard - 4.6.0
Ebuild name:

dev-python/typeguard-4.6.0

Description

Run-time type checker for Python

Added to portage

2026-07-27

urwid - 4.0.8
Ebuild name:

dev-python/urwid-4.0.8

Description

Curses-based user interface library for Python

Added to portage

2026-07-27

xephem - 4.2.0-r1
Ebuild name:

sci-astronomy/xephem-4.2.0-r1

Description

Interactive tool for astronomical ephemeris and sky simulation

Added to portage

2026-07-27

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