1

In Vim sources, a lot of variables related to visual mode start with two uppercase letters:

EXTERN bool VIsual_active INIT(= false);
EXTERN bool VIsual_select INIT(= false);
EXTERN int VIsual_select_reg INIT(= 0);

Here is the example on GitHub.

What is the reason for that? Is it a small reference to the Vi editor?

3
  • 1
    I'm afraid the only person that could answer died a couple of weeks ago. FWIW, a) vi didn't have visual mode so that would be a strange place for a wink, b) the name "vi" is not generally capitalized, and c) "ex" is never capitalized in macro or variable names.
    – romainl
    Commented Aug 16, 2023 at 11:36
  • > I'm afraid the only person that could answer died a couple of weeks ago. Yes, I also think so, but still, I decided to try my luck. Commented Aug 16, 2023 at 11:45
  • You could try git log -G VI or similar and try to find the first references; maybe it's explained there?
    – D. Ben Knoble
    Commented Aug 16, 2023 at 15:52

2 Answers 2

6

There are pointers in version.c of v2.4:

Included code to save the xterm title. Need to define USE_X11, because
specific include file and library are needed.

Added 'icon' option (default off): when set xterm icon is set to file name.

Changed Visual into VIsual, because it is also used by X11.

There may be a relevant header file /usr/include/X11/Xlib.h
on a *nix box with a Visual structure, which can be included
in unix.c:

#ifdef USE_X11

# include <X11/Xlib.h>

To learn more about X11R5 Visual types, see its tarr'd
documentation, where Visual types are described. Read
the second paragraph of mit/doc/Xlib/CH03 file:

tar xf mit-4.tar.Z
man -l mit/doc/Xlib/CH03
3
  • 1
    You want me to dowload a file, untar it and open it in man just so I can read its second paragraph? Couldn't you just have pasted that paragraph in the answer?
    – Friedrich
    Commented Aug 23, 2023 at 6:56
  • Why, only if you're curious about X11 of the day; otherwise, finding Visual in X11/Xlib.h should be enough to arrive at the contextual contingency for a name clash. Commented Aug 23, 2023 at 17:15
  • Awesome research! Commented Aug 24, 2023 at 17:37
4

It appears first in vim-2.4 (July 1994), was not in vim-2.0 (December 1993). There are no comments about this, but seeing that "Visual" and "visual" are used in the comments, it likely was a convenient way to allow grepping for the related symbols without seeing the comments at the same time.

Git doesn't go back far enough, by about ten years. Nor CVS (see the vile FAQ: When did development begin?).

Vim's pre-CVS history is just tarballs.

For further reading: When was visual-mode introduced?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.