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:

82604

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.1 (40 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
2025-12-26
eselect-ruby - 20251225
Ebuild name:

app-eselect/eselect-ruby-20251225

Description

Manages multiple Ruby versions

Added to portage

2025-12-26

gnatformat - 25.0.0-r2
Ebuild name:

dev-ada/gnatformat-25.0.0-r2

Description

Opinionated code formatter for the Ada language

Added to portage

2025-12-26

gpr - 26.0.0
Ebuild name:

dev-ada/gpr-26.0.0

Description

LibGPR2 - Parser for GPR Project files

Added to portage

2025-12-26

rbs - 3.10.0
Ebuild name:

dev-ruby/rbs-3.10.0

Description

The language for type signatures for Ruby and standard library definitions

Added to portage

2025-12-26

2025-12-25
86Box - 5.3
Ebuild name:

app-emulation/86Box-5.3

Description

Emulator of x86-based machines based on PCem

Added to portage

2025-12-25

dbeaver-bin - 25.3.1
Ebuild name:

dev-db/dbeaver-bin-25.3.1

Description

Free universal database tool (community edition)

Added to portage

2025-12-25

django-polymorphic - 4.5.1
Ebuild name:

dev-python/django-polymorphic-4.5.1

Description

Seamless Polymorphic Inheritance for Django Models

Added to portage

2025-12-25

fcitx - 5.1.17
Ebuild name:

app-i18n/fcitx-5.1.17

Description

Fcitx 5 is a generic input method framework

Added to portage

2025-12-25

fcitx-chewing - 5.1.10
Ebuild name:

app-i18n/fcitx-chewing-5.1.10

Description

Chewing Wrapper for Fcitx.

Added to portage

2025-12-25

fcitx-chinese-addons - 5.1.11
Ebuild name:

app-i18n/fcitx-chinese-addons-5.1.11

Description

Addons related to Chinese, including IME previous bundled insi

Added to portage

2025-12-25

fcitx-configtool - 5.1.12
Ebuild name:

app-i18n/fcitx-configtool-5.1.12

Description

Configuration module for Fcitx

Added to portage

2025-12-25

fcitx-gtk - 5.1.5
Ebuild name:

app-i18n/fcitx-gtk-5.1.5

Description

Gtk im module for fcitx5 and glib based dbus client library

Added to portage

2025-12-25

fcitx-qt - 5.1.12
Ebuild name:

app-i18n/fcitx-qt-5.1.12

Description

Qt library and IM module for fcitx5

Added to portage

2025-12-25

fcitx-table-extra - 5.1.10
Ebuild name:

app-i18n/fcitx-table-extra-5.1.10

Description

Provides extra table for Fcitx, including Boshiamy, Zhengma, Cang

Added to portage

2025-12-25

ffmpeg-chromium - 138
Ebuild name:

media-video/ffmpeg-chromium-138

Description

FFmpeg built specifically for codec support in Chromium-based brows

Added to portage

2025-12-25

gamescope - 3.16.19
Ebuild name:

gui-wm/gamescope-3.16.19

Description

Efficient micro-compositor for running games

Added to portage

2025-12-25

hashie - 5.1.0
Ebuild name:

dev-ruby/hashie-5.1.0

Description

Hashie is a small collection of tools that make hashes more powerful

Added to portage

2025-12-25

hoe - 4.5.0
Ebuild name:

dev-ruby/hoe-4.5.0

Description

Hoe extends rake to provide full project automation

Added to portage

2025-12-25

jaraco-context - 6.0.2
Ebuild name:

dev-python/jaraco-context-6.0.2

Description

Context managers by jaraco

Added to portage

2025-12-25

jaraco-test - 5.6.0
Ebuild name:

dev-python/jaraco-test-5.6.0

Description

Testing support by jaraco

Added to portage

2025-12-25

ledger - 3.4.1
Ebuild name:

app-office/ledger-3.4.1

Description

Double-entry accounting system with a command-line reporting interface

Added to portage

2025-12-25

libdecor - 0.2.5
Ebuild name:

gui-libs/libdecor-0.2.5

Description

A client-side decorations library for Wayland clients

Added to portage

2025-12-25

libime - 1.1.13
Ebuild name:

app-i18n/libime-1.1.13

Description

Fcitx5 Next generation of fcitx

Added to portage

2025-12-25

librime - 1.15.0
Ebuild name:

app-i18n/librime-1.15.0

Description

RIME (Rime Input Method Engine) core library

Added to portage

2025-12-25

mergiraf - 0.16.1
Ebuild name:

dev-vcs/mergiraf-0.16.1

Description

Syntax-aware git merge driver

Added to portage

2025-12-25

multi_xml - 0.8.0
Ebuild name:

dev-ruby/multi_xml-0.8.0

Description

A generic swappable back-end for XML parsing

Added to portage

2025-12-25

oslo-serialization - 5.9.0
Ebuild name:

dev-python/oslo-serialization-5.9.0

Description

Oslo Serialization library

Added to portage

2025-12-25

python-engineio - 4.13.0
Ebuild name:

dev-python/python-engineio-4.13.0

Description

Python implementation of the Engine.IO realtime server

Added to portage

2025-12-25

rime-data - 1.0.20251206
Ebuild name:

app-i18n/rime-data-1.0.20251206

Description

Added to portage

2025-12-25

ruby2ruby - 2.6.0
Ebuild name:

dev-ruby/ruby2ruby-2.6.0

Description

Generates readable ruby from ParseTree

Added to portage

2025-12-25

sexp_processor - 4.17.5
Ebuild name:

dev-ruby/sexp_processor-4.17.5

Description

Processor for s-expressions created as part of the ParseTree project

Added to portage

2025-12-25

subrandr - 1.0.1
Ebuild name:

media-libs/subrandr-1.0.1

Description

Subtitle rendering library for rendering non-ASS subtitles

Added to portage

2025-12-25

test-unit - 3.7.6
Ebuild name:

dev-ruby/test-unit-3.7.6

Description

An xUnit family unit testing framework for Ruby

Added to portage

2025-12-25

vivaldi - 7.7.3851.66
Ebuild name:

www-client/vivaldi-7.7.3851.66

Description

A browser for our friends

Added to portage

2025-12-25

vivaldi-snapshot - 7.8.3899.3
Ebuild name:

www-client/vivaldi-snapshot-7.8.3899.3

Description

A browser for our friends

Added to portage

2025-12-25

xsimd - 14.0.0
Ebuild name:

dev-cpp/xsimd-14.0.0

Description

C++ wrappers for SIMD intrinsics

Added to portage

2025-12-25

xyzservices - 2025.11.0
Ebuild name:

sci-geosciences/xyzservices-2025.11.0

Description

Source of XYZ tiles providers

Added to portage

2025-12-25

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