summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJob Snijders <job@cvs.openbsd.org>2024-02-12 16:42:44 +0000
committerJob Snijders <job@cvs.openbsd.org>2024-02-12 16:42:44 +0000
commit6414d35534b7ba85776d008212595e2b357a7135 (patch)
tree7024bdfcac93be0e0ffd18e5dfbcb8217e242ef7 /usr.bin
parent0c7c608f759a50f607393ab2cfd23789af22d8d2 (diff)
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@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vi/common/options.c4
-rw-r--r--usr.bin/vi/docs/USD.doc/vi.man/vi.18
-rw-r--r--usr.bin/vi/vi/vs_refresh.c4
3 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/vi/common/options.c b/usr.bin/vi/common/options.c
index ce80e7b2d70..e9b79722329 100644
--- a/usr.bin/vi/common/options.c
+++ b/usr.bin/vi/common/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.29 2021/04/13 15:39:21 millert Exp $ */
+/* $OpenBSD: options.c,v 1.30 2024/02/12 16:42:42 job Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -145,6 +145,8 @@ OPTLIST const optlist[] = {
{"shellmeta", NULL, OPT_STR, 0},
/* O_SHIFTWIDTH 4BSD */
{"shiftwidth", NULL, OPT_NUM, OPT_NOZERO},
+/* O_SHOWFILENAME */
+ {"showfilename",NULL, OPT_0BOOL, 0},
/* O_SHOWMATCH 4BSD */
{"showmatch", NULL, OPT_0BOOL, 0},
/* O_SHOWMODE 4.4BSD */
diff --git a/usr.bin/vi/docs/USD.doc/vi.man/vi.1 b/usr.bin/vi/docs/USD.doc/vi.man/vi.1
index ed9fddd9ee4..20abba2e8c1 100644
--- a/usr.bin/vi/docs/USD.doc/vi.man/vi.1
+++ b/usr.bin/vi/docs/USD.doc/vi.man/vi.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: vi.1,v 1.83 2023/01/29 09:28:57 otto Exp $
+.\" $OpenBSD: vi.1,v 1.84 2024/02/12 16:42:42 job Exp $
.\"
.\" Copyright (c) 1994
.\" The Regents of the University of California. All rights reserved.
@@ -14,7 +14,7 @@
.\"
.\" @(#)vi.1 8.51 (Berkeley) 10/10/96
.\"
-.Dd $Mdocdate: January 29 2023 $
+.Dd $Mdocdate: February 12 2024 $
.Dt VI 1
.Os
.Sh NAME
@@ -2488,6 +2488,10 @@ Set the meta characters checked to determine if file name expansion
is necessary.
.It Cm shiftwidth , sw Bq 8
Set the autoindent and shift command indentation width.
+.It Cm showfilename Bq off
+.Nm vi
+only.
+Display the file name on the colon command line.
.It Cm showmatch , sm Bq off
.Nm vi
only.
diff --git a/usr.bin/vi/vi/vs_refresh.c b/usr.bin/vi/vi/vs_refresh.c
index a5f5496e0ae..38b01ddee31 100644
--- a/usr.bin/vi/vi/vs_refresh.c
+++ b/usr.bin/vi/vi/vs_refresh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs_refresh.c,v 1.22 2016/01/30 21:31:08 martijn Exp $ */
+/* $OpenBSD: vs_refresh.c,v 1.23 2024/02/12 16:42:43 job Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -810,7 +810,7 @@ vs_modeline(SCR *sp)
/* If more than one screen in the display, show the file name. */
curlen = 0;
- if (IS_SPLIT(sp)) {
+ if (IS_SPLIT(sp) || O_ISSET(sp, O_SHOWFILENAME)) {
for (p = sp->frp->name; *p != '\0'; ++p);
for (ellipsis = 0, cols = sp->cols / 2; --p > sp->frp->name;) {
if (*p == '/') {