سؤال

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 :)

هل كانت مفيدة؟

المحلول

vi

:%s/l/r/g

command line:

tr l r < in > out

نصائح أخرى

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
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top