2019/07/01(月)OpenBSD の vi

インストールされているのはnviであるので、vimはインストールされていない。
viコマンドはハードリンクによりex、viewと同じ実体である。
/usr/bin/ex
/usr/bin/vi
/usr/bin/view

viの設定は、次のファイルに書く。
  1. /etc/vi.exrc
  2. $HOME/.nexrc
  3. $HOME/.exrc
vi.exrc はシステム全体にする設定を書く。
.nexrc、.exrc は個人の設定を書き込む。設定は .nexrc が先に読み込まれる。


マニュアルによると次のオプションがある。
altwerase [off]
vi only. Select an alternate word erase algorithm.

autoindent, ai [off]
Automatically indent new lines.

autoprint, ap [on]
ex only. Display the current line automatically.

autowrite, aw [off]
Write modified files automatically when changing files or
suspending the editor session.

backup [""]
Back up files before they are overwritten.

beautify, bf [off]
Discard control characters.

cdpath [environment variable CDPATH, or current directory]
The directory paths used as path prefixes for the cd command.

cedit [no default]
Set the character to edit the colon command-line history.

columns, co [80]
Set the number of columns in the screen.

comment [off]
vi only. Skip leading comments in shell, C and C++ language
files.

edcompatible, ed [off]
Remember the values of the `c' and `g' suffixes to the s, & and ~
commands, instead of initializing them as unset for each new
command.

escapetime [1]
The tenths of a second ex/vi waits for a subsequent key to
complete an key mapping.

errorbells, eb [off]
ex only. Announce error messages with a bell.

exrc, ex [off]
Read the startup files in the local directory.

extended [off]
Use extended regular expressions (EREs) rather than basic regular
expressions (BREs). See re_format(7) for more information on
regular expressions.

filec []
Set the character to perform file path completion on the colon
command line.

flash [off]
Flash the screen instead of beeping the keyboard on error.

hardtabs, ht [0]
Set the spacing between hardware tab settings. This option
currently has no effect.

iclower [off]
Makes all regular expressions case-insensitive, as long as an
upper-case letter does not appear in the search string.

ignorecase, ic [off]
Ignore case differences in regular expressions.

keytime [6]
The tenths of a second ex/vi waits for a subsequent key to
complete a key mapping.

leftright [off]
vi only. Do left-right scrolling.

lines, li [24]
vi only. Set the number of lines in the screen.

list [off]
Display lines in an unambiguous fashion.

lock [on]
Attempt to get an exclusive lock on any file being edited, read
or written.

magic [on]
When turned off, all regular expression characters except for `^'
and `$' are treated as ordinary characters. Preceding individual
characters by `\' re-enables them.

matchtime [7]
vi only. The tenths of a second ex/vi pauses on the matching
character when the showmatch option is set.

mesg [on]
Permit messages from other users.

noprint [""]
Characters that are never handled as printable characters.

number, nu [off]
Precede each line displayed with its current line number.

octal [off]
Display unknown characters as octal numbers, instead of the
default hexadecimal.

open [on]
ex only. If this option is not set, the open and visual commands
are disallowed.

paragraphs, para [IPLPPPQPP LIpplpipbpBlBdPpLpIt]
vi only. Define additional paragraph boundaries for the and
commands.

path [""]
Define additional directories to search for files being edited.

print [""]
Characters that are always handled as printable characters.

prompt [on]
ex only. Display a command prompt.

readonly, ro [off]
Mark the file and session as read-only.

recdir [/tmp/vi.recover]
The directory where recovery files are stored.

remap [on]
Remap keys until resolved.

report [5]
Set the number of lines about which the editor reports changes or
yanks.

ruler [off]
vi only. Display a row/column ruler on the colon command line.

scroll, scr [($LINES - 1) / 2]
Set the number of lines scrolled.

searchincr [off]
Makes the / and ? commands incremental.

sections, sect [NHSHH HUnhshShSs]
vi only. Define additional section boundaries for the [[ and ]]
commands.

secure [off]
Turns off all access to external programs.

shell, sh [environment variable SHELL, or /bin/sh]
Select the shell used by the editor.

shellmeta [~{
Set the meta characters checked to determine if file name
expansion is necessary.

shiftwidth, sw [8]
Set the autoindent and shift command indentation width.

showmatch, sm [off]
vi only. Note matching `' and `(' for `' and `)' characters.

showmode, smd [off]
vi only. Display the current editor mode and a "modified" flag.

sidescroll [16]
vi only. Set the amount a left-right scroll will shift.

tabstop, ts [8]
This option sets tab widths for the editor display.

taglength, tl [0]
Set the number of significant characters in tag names.

tags, tag [tags]
Set the list of tags files.

term, ttytype, tty [environment variable TERM]
Set the terminal type.

terse [off]
This option has historically made editor messages less verbose.
It has no effect in this implementation.

tildeop [off]
Modify the ~ command to take an associated motion.

timeout, to [on]
Time out on keys which may be mapped.

ttywerase [off]
vi only. Select an alternate erase algorithm.

verbose [off]
vi only. Display an error message for every error.

w300 [no default]
vi only. Set the window size if the baud rate is less than 1200
baud.

w1200 [no default]
vi only. Set the window size if the baud rate is equal to 1200
baud.

w9600 [no default]
vi only. Set the window size if the baud rate is greater than
1200 baud.

warn [on]
ex only. This option causes a warning message to be printed on
the terminal if the file has been modified since it was last
written, before a ! command.

window, w, wi [environment variable LINES - 1]
Set the window size for the screen.

windowname [off]
Change the icon/window name to the current file name even if it
can't be restored on editor exit.

wraplen, wl [0]
vi only. Break lines automatically, the specified number of
columns from the left-hand margin. If both the wraplen and
wrapmargin edit options are set, the wrapmargin value is used.

wrapmargin, wm [0]
vi only. Break lines automatically, the specified number of
columns from the right-hand margin. If both the wraplen and
wrapmargin edit options are set, the wrapmargin value is used.

wrapscan, ws [on]
Set searches to wrap around the end or beginning of the file.

writeany, wa [off]
Turn off file-overwriting checks.
OK キャンセル 確認 その他