How to escape forward slashes?What does it mean to replace slashes (/) by exclamation marks (!) in a substitute command?Other ways to exit Insert mode besides EscapeCan Escape be disabled in insert mode?How to translate Unicode escape sequences to the Unicode character?What does it mean to replace slashes (/) by exclamation marks (!) in a substitute command?How to escape angle brackets in mappings (the ones that appear in <esc> and <cr>)How to escape filename containing single and double quotes mix?How to escape pipe character in `:make`, `:grep` and friendsHow to escape @ in search replacementSlow vim escape from insert modeHow to assign a Python list to a vim variable and escape its strings correctly
How to gracefully leave a company you helped start?
Running code generated in realtime in JavaScript with eval()
What unique challenges/limitations will I face if I start a career as a pilot at 45 years old?
Chunk + Enumerate a list of digits
(A room / an office) where an artist works
Does fossil fuels use since 1990 account for half of all the fossil fuels used in history?
What are the advantages of this gold finger shape?
Will using a resistor in series with a LED to control its voltage increase the total energy expenditure?
Why not demand President's/candidate's financial records instead of tax returns?
Help, I cannot decide when to start the story
Why aren't rainbows blurred-out into nothing after they are produced?
Do I have to cite common CS algorithms?
How do I ask for 2-3 days per week remote work in a job interview?
Is it possible to know the exact chord from the roman numerals
Is there a fallacy about "appeal to 'big words'"?
Prestidigitation to replace bathing and washing clothes worn?
Do beef farmed pastures net remove carbon emissions?
What is the prop for Thor's hammer made of?
How can I find an old paper when the usual methods fail?
Is there a way to proportionalize fixed costs in a MILP?
What would it take to get a message to another star?
What is the most difficult concept to grasp in Calculus 1?
Dogfights in outer space
Doesn't the speed of light limit imply the same electron can be annihilated twice?
How to escape forward slashes?
What does it mean to replace slashes (/) by exclamation marks (!) in a substitute command?Other ways to exit Insert mode besides EscapeCan Escape be disabled in insert mode?How to translate Unicode escape sequences to the Unicode character?What does it mean to replace slashes (/) by exclamation marks (!) in a substitute command?How to escape angle brackets in mappings (the ones that appear in <esc> and <cr>)How to escape filename containing single and double quotes mix?How to escape pipe character in `:make`, `:grep` and friendsHow to escape @ in search replacementSlow vim escape from insert modeHow to assign a Python list to a vim variable and escape its strings correctly
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I was editing a file and found accidentally that I somehow escaped all the forward slashes in a path I was replacing in text. And that is something very useful!
For instance, to do this replacement correctly I should escape the second path:
:%s/mvn//opt/maven/bin/mvn/g
I did that somehow with an accidental keystroke! But which one? :-(
Thank you.
substitute escape
add a comment |
I was editing a file and found accidentally that I somehow escaped all the forward slashes in a path I was replacing in text. And that is something very useful!
For instance, to do this replacement correctly I should escape the second path:
:%s/mvn//opt/maven/bin/mvn/g
I did that somehow with an accidental keystroke! But which one? :-(
Thank you.
substitute escape
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50
add a comment |
I was editing a file and found accidentally that I somehow escaped all the forward slashes in a path I was replacing in text. And that is something very useful!
For instance, to do this replacement correctly I should escape the second path:
:%s/mvn//opt/maven/bin/mvn/g
I did that somehow with an accidental keystroke! But which one? :-(
Thank you.
substitute escape
I was editing a file and found accidentally that I somehow escaped all the forward slashes in a path I was replacing in text. And that is something very useful!
For instance, to do this replacement correctly I should escape the second path:
:%s/mvn//opt/maven/bin/mvn/g
I did that somehow with an accidental keystroke! But which one? :-(
Thank you.
substitute escape
substitute escape
edited Aug 6 at 13:17
ruohola
23311 bronze badges
23311 bronze badges
asked Aug 2 at 19:45
januxjanux
111 bronze badge
111 bronze badge
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50
add a comment |
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50
add a comment |
1 Answer
1
active
oldest
votes
You don't need to escape them: you could use a different separator for the search pattern and the replace part:
%s;mvn;/opt/maven/bin/mvn;g
But, if you really want to escape them, you can use a backslash ():
%s/mvn//opt/maven/bin/mvn/g
(much harder to read, IMO)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "599"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f20802%2fhow-to-escape-forward-slashes%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You don't need to escape them: you could use a different separator for the search pattern and the replace part:
%s;mvn;/opt/maven/bin/mvn;g
But, if you really want to escape them, you can use a backslash ():
%s/mvn//opt/maven/bin/mvn/g
(much harder to read, IMO)
add a comment |
You don't need to escape them: you could use a different separator for the search pattern and the replace part:
%s;mvn;/opt/maven/bin/mvn;g
But, if you really want to escape them, you can use a backslash ():
%s/mvn//opt/maven/bin/mvn/g
(much harder to read, IMO)
add a comment |
You don't need to escape them: you could use a different separator for the search pattern and the replace part:
%s;mvn;/opt/maven/bin/mvn;g
But, if you really want to escape them, you can use a backslash ():
%s/mvn//opt/maven/bin/mvn/g
(much harder to read, IMO)
You don't need to escape them: you could use a different separator for the search pattern and the replace part:
%s;mvn;/opt/maven/bin/mvn;g
But, if you really want to escape them, you can use a backslash ():
%s/mvn//opt/maven/bin/mvn/g
(much harder to read, IMO)
answered Aug 2 at 21:10
João A. ToledoJoão A. Toledo
5412 silver badges4 bronze badges
5412 silver badges4 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Vi and Vim Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f20802%2fhow-to-escape-forward-slashes%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Related issue: vi.stackexchange.com/questions/3156/…
– Hotschke
Aug 3 at 9:50