How to change a string in the vim editor?
问题 I am trying to replace a string with slashes in vim editor ex: foo to abc/def/foo . Any suggestions? 回答1: The title and the content of your question don't match. :help pattern and :help :substitute are a bit overwhelming but very useful as regular expressions are at the heart of Vim. Vim regular Expressions 101 is a more concise resource. Anyway, given the following sample text: bar baz foo baz bar your goal can be achieved in a variety of ways. Here are some of them: :s/foo/\/abc\/def\/foo