Questions tagged [ex-command]

ex is an advanced version of the standard Unix editor ed. It is the direct predecessor of vi.

Filter by
Sorted by
Tagged with
4
votes
2answers
3k views

How to use "-c" command line option?

Fully realizing the heritage of vi, I know that its predecessor (ex) could be, and was, used for command line processing of files ("sed-style", if you like). The manpage says: -c {command} {...
2
votes
1answer
656 views

How to remove inner content of html tag conditionally?

I've html file (e.g. curl -o page.html http://example.com/) where I would like to remove inner html block for given html tag. I've the following code which works: $ ex -V1 page.html <<-EOF /&...
5
votes
2answers
764 views

How to repeat the last command in Ex?

I've the file, like: name = foo # unknown number of lines ... features_exclude[rules_config][] = rule1 features_exclude[rules_config][] = rule2 features_exclude[rules_config][] = rule3 ...
9
votes
3answers
3k views

How can I change the default grep call (grepprg) to exclude directories?

I am trying to change the default grep call to avoid unnecessary plugin installation. What I want from vim is to call the external search using the builtin command :grep with custom arguments, this is ...
9
votes
2answers
414 views

Use ex-command to check whether two lines are identical?

I was looking at this question and then wondered how I might implement my answer which uses sed using purely POSIX ex. The trick is that while in sed I can compare the hold space with the pattern ...
2
votes
3answers
100 views

Why aren't :g/X/d changes saved in Ex?

I've the following file (which is a simplification of the hosts file): 126.0.0.1 127.0.0.1 128.0.0.1 and I'm trying to invoke the following command: ex +g/127/d -cwq file which is supposed to ...