Questions tagged [ex]

The ex utility is a line-oriented text editor first developed by Bill Joy in 1976. The ex editor was later extended with a "visual mode", which turned into the vi screen editor.

Filter by
Sorted by
Tagged with
0
votes
1answer
45 views

How to use vim command-mode indention in ex colon-mode?

I am trying to script some file changes using ex per this answer. The issue that I'm running into is that ex seems to assume that every command is preceded by a colon, so while I can do something ...
0
votes
1answer
39 views

How to use 'itextESC' when using ex as a text editor in command line?

I like using the traditional ex editor for simple command line operations, to re-arrange text within files. For example for a simple moving lines across in a file I would use something like foo bar ...
6
votes
1answer
137 views

Place Single Dot With Vim/Ex

I'm messing around with vim one liners, and I'm unable to escape a . character in a vim ex mode append command. Basically, vim -En '+a|Hello World' '+p' '+q!' - prints "Hello World" But, vim -...
1
vote
1answer
418 views

Does traditional vi (not vim) have large file support?

Is there a way to compile traditional Vi (ex) with large-file (3+ GB) support? I'm trying to open a file that is around 3.5GBs in size and Vi simply says: Tmp file too large. If large-file support ...
9
votes
3answers
14k views

How can I use sed or ex to replace a block (multi-line code) with new block of text (code)?

I have to replace a large block of a text (shell script code) in a file with another block of text. I am impressed with the How can I use sed to replace a multi-line string? answered by antak and ...
7
votes
1answer
5k views

EX editor: go to previous file

Using ex I open 3 files ex file1 file2 file3 I know the command :n goes to file 2 and file3 the command :rew go to file1 from file3 or file2 But what command can I use to go to previous file? I ...
2
votes
1answer
1k views

Is replacing a particular line in a file through a bash script possible in VIM or EX?

I would like to modify a particular line, say line 5, in a file by using the EOEX construct how can I achieve my aim? The code snippet that I use to achieve my purpose is as follows: #!/bin/bash S=0....
3
votes
3answers
150 views

How to find last matching line with ex?

The ex command $ navigates to the first character of the last line. Therefore, when doing a backwards search it skips the line it's currently on. How do I navigate to the last character with ex, or ...
192
votes
5answers
39k views

VISUAL vs. EDITOR – what’s the difference?

I generally set both VISUAL and EDITOR environment variables to the same thing, but what's the difference? Why would I set them differently? When developing apps, why should I choose to look at VISUAL ...