Domanda

Is there any good Vim/Emacs/gedit shortcut to replace every certain character? Lets say I had the word "Hello, world!" and replace every 'l' character with 'r' so the statement would be "Herro, worrd!". I have a pretty big file to edit so I thought Vim or Emacs would have some fancy built in tricks to help me out :)

È stato utile?

Soluzione

vi

:%s/l/r/g

command line:

tr l r < in > out

Altri suggerimenti

Emacs:

alt-% l RET r RET

which calls the function query-replace, which you can call like this

alt-x query-replace RET l RET r RET
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top