How to break a long mapping line into several short lines in vimrc mapping

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I have a very long vimrc mapping to deal with for example



nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


how can I break this long line into several short lines so that I can see everything in one screen



Something like the following style:



 nnoremap <space>e 
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>






share|improve this question
























    up vote
    5
    down vote

    favorite












    I have a very long vimrc mapping to deal with for example



    nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


    how can I break this long line into several short lines so that I can see everything in one screen



    Something like the following style:



     nnoremap <space>e 
    :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
    :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>






    share|improve this question






















      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      I have a very long vimrc mapping to deal with for example



      nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


      how can I break this long line into several short lines so that I can see everything in one screen



      Something like the following style:



       nnoremap <space>e 
      :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
      :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>






      share|improve this question












      I have a very long vimrc mapping to deal with for example



      nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


      how can I break this long line into several short lines so that I can see everything in one screen



      Something like the following style:



       nnoremap <space>e 
      :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
      :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>








      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 5 at 23:03









      SLN

      1666




      1666




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          7
          down vote



          accepted










          You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:



          nnoremap <space>e 
          :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
          :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


          This is explained here: :help line-continuation.
          You should note the comment on leading whitespace, i.e.:




          All leading whitespace characters in the line before a backslash are ignored.
          Note however that trailing whitespace in the line before it cannot be
          inserted freely; it depends on the position where a command is split up
          whether additional whitespace is allowed or not.







          share|improve this answer


















          • 1




            You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
            – Karl Yngve Lervåg
            Sep 6 at 6:45






          • 1




            @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
            – nst0022
            Sep 6 at 10:57






          • 1




            I saved you the work.
            – Karl Yngve Lervåg
            Sep 6 at 11:40






          • 1




            Fair enough :-).
            – nst0022
            Sep 6 at 14:47










          • Thanks both of you:)
            – SLN
            Sep 6 at 16:24










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17302%2fhow-to-break-a-long-mapping-line-into-several-short-lines-in-vimrc-mapping%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          7
          down vote



          accepted










          You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:



          nnoremap <space>e 
          :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
          :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


          This is explained here: :help line-continuation.
          You should note the comment on leading whitespace, i.e.:




          All leading whitespace characters in the line before a backslash are ignored.
          Note however that trailing whitespace in the line before it cannot be
          inserted freely; it depends on the position where a command is split up
          whether additional whitespace is allowed or not.







          share|improve this answer


















          • 1




            You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
            – Karl Yngve Lervåg
            Sep 6 at 6:45






          • 1




            @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
            – nst0022
            Sep 6 at 10:57






          • 1




            I saved you the work.
            – Karl Yngve Lervåg
            Sep 6 at 11:40






          • 1




            Fair enough :-).
            – nst0022
            Sep 6 at 14:47










          • Thanks both of you:)
            – SLN
            Sep 6 at 16:24














          up vote
          7
          down vote



          accepted










          You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:



          nnoremap <space>e 
          :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
          :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


          This is explained here: :help line-continuation.
          You should note the comment on leading whitespace, i.e.:




          All leading whitespace characters in the line before a backslash are ignored.
          Note however that trailing whitespace in the line before it cannot be
          inserted freely; it depends on the position where a command is split up
          whether additional whitespace is allowed or not.







          share|improve this answer


















          • 1




            You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
            – Karl Yngve Lervåg
            Sep 6 at 6:45






          • 1




            @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
            – nst0022
            Sep 6 at 10:57






          • 1




            I saved you the work.
            – Karl Yngve Lervåg
            Sep 6 at 11:40






          • 1




            Fair enough :-).
            – nst0022
            Sep 6 at 14:47










          • Thanks both of you:)
            – SLN
            Sep 6 at 16:24












          up vote
          7
          down vote



          accepted







          up vote
          7
          down vote



          accepted






          You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:



          nnoremap <space>e 
          :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
          :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


          This is explained here: :help line-continuation.
          You should note the comment on leading whitespace, i.e.:




          All leading whitespace characters in the line before a backslash are ignored.
          Note however that trailing whitespace in the line before it cannot be
          inserted freely; it depends on the position where a command is split up
          whether additional whitespace is allowed or not.







          share|improve this answer














          You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:



          nnoremap <space>e 
          :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
          :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>


          This is explained here: :help line-continuation.
          You should note the comment on leading whitespace, i.e.:




          All leading whitespace characters in the line before a backslash are ignored.
          Note however that trailing whitespace in the line before it cannot be
          inserted freely; it depends on the position where a command is split up
          whether additional whitespace is allowed or not.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 6 at 11:40









          Karl Yngve Lervåg

          5,9971029




          5,9971029










          answered Sep 6 at 6:40









          nst0022

          1184




          1184







          • 1




            You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
            – Karl Yngve Lervåg
            Sep 6 at 6:45






          • 1




            @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
            – nst0022
            Sep 6 at 10:57






          • 1




            I saved you the work.
            – Karl Yngve Lervåg
            Sep 6 at 11:40






          • 1




            Fair enough :-).
            – nst0022
            Sep 6 at 14:47










          • Thanks both of you:)
            – SLN
            Sep 6 at 16:24












          • 1




            You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
            – Karl Yngve Lervåg
            Sep 6 at 6:45






          • 1




            @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
            – nst0022
            Sep 6 at 10:57






          • 1




            I saved you the work.
            – Karl Yngve Lervåg
            Sep 6 at 11:40






          • 1




            Fair enough :-).
            – nst0022
            Sep 6 at 14:47










          • Thanks both of you:)
            – SLN
            Sep 6 at 16:24







          1




          1




          You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
          – Karl Yngve Lervåg
          Sep 6 at 6:45




          You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
          – Karl Yngve Lervåg
          Sep 6 at 6:45




          1




          1




          @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
          – nst0022
          Sep 6 at 10:57




          @KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
          – nst0022
          Sep 6 at 10:57




          1




          1




          I saved you the work.
          – Karl Yngve Lervåg
          Sep 6 at 11:40




          I saved you the work.
          – Karl Yngve Lervåg
          Sep 6 at 11:40




          1




          1




          Fair enough :-).
          – nst0022
          Sep 6 at 14:47




          Fair enough :-).
          – nst0022
          Sep 6 at 14:47












          Thanks both of you:)
          – SLN
          Sep 6 at 16:24




          Thanks both of you:)
          – SLN
          Sep 6 at 16:24

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17302%2fhow-to-break-a-long-mapping-line-into-several-short-lines-in-vimrc-mapping%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery