30.36 The ex Open Mode Can Be HandyMost vi users hate it when they start the editor and get a message like one of these:
Visual needs addressable cursor or upline capability [Using open mode] Those folks usually say (or think) something choice like "how the #&@! do I get to fullscreen mode?" If you're one of those people, wait. You might get to like the ex open mode! Before I show you an example of open mode, I'll mention another place where it's nice: on slow dialup lines or sluggish network connections, where your screen fills slowly and you're always waiting for it to redraw. It's also very useful if you're using a window system and vi doesn't seem to understand how many lines are in your window - for quick editing, it can be easier to switch to open mode for a minute than to try to fix the window.
The open mode is something like
vi
on a one-line screen.
It's different from other UNIX line-mode editors like
ed
or the
standard colon-prompt mode of
ex
, though.
In open mode, you use the normal fullscreen
vi
commands - one line
at a time.
For example, to exit, type If you've got a fair amount of experience with vi , the easiest way to learn about open mode is to jump in and try it - after a little explanation, that is. There are three ways to get into open mode:
When you start open mode, the editor will display the current line and put your cursor at the start of it.
[Using open mode] "afile" 47 lines, 1943 characters I n the beginning, there was a cursor. Open the file afile in open mode. Notice that the prompt line, which shows the filename and size at the bottom of the screen in vi , is printed first during open mode. That's because open mode always prints line by line. Next, the first line of the file is displayed. Your cursor is at the start of the line.
[Using open mode] "afile" 47 lines, 1943 characters In the b eginning, there was a cursor.
The
vi
command
[Using open mode] "afile" 47 lines, 1943 characters In the beginning, there was a cursor. The scr e en was blank and without characters.
The
vi
command
[Using open mode] "afile" 47 lines, 1943 characters In the beginning, there was a cursor. The screen was blank and without characters. In the b eginning, there was a cursor.
The
vi
command
[Using open mode] "afile" 47 lines, 1943 characters In the beginning, there was a cursor. The screen was blank and without characters. In the en d , there was a cursor.
Typing This might take some getting used to. But once you learn the idea behind open mode, it can be handy to know. - |
|