How to escape forward slashes?Other ways to exit Insert mode besides EscapeCan Escape be disabled in insert mode?How can I bind Ctrl-Space to be Esc when not in insert mode, and to switch to insert mode otherwise?How to remap <C-[> on linuxHow 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 can flights operated by the same company have such different prices when marketed by another?

Accurately recalling the key - can everyone do it?

What is the significance of $(logname)?

Can machine learning learn a function like finding maximum from a list?

A conjectural trigonometric identity

Python π = 1 + (1/2) + (1/3) + (1/4) - (1/5) + (1/6) + (1/7) + (1/8) + (1/9) - (1/10) ...1748 Euler

"DDoouubbllee ssppeeaakk!!"

Constant Scan spooling

Word for giving preference to the oldest child

Why don't short runways use ramps for takeoff?

Best Ergonomic Design for a handheld ranged weapon

How to compare files with diffrent extensions and delete extra files?

A coworker mumbles to herself when working. How can I ask her to stop?

Why did the United States not resort to nuclear weapons in Vietnam?

Oath of redemption: Does Emmissary of Peace reflect damage taken from Aura of the Guardian?

PI 4 screen rotation from the terminal

Using Python in a Bash Script

Derivative is just speed of change?

How does Asimov's second law deal with contradictory orders from different people?

Adjective for when skills are not improving and I'm depressed about it

Why are sugars in whole fruits not digested the same way sugars in juice are?

Applying for mortgage when living together but only one will be on the mortgage

IBM mainframe classic executable file formats

Reasons for using monsters as bioweapons



How to escape forward slashes?


Other ways to exit Insert mode besides EscapeCan Escape be disabled in insert mode?How can I bind Ctrl-Space to be Esc when not in insert mode, and to switch to insert mode otherwise?How to remap <C-[> on linuxHow 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;








1















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.










share|improve this question









New contributor



janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    1















    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.










    share|improve this question









    New contributor



    janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      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.










      share|improve this question









      New contributor



      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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.







      escape






      share|improve this question









      New contributor



      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 7 hours ago









      peterh

      6462 gold badges10 silver badges29 bronze badges




      6462 gold badges10 silver badges29 bronze badges






      New contributor



      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      januxjanux

      61 bronze badge




      61 bronze badge




      New contributor



      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      janux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          1 Answer
          1






          active

          oldest

          votes


















          4














          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)






          share|improve this answer



























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



            );






            janux is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            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









            4














            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)






            share|improve this answer





























              4














              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)






              share|improve this answer



























                4












                4








                4







                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)






                share|improve this answer













                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)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 8 hours ago









                João A. ToledoJoão A. Toledo

                4912 silver badges4 bronze badges




                4912 silver badges4 bronze badges























                    janux is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    janux is a new contributor. Be nice, and check out our Code of Conduct.












                    janux is a new contributor. Be nice, and check out our Code of Conduct.











                    janux is a new contributor. Be nice, and check out our Code of Conduct.














                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                    Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу