screwtape on Nostr: I saw someone kinda using shell and vim to do potentially fancy string replacements. ...
I saw someone kinda using shell and vim to do potentially fancy string replacements. I was thinking how I could try it in #emacs.
directory
M-x dired <ret> <the directory> <ret>
target extension
M-x occur <ret> .txt <ret>
occur buffer
C-x o C-n
keyboard macro
C-x (
Go to file; open
<ret> <ret>
Arbitrary action
M-x replace-string <ret> target <ret> replacement <ret>
Save and kill buffer
C-x C-s C-x C-k <ret>
Go back to occur, next line
C-x C-b C-n
end kbd macro
C-x )
Do all lines
C-u -1 C-x e
Published at
2024-03-30 02:36:08Event JSON
{
"id": "c9ab5b2b53b9507afecf8d461c7462cc00352ec88f154115d3b3186c0b301df2",
"pubkey": "9e9c58006890e3e31e306e20518f236965f1d8ee97640175d74afb88769a7c4d",
"created_at": 1711766168,
"kind": 1,
"tags": [
[
"t",
"emacs"
],
[
"proxy",
"https://mastodon.sdf.org/users/screwtape/statuses/112182307650557828",
"activitypub"
]
],
"content": "I saw someone kinda using shell and vim to do potentially fancy string replacements. I was thinking how I could try it in #emacs.\ndirectory\nM-x dired \u003cret\u003e \u003cthe directory\u003e \u003cret\u003e\ntarget extension\nM-x occur \u003cret\u003e .txt \u003cret\u003e\noccur buffer\nC-x o C-n\nkeyboard macro\nC-x (\nGo to file; open\n\u003cret\u003e \u003cret\u003e\nArbitrary action\nM-x replace-string \u003cret\u003e target \u003cret\u003e replacement \u003cret\u003e\nSave and kill buffer\nC-x C-s C-x C-k \u003cret\u003e\nGo back to occur, next line\nC-x C-b C-n\nend kbd macro\nC-x )\nDo all lines\nC-u -1 C-x e",
"sig": "168889fcbc6eb73cf81f05489688c7c234285a5074c6dee00c3a1e9ccb3fe120ba10c80f24ff148aee73726c3fdd109f62fbf743df9423e92ee3a51e3866f723"
}