History log of /openbsd-current/usr.bin/vi/common/options.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.30 12-Feb-2024 job

Add showfilename set option

Pressing control-G all the time to understand 'what file is in what
window' might be tedious. Instead, offer a configurable option
(default off) to display the file name in the lower left corner.

OK millert@ otto@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE
# 1.29 13-Apr-2021 millert

Require that the argument to the window option be non-zero.
A zero-row window would not be usable (no room to edit) and the
code is full of assumptions that "sp->t_rows - 1" >= 0.
From Erik Ruotsalainen, fixes a bug reported by Paul de Weerd.


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.28 30-Apr-2020 millert

Add an expandtab option, similar to what vim supports.
If set, expands tabs to spaces in insert mode as well as when
shifting and indenting/outdenting. If quoted with ^V, a literal
tab is inserted. Adapted from NetBSD, but this implementation
more closely matches vim's behavior. OK dlg@


Revision tags: OPENBSD_6_6_BASE
# 1.27 21-May-2019 martijn

Also apply stricter pledge when secure mode is set via rc file or command.

Pointed out by jesper <at> ifconfig <dot> se

OK brynet@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.26 31-Jul-2017 martijn

Silence some warnings generated by clang.
Original diff by espie@ with some minor tweaks by myself.

OK espie@ and florian@


# 1.25 03-Jul-2017 bentley

Remove settings that were unimplemented for 20 years; update STANDARDS.

ok jmc@ natano@


# 1.24 30-Jun-2017 bentley

Add mdoc(7) macros to vi's built-in lists of roff paragraph/section macros.

ok jmc@, no objection schwarze@


# 1.23 18-Apr-2017 deraadt

free(NULL) is ok so use it; from Michael W. Bombardieri


Revision tags: OPENBSD_6_1_BASE
# 1.22 01-Aug-2016 bentley

Remove vi's "directory" option and TMPDIR support.

ok jung@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.21 06-Jan-2016 millert

Remove the numeric identifiers at the beginning of the messages
which used to be used as the message number to lookup in the
catalog. From Martijn van Duren


# 1.20 06-Jan-2016 millert

Remove the message catalog DB. This removes the msg_open() and
msg_close() functions along with the msgcat command.
From Martijn van Duren


# 1.19 24-Nov-2015 bentley

Turn on filename tab completion in vi by default.

From FreeBSD.

ok claudio@ tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.18 14-Nov-2014 tedu

from natano:
_PATH_BSHELL, _PATH_SENDMAIL, _PATH_TMP and _PATH_TTY are defined in
<paths.h> and _PATH_SYSV_TTY is unused. All of them can be removed from
pathnames.h. The other defines can be made unconditionally.


# 1.17 12-Nov-2014 bentley

Ansify vi.

ok bcallah@ millert@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.16 10-Jul-2011 millert

Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid a namespace collision
with sys/fcntl.h. OK deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.15 22-Nov-2009 nicm

Change the flash option to be off by default. Now that xterm has the flash
capability in terminfo, vi was using it instead of beeping, but it is too slow
for some machines.

ok deraadt


# 1.14 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.13 11-Mar-2006 ray

Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto


Revision tags: OPENBSD_3_9_BASE
# 1.12 08-Jan-2006 miod

Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.

From Ray Lai.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.11 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.9 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_8_BASE
# 1.8 22-Oct-2000 naddy

Fix noprint/print/octal options; from NetBSD.
reviewed by millert@


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE
# 1.7 27-Jul-1997 downsj

Update to 1.79 and install as vi/ex/view.


Revision tags: OPENBSD_2_1_BASE
# 1.6 16-Oct-1996 michaels

nvi 1.78:
+ Fix bugs when both the leftright scrolling and number edit options
were on.
+ Fix bug where splitting in the middle of the screen could repaint
incorrectly.
+ Fix first-nul in input bug, where random garbage was inserted.
+ Correct search and mark-as-motion-command bug, it's a line mode
action if the search starts at or before the first non<blank>.
+ Fix bug autoindent bug, where ^D could shift too far in the line.
+ Fix core dump where ! command called from the .exrc file.
+ Add the -S command-line option, which initializes vi to have the
secure edit option preset.


Revision tags: OPENBSD_2_0_BASE
# 1.5 17-Sep-1996 michaels

nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening.
+ Fix a core dump bug in the R command.
+ Give up on licensing: no more shareware, adware, whatever.
+ Fix cursor positioning bug for C, S and c$ in an empty file.


# 1.4 16-Aug-1996 michaels

nvi 1.73


# 1.3 24-Jul-1996 mickey

bring vi/ex up to 1.71


# 1.2 22-May-1996 deraadt

new vi


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.29 13-Apr-2021 millert

Require that the argument to the window option be non-zero.
A zero-row window would not be usable (no room to edit) and the
code is full of assumptions that "sp->t_rows - 1" >= 0.
From Erik Ruotsalainen, fixes a bug reported by Paul de Weerd.


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.28 30-Apr-2020 millert

Add an expandtab option, similar to what vim supports.
If set, expands tabs to spaces in insert mode as well as when
shifting and indenting/outdenting. If quoted with ^V, a literal
tab is inserted. Adapted from NetBSD, but this implementation
more closely matches vim's behavior. OK dlg@


Revision tags: OPENBSD_6_6_BASE
# 1.27 21-May-2019 martijn

Also apply stricter pledge when secure mode is set via rc file or command.

Pointed out by jesper <at> ifconfig <dot> se

OK brynet@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.26 31-Jul-2017 martijn

Silence some warnings generated by clang.
Original diff by espie@ with some minor tweaks by myself.

OK espie@ and florian@


# 1.25 03-Jul-2017 bentley

Remove settings that were unimplemented for 20 years; update STANDARDS.

ok jmc@ natano@


# 1.24 30-Jun-2017 bentley

Add mdoc(7) macros to vi's built-in lists of roff paragraph/section macros.

ok jmc@, no objection schwarze@


# 1.23 18-Apr-2017 deraadt

free(NULL) is ok so use it; from Michael W. Bombardieri


Revision tags: OPENBSD_6_1_BASE
# 1.22 01-Aug-2016 bentley

Remove vi's "directory" option and TMPDIR support.

ok jung@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.21 06-Jan-2016 millert

Remove the numeric identifiers at the beginning of the messages
which used to be used as the message number to lookup in the
catalog. From Martijn van Duren


# 1.20 06-Jan-2016 millert

Remove the message catalog DB. This removes the msg_open() and
msg_close() functions along with the msgcat command.
From Martijn van Duren


# 1.19 24-Nov-2015 bentley

Turn on filename tab completion in vi by default.

From FreeBSD.

ok claudio@ tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.18 14-Nov-2014 tedu

from natano:
_PATH_BSHELL, _PATH_SENDMAIL, _PATH_TMP and _PATH_TTY are defined in
<paths.h> and _PATH_SYSV_TTY is unused. All of them can be removed from
pathnames.h. The other defines can be made unconditionally.


# 1.17 12-Nov-2014 bentley

Ansify vi.

ok bcallah@ millert@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.16 10-Jul-2011 millert

Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid a namespace collision
with sys/fcntl.h. OK deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.15 22-Nov-2009 nicm

Change the flash option to be off by default. Now that xterm has the flash
capability in terminfo, vi was using it instead of beeping, but it is too slow
for some machines.

ok deraadt


# 1.14 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.13 11-Mar-2006 ray

Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto


Revision tags: OPENBSD_3_9_BASE
# 1.12 08-Jan-2006 miod

Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.

From Ray Lai.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.11 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.9 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_8_BASE
# 1.8 22-Oct-2000 naddy

Fix noprint/print/octal options; from NetBSD.
reviewed by millert@


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE
# 1.7 27-Jul-1997 downsj

Update to 1.79 and install as vi/ex/view.


Revision tags: OPENBSD_2_1_BASE
# 1.6 16-Oct-1996 michaels

nvi 1.78:
+ Fix bugs when both the leftright scrolling and number edit options
were on.
+ Fix bug where splitting in the middle of the screen could repaint
incorrectly.
+ Fix first-nul in input bug, where random garbage was inserted.
+ Correct search and mark-as-motion-command bug, it's a line mode
action if the search starts at or before the first non<blank>.
+ Fix bug autoindent bug, where ^D could shift too far in the line.
+ Fix core dump where ! command called from the .exrc file.
+ Add the -S command-line option, which initializes vi to have the
secure edit option preset.


Revision tags: OPENBSD_2_0_BASE
# 1.5 17-Sep-1996 michaels

nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening.
+ Fix a core dump bug in the R command.
+ Give up on licensing: no more shareware, adware, whatever.
+ Fix cursor positioning bug for C, S and c$ in an empty file.


# 1.4 16-Aug-1996 michaels

nvi 1.73


# 1.3 24-Jul-1996 mickey

bring vi/ex up to 1.71


# 1.2 22-May-1996 deraadt

new vi


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.28 30-Apr-2020 millert

Add an expandtab option, similar to what vim supports.
If set, expands tabs to spaces in insert mode as well as when
shifting and indenting/outdenting. If quoted with ^V, a literal
tab is inserted. Adapted from NetBSD, but this implementation
more closely matches vim's behavior. OK dlg@


Revision tags: OPENBSD_6_6_BASE
# 1.27 21-May-2019 martijn

Also apply stricter pledge when secure mode is set via rc file or command.

Pointed out by jesper <at> ifconfig <dot> se

OK brynet@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.26 31-Jul-2017 martijn

Silence some warnings generated by clang.
Original diff by espie@ with some minor tweaks by myself.

OK espie@ and florian@


# 1.25 03-Jul-2017 bentley

Remove settings that were unimplemented for 20 years; update STANDARDS.

ok jmc@ natano@


# 1.24 30-Jun-2017 bentley

Add mdoc(7) macros to vi's built-in lists of roff paragraph/section macros.

ok jmc@, no objection schwarze@


# 1.23 18-Apr-2017 deraadt

free(NULL) is ok so use it; from Michael W. Bombardieri


Revision tags: OPENBSD_6_1_BASE
# 1.22 01-Aug-2016 bentley

Remove vi's "directory" option and TMPDIR support.

ok jung@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.21 06-Jan-2016 millert

Remove the numeric identifiers at the beginning of the messages
which used to be used as the message number to lookup in the
catalog. From Martijn van Duren


# 1.20 06-Jan-2016 millert

Remove the message catalog DB. This removes the msg_open() and
msg_close() functions along with the msgcat command.
From Martijn van Duren


# 1.19 24-Nov-2015 bentley

Turn on filename tab completion in vi by default.

From FreeBSD.

ok claudio@ tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.18 14-Nov-2014 tedu

from natano:
_PATH_BSHELL, _PATH_SENDMAIL, _PATH_TMP and _PATH_TTY are defined in
<paths.h> and _PATH_SYSV_TTY is unused. All of them can be removed from
pathnames.h. The other defines can be made unconditionally.


# 1.17 12-Nov-2014 bentley

Ansify vi.

ok bcallah@ millert@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.16 10-Jul-2011 millert

Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid a namespace collision
with sys/fcntl.h. OK deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.15 22-Nov-2009 nicm

Change the flash option to be off by default. Now that xterm has the flash
capability in terminfo, vi was using it instead of beeping, but it is too slow
for some machines.

ok deraadt


# 1.14 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.13 11-Mar-2006 ray

Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto


Revision tags: OPENBSD_3_9_BASE
# 1.12 08-Jan-2006 miod

Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.

From Ray Lai.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.11 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.9 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_8_BASE
# 1.8 22-Oct-2000 naddy

Fix noprint/print/octal options; from NetBSD.
reviewed by millert@


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE
# 1.7 27-Jul-1997 downsj

Update to 1.79 and install as vi/ex/view.


Revision tags: OPENBSD_2_1_BASE
# 1.6 16-Oct-1996 michaels

nvi 1.78:
+ Fix bugs when both the leftright scrolling and number edit options
were on.
+ Fix bug where splitting in the middle of the screen could repaint
incorrectly.
+ Fix first-nul in input bug, where random garbage was inserted.
+ Correct search and mark-as-motion-command bug, it's a line mode
action if the search starts at or before the first non<blank>.
+ Fix bug autoindent bug, where ^D could shift too far in the line.
+ Fix core dump where ! command called from the .exrc file.
+ Add the -S command-line option, which initializes vi to have the
secure edit option preset.


Revision tags: OPENBSD_2_0_BASE
# 1.5 17-Sep-1996 michaels

nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening.
+ Fix a core dump bug in the R command.
+ Give up on licensing: no more shareware, adware, whatever.
+ Fix cursor positioning bug for C, S and c$ in an empty file.


# 1.4 16-Aug-1996 michaels

nvi 1.73


# 1.3 24-Jul-1996 mickey

bring vi/ex up to 1.71


# 1.2 22-May-1996 deraadt

new vi


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.27 21-May-2019 martijn

Also apply stricter pledge when secure mode is set via rc file or command.

Pointed out by jesper <at> ifconfig <dot> se

OK brynet@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.26 31-Jul-2017 martijn

Silence some warnings generated by clang.
Original diff by espie@ with some minor tweaks by myself.

OK espie@ and florian@


# 1.25 03-Jul-2017 bentley

Remove settings that were unimplemented for 20 years; update STANDARDS.

ok jmc@ natano@


# 1.24 30-Jun-2017 bentley

Add mdoc(7) macros to vi's built-in lists of roff paragraph/section macros.

ok jmc@, no objection schwarze@


# 1.23 18-Apr-2017 deraadt

free(NULL) is ok so use it; from Michael W. Bombardieri


Revision tags: OPENBSD_6_1_BASE
# 1.22 01-Aug-2016 bentley

Remove vi's "directory" option and TMPDIR support.

ok jung@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.21 06-Jan-2016 millert

Remove the numeric identifiers at the beginning of the messages
which used to be used as the message number to lookup in the
catalog. From Martijn van Duren


# 1.20 06-Jan-2016 millert

Remove the message catalog DB. This removes the msg_open() and
msg_close() functions along with the msgcat command.
From Martijn van Duren


# 1.19 24-Nov-2015 bentley

Turn on filename tab completion in vi by default.

From FreeBSD.

ok claudio@ tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.18 14-Nov-2014 tedu

from natano:
_PATH_BSHELL, _PATH_SENDMAIL, _PATH_TMP and _PATH_TTY are defined in
<paths.h> and _PATH_SYSV_TTY is unused. All of them can be removed from
pathnames.h. The other defines can be made unconditionally.


# 1.17 12-Nov-2014 bentley

Ansify vi.

ok bcallah@ millert@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.16 10-Jul-2011 millert

Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid a namespace collision
with sys/fcntl.h. OK deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.15 22-Nov-2009 nicm

Change the flash option to be off by default. Now that xterm has the flash
capability in terminfo, vi was using it instead of beeping, but it is too slow
for some machines.

ok deraadt


# 1.14 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.13 11-Mar-2006 ray

Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto


Revision tags: OPENBSD_3_9_BASE
# 1.12 08-Jan-2006 miod

Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.

From Ray Lai.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.11 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.9 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_8_BASE
# 1.8 22-Oct-2000 naddy

Fix noprint/print/octal options; from NetBSD.
reviewed by millert@


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE
# 1.7 27-Jul-1997 downsj

Update to 1.79 and install as vi/ex/view.


Revision tags: OPENBSD_2_1_BASE
# 1.6 16-Oct-1996 michaels

nvi 1.78:
+ Fix bugs when both the leftright scrolling and number edit options
were on.
+ Fix bug where splitting in the middle of the screen could repaint
incorrectly.
+ Fix first-nul in input bug, where random garbage was inserted.
+ Correct search and mark-as-motion-command bug, it's a line mode
action if the search starts at or before the first non<blank>.
+ Fix bug autoindent bug, where ^D could shift too far in the line.
+ Fix core dump where ! command called from the .exrc file.
+ Add the -S command-line option, which initializes vi to have the
secure edit option preset.


Revision tags: OPENBSD_2_0_BASE
# 1.5 17-Sep-1996 michaels

nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening.
+ Fix a core dump bug in the R command.
+ Give up on licensing: no more shareware, adware, whatever.
+ Fix cursor positioning bug for C, S and c$ in an empty file.


# 1.4 16-Aug-1996 michaels

nvi 1.73


# 1.3 24-Jul-1996 mickey

bring vi/ex up to 1.71


# 1.2 22-May-1996 deraadt

new vi


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_2_BASE
# 1.26 31-Jul-2017 martijn

Silence some warnings generated by clang.
Original diff by espie@ with some minor tweaks by myself.

OK espie@ and florian@


# 1.25 03-Jul-2017 bentley

Remove settings that were unimplemented for 20 years; update STANDARDS.

ok jmc@ natano@


# 1.24 30-Jun-2017 bentley

Add mdoc(7) macros to vi's built-in lists of roff paragraph/section macros.

ok jmc@, no objection schwarze@


# 1.23 18-Apr-2017 deraadt

free(NULL) is ok so use it; from Michael W. Bombardieri


Revision tags: OPENBSD_6_1_BASE
# 1.22 01-Aug-2016 bentley

Remove vi's "directory" option and TMPDIR support.

ok jung@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.21 06-Jan-2016 millert

Remove the numeric identifiers at the beginning of the messages
which used to be used as the message number to lookup in the
catalog. From Martijn van Duren


# 1.20 06-Jan-2016 millert

Remove the message catalog DB. This removes the msg_open() and
msg_close() functions along with the msgcat command.
From Martijn van Duren


# 1.19 24-Nov-2015 bentley

Turn on filename tab completion in vi by default.

From FreeBSD.

ok claudio@ tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.18 14-Nov-2014 tedu

from natano:
_PATH_BSHELL, _PATH_SENDMAIL, _PATH_TMP and _PATH_TTY are defined in
<paths.h> and _PATH_SYSV_TTY is unused. All of them can be removed from
pathnames.h. The other defines can be made unconditionally.


# 1.17 12-Nov-2014 bentley

Ansify vi.

ok bcallah@ millert@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.16 10-Jul-2011 millert

Rename O_DIRECTORY to O_TMP_DIRECTORY to avoid a namespace collision
with sys/fcntl.h. OK deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.15 22-Nov-2009 nicm

Change the flash option to be off by default. Now that xterm has the flash
capability in terminfo, vi was using it instead of beeping, but it is too slow
for some machines.

ok deraadt


# 1.14 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.13 11-Mar-2006 ray

Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto


Revision tags: OPENBSD_3_9_BASE
# 1.12 08-Jan-2006 miod

Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.

From Ray Lai.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.11 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.10 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.9 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_8_BASE
# 1.8 22-Oct-2000 naddy

Fix noprint/print/octal options; from NetBSD.
reviewed by millert@


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE
# 1.7 27-Jul-1997 downsj

Update to 1.79 and install as vi/ex/view.


Revision tags: OPENBSD_2_1_BASE
# 1.6 16-Oct-1996 michaels

nvi 1.78:
+ Fix bugs when both the leftright scrolling and number edit options
were on.
+ Fix bug where splitting in the middle of the screen could repaint
incorrectly.
+ Fix first-nul in input bug, where random garbage was inserted.
+ Correct search and mark-as-motion-command bug, it's a line mode
action if the search starts at or before the first non<blank>.
+ Fix bug autoindent bug, where ^D could shift too far in the line.
+ Fix core dump where ! command called from the .exrc file.
+ Add the -S command-line option, which initializes vi to have the
secure edit option preset.


Revision tags: OPENBSD_2_0_BASE
# 1.5 17-Sep-1996 michaels

nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening.
+ Fix a core dump bug in the R command.
+ Give up on licensing: no more shareware, adware, whatever.
+ Fix cursor positioning bug for C, S and c$ in an empty file.


# 1.4 16-Aug-1996 michaels

nvi 1.73


# 1.3 24-Jul-1996 mickey

bring vi/ex up to 1.71


# 1.2 22-May-1996 deraadt

new vi


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision