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:

90069

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-11-10
bacula - 15.0.3-r4
Ebuild name:

app-backup/bacula-15.0.3-r4

Description

Featureful client/server network backup suite

Added to portage

2026-11-10

ebuild-mode - 1.90
Ebuild name:

app-xemacs/ebuild-mode-1.90

Description

Emacs modes for editing ebuilds and other Gentoo specific files

Added to portage

2026-11-10

gentoo-rsync-mirror - 1.0-r7
Ebuild name:

app-admin/gentoo-rsync-mirror-1.0-r7

Description

Ebuild for setting up a Gentoo rsync mirror

Added to portage

2026-11-10

ggml - 0.29.0-r1
Ebuild name:

sci-ml/ggml-0.29.0-r1

Description

Tensor library for machine learning

Added to portage

2026-11-10

intellij-idea - 2026.3-r2
Ebuild name:

dev-util/intellij-idea-2026.3-r2

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-11-10

kirigami - 1.2.3
Ebuild name:

app-emacs/kirigami-1.2.3

Description

A unified method to fold and unfold text

Added to portage

2026-11-10

lean-mode - 0_p20230611-r1
Ebuild name:

app-emacs/lean-mode-0_p20230611-r1

Description

Emacs mode for the Lean 3 theorem prover

Added to portage

2026-11-10

piwigo - 16.5.0
Ebuild name:

www-apps/piwigo-16.5.0

Description

a photo gallery software for the web

Added to portage

2026-11-10

simpleagenda - 0.50
Ebuild name:

gnustep-apps/simpleagenda-0.50

Description

a simple calendar and agenda application

Added to portage

2026-11-10

2026-11-09
7zip - 26.06
Ebuild name:

app-arch/7zip-26.06

Description

Free file archiver for extremely high compression

Added to portage

2026-11-09

apprise - 2.2.0
Ebuild name:

dev-python/apprise-2.2.0

Description

Push Notifications that work with just about every platform

Added to portage

2026-11-09

caddy - 2.11.9
Ebuild name:

www-servers/caddy-2.11.9

Description

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HT

Added to portage

2026-11-09

coinor-cbc - 2.10.12-r2
Ebuild name:

sci-libs/coinor-cbc-2.10.12-r2

Description

COIN-OR branch-and-cut mixed integer program solver

Added to portage

2026-11-09

coinor-cbc - 2.10.5-r2
Ebuild name:

sci-libs/coinor-cbc-2.10.5-r2

Description

COIN-OR branch-and-cut mixed integer program solver

Added to portage

2026-11-09

coinor-clp - 1.17.10-r1
Ebuild name:

sci-libs/coinor-clp-1.17.10-r1

Description

COIN-OR linear programming solver

Added to portage

2026-11-09

coinor-clp - 1.17.6-r2
Ebuild name:

sci-libs/coinor-clp-1.17.6-r2

Description

COIN-OR linear programming solver

Added to portage

2026-11-09

gcc - 17.0.0_p20261108
Ebuild name:

sys-devel/gcc-17.0.0_p20261108

Description

The GNU Compiler Collection

Added to portage

2026-11-09

git-sources - 7.4_rc2
Ebuild name:

sys-kernel/git-sources-7.4_rc2

Description

The very latest -git version of the Linux kernel

Added to portage

2026-11-09

gsoap - 2.8.130-r2
Ebuild name:

net-libs/gsoap-2.8.130-r2

Description

A cross-platform open source C and C++ SDK for SOAP/XML Web services

Added to portage

2026-11-09

headscale - 0.29.7
Ebuild name:

net-vpn/headscale-0.29.7

Description

An open source, self-hosted implementation of the Tailscale control server

Added to portage

2026-11-09

kmscon - 10.1.1
Ebuild name:

sys-apps/kmscon-10.1.1

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-11-09

ldl - 2.2.6-r1
Ebuild name:

sci-libs/ldl-2.2.6-r1

Description

Simple but educational LDL^T matrix factorization algorithm

Added to portage

2026-11-09

ledger-mode - 4.0.0
Ebuild name:

app-emacs/ledger-mode-4.0.0

Description

An Emacs major mode for editing ledger files

Added to portage

2026-11-09

libmd - 1.2.0
Ebuild name:

app-crypt/libmd-1.2.0

Description

Message Digest functions from BSD systems

Added to portage

2026-11-09

libmd - 1.3.0
Ebuild name:

app-crypt/libmd-1.3.0

Description

Message Digest functions from BSD systems

Added to portage

2026-11-09

libscrypt - 1.22-r3
Ebuild name:

app-crypt/libscrypt-1.22-r3

Description

Shared library to implement the scrypt algorithm

Added to portage

2026-11-09

lice-el - 0.3
Ebuild name:

app-emacs/lice-el-0.3

Description

License and header template for GNU Emacs

Added to portage

2026-11-09

nuitka - 4.3.5
Ebuild name:

dev-python/nuitka-4.3.5

Description

Python to native compiler

Added to portage

2026-11-09

pkixssh - 20.1
Ebuild name:

net-misc/pkixssh-20.1

Description

OpenSSH fork with X.509 v3 certificate support

Added to portage

2026-11-09

pymdown-extensions - 13.0
Ebuild name:

dev-python/pymdown-extensions-13.0

Description

Extensions for Python Markdown

Added to portage

2026-11-09

pypiserver - 2.4.3
Ebuild name:

dev-python/pypiserver-2.4.3

Description

Minimal PyPI server

Added to portage

2026-11-09

pyside - 6.12.0-r1
Ebuild name:

dev-python/pyside-6.12.0-r1

Description

Python bindings for the Qt framework

Added to portage

2026-11-09

pytest-xdist - 3.8.0-r1
Ebuild name:

dev-python/pytest-xdist-3.8.0-r1

Description

Distributed testing and loop-on-failing modes

Added to portage

2026-11-09

regex - 2026.11.9
Ebuild name:

dev-python/regex-2026.11.9

Description

Alternative regular expression module to replace re

Added to portage

2026-11-09

smb4k - 4.0.8
Ebuild name:

net-misc/smb4k-4.0.8

Description

Advanced network neighborhood browser

Added to portage

2026-11-09

snapd - 2.63-r1
Ebuild name:

app-containers/snapd-2.63-r1

Description

Service and tools for management of snap packages

Added to portage

2026-11-09

tifffile - 2026.11.8
Ebuild name:

dev-python/tifffile-2026.11.8

Description

Read and write TIFF files

Added to portage

2026-11-09

tree-sitter - 0.26.1
Ebuild name:

dev-python/tree-sitter-0.26.1

Description

Python bindings to the Tree-sitter parsing library

Added to portage

2026-11-09

tvheadend - 4.3_p20261106
Ebuild name:

media-tv/tvheadend-4.3_p20261106

Description

Tvheadend is a TV streaming server and digital video recorder

Added to portage

2026-11-09

uhd - 4.11.0.0
Ebuild name:

net-wireless/uhd-4.11.0.0

Description

Universal Software Radio Peripheral (USRP) Hardware Driver

Added to portage

2026-11-09

urjtag - 2021.03-r1
Ebuild name:

dev-embedded/urjtag-2021.03-r1

Description

Tool for communicating over JTAG with flash chips, CPUs, and many mo

Added to portage

2026-11-09

virtualbox - 7.2.18-r1
Ebuild name:

app-emulation/virtualbox-7.2.18-r1

Description

Family of powerful x86 virtualization products for enterprise an

Added to portage

2026-11-09

virtualbox - 7.2.22-r1
Ebuild name:

app-emulation/virtualbox-7.2.22-r1

Description

Family of powerful x86 virtualization products for enterprise an

Added to portage

2026-11-09

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