- Thread Starter
- #26
I tried again, sam does understand this, with 1,$ instead of %.In vim
%s/abc\ndef/abcdef/g
I do not know why I was before not successful.
I tried again, sam does understand this, with 1,$ instead of %.In vim
%s/abc\ndef/abcdef/g
LookA working solution (of sorts) for your "\n" problem in vi, is also utilising sed as an external filter:
:%!sed -ne '1h;2,$H;$g;$s/abc\ndef/abcdef/gp'
This dumps the complete file in the pattern space (treating it as one line) and then uses it for the substitution; to me that feels like a hack. This also defeats the "stream" aspect of sed as a stream editor.
ssam
from plan9port: "ssam - stream interface to sam".in vim :...
Another question:
"%s/abc/ABC/2" should substitute in every line the second occurrence of "abc" with "ABC".
...
:%s/\(\(.*\)\(abc\)\(.*\)\)\@<=abc/ABC/
this is line abc, abc, abc and abc
def this abc line, abc line and still abc line.
this is line abc, abc, abc and abc
def this abc line, abc line and still abc line.
Well, the question had no practical use, it was only to try to understand what I thought to be contradiction with theMaybe it will work in your editor.
ed
.Once you become proficient in an editor and develop muscle memory you can focus on what you write.Well, when I use the editor, I want to concentrate in what I write, not in how to make the editor write what I want.
cscope
?I even fixed some broken stuff in nvi-1.79, like the cscope support.
It's marked as an feature of nvi but it never worked actually...
It is not compiled in packages to test it.editors/nvi-m17n is 1.79.
$ grep -R uvToWorld
main.cpp: * uvToWorld
main.cpp:glm::vec3 uvToWorld(const Triangle& t, const glm::vec2& uv)
main.cpp: glm::vec3 res = uvToWorld(t, uv);
main.cpp: res = uvToWorld(t, uv);
No, no trouble, just asking how to do it and pointing to a possible bug.You seem to be going through a lot of trouble for something that at least 85% can be achieved via standalone tools.
If you are looking to compile up another version of (n)vi in the hope that this feature has been corrected;
"also work with scope"; is that a typo and shouldn't that be cscope (as in devel/cscope)?cscope as stand alone tool can call vi, it is very practical. But more practical is the nvi tag mechanism that
according to documentation should also work with scope: you just type ^] over a symbol and a new screen pointing
to the symbol should open, the old goes to stack, with :tagn
"also work with scope"; is that a typo and shouldn't that be cscope (as in devel/cscope)?
As I read Bostic's ref at "8. Tags, Tag Stacks, and Cscope", tagnext (tagn) and tagprev (tagp) are two nvi commands only intended to be used with cscope(1)