Questions tagged [ex]

For questions pertaining the ex utility, 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. Use this tag for questions about ex itself, using ex, or questions about issues arising from the usage of utility itself.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
63 views

What are the main differences between the ed and the ex editor? [closed]

The ex editor is often touted as an enhancement and simplification of ed. I would like to know what specific enhancements and simplifications it offers. GNU ed, for example, offers extended regular ...
user avatar
  • 416
1 vote
2 answers
3k views

Find a string and replace another string on a following line after the first string is found

Given a file with the following content: pkg1: replicaCount: 1 image: tag: latest pullPolicy: Always pkg2: replicaCount: 2 image: tag: latest pullPolicy: Always I want to ...
user avatar
0 votes
1 answer
137 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 ...
user avatar
  • 3
0 votes
1 answer
57 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 ...
user avatar
  • 11.8k
6 votes
1 answer
179 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 -...
user avatar
  • 63
1 vote
1 answer
676 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 ...
user avatar
14 votes
3 answers
27k 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 ...
user avatar
  • 351
8 votes
1 answer
6k 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 ...
user avatar
  • 11k
2 votes
1 answer
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....
user avatar
  • 629
3 votes
3 answers
179 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 ...
user avatar
  • 47.1k
241 votes
5 answers
60k 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 ...
user avatar