Questions tagged [posix]

The POSIX tag is for questions about the POSIX-standardized features for `ex` and `vi`, which differ occasionally from the "original-vi" implementation.

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

exim incorrect substitution count?

I'm having strange bevahiour with Vim 9.0 $ ex --version | head -3 VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2022 03:09:54) macOS version - x86_64 Included patches: 1-270 $ VIM_POSIX='...
gildux's user avatar
  • 264
1 vote
1 answer
59 views

What is the correct cursor position when a } (forward paragraph motion) reaches the last line of the buffer?

Suppose I have two lines in a buffer: First line Second line I position my cursor on the first column of the first line. In normal mode, I press } (i.e. closing curly brace, forward paragraph motion)....
Flux's user avatar
  • 991
2 votes
1 answer
46 views

Leading colons and whitespaces in Ex commands

Apparently, multiple colons are simply ignored when executing Ex commands. For example, :set number! :::set number! : : :set number! all toggle line numbers. Is this really a consolidated rule? ...
Quasímodo's user avatar
  • 2,406
2 votes
2 answers
488 views

POSIX compliant vi implementations

I found project called The Traditional Vi, but I think that description, readme and manual don't provide exact information about compliancy with POSIX. I tried looking for other implementations that ...
James Kirk's user avatar
0 votes
2 answers
418 views

Why is `vim -E` always exiting with non-zero exit code when using here-doc?

see the following session in dash: $ printf "foo\nbar\n" > testfile $ cat testfile foo bar $ vim -E testfile <<-EOS > 1 > s/foo/baz/ > x > EOS $ echo $? 1 $ cat testfile baz bar $...
radlan's user avatar
  • 677
2 votes
1 answer
448 views

Print current line number to stdout using ex

I often use ex in scripted edits. I can run several editing commands, and then save the changed file, with no danger of hanging if an ex command encounters an error, by running commands like so: ...
Wildcard's user avatar
  • 4,325
0 votes
1 answer
207 views

Increment a number using POSIX features only?

Of course in Vim you have <C-a> to increment a number. Is this POSIX specified? How can I increment (or decrement) a number portably, such as in a scripted edit with ex? Even if the answer is ...
Wildcard's user avatar
  • 4,325
3 votes
3 answers
160 views

Cause `ex` to automatically exit without saving if a pattern isn't found?

I'm big on scripted file edits using POSIX ex rather than sed -i and co. The big trick of course is how to ensure ex doesn't hang waiting for input if an error is encountered. I just wrote a comment ...
Wildcard's user avatar
  • 4,325
9 votes
2 answers
548 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 ...
Wildcard's user avatar
  • 4,325
3 votes
2 answers
2k views

What are differences between POSIX vi and minimal vi implementations, if any?

I have a few questions about vi and its current relationship with Vim. First of all, is Vim minimal (i.e. the default vi on Cygwin) basically a POSIX compliant implementation of vi? I believe POSIX ...
W. M. Martinez's user avatar