Vim: Jump to line and change from another line?











up vote
0
down vote

favorite












I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d.



As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d (delete), you should also be able to use c (change) or y (yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.



I am aware i could just :95 and then cc, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d



Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d.



    As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d (delete), you should also be able to use c (change) or y (yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.



    I am aware i could just :95 and then cc, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d



    Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d.



      As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d (delete), you should also be able to use c (change) or y (yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.



      I am aware i could just :95 and then cc, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d



      Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?










      share|improve this question













      I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d.



      As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d (delete), you should also be able to use c (change) or y (yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.



      I am aware i could just :95 and then cc, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d



      Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?







      vim






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Esben Boye-Jacobsen

      731414




      731414
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.



          For delete, there's not much difference between :95d<CR> and 95Gdd (both five keys, one of them shifted). For change, the :change command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single . on a separate line), as :help :change explains.



          If that's weird for you, then by all means use 95Gcc, or :95norm! cc<CR> if you insist on going through command-line mode.






          share|improve this answer

















          • 1




            Agreed, use 95G instead of :95
            – Conner
            21 hours ago










          • Ok, that makes sense - Thanks for your answer!
            – Esben Boye-Jacobsen
            6 hours ago











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372201%2fvim-jump-to-line-and-change-from-another-line%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








          up vote
          3
          down vote



          accepted










          If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.



          For delete, there's not much difference between :95d<CR> and 95Gdd (both five keys, one of them shifted). For change, the :change command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single . on a separate line), as :help :change explains.



          If that's weird for you, then by all means use 95Gcc, or :95norm! cc<CR> if you insist on going through command-line mode.






          share|improve this answer

















          • 1




            Agreed, use 95G instead of :95
            – Conner
            21 hours ago










          • Ok, that makes sense - Thanks for your answer!
            – Esben Boye-Jacobsen
            6 hours ago















          up vote
          3
          down vote



          accepted










          If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.



          For delete, there's not much difference between :95d<CR> and 95Gdd (both five keys, one of them shifted). For change, the :change command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single . on a separate line), as :help :change explains.



          If that's weird for you, then by all means use 95Gcc, or :95norm! cc<CR> if you insist on going through command-line mode.






          share|improve this answer

















          • 1




            Agreed, use 95G instead of :95
            – Conner
            21 hours ago










          • Ok, that makes sense - Thanks for your answer!
            – Esben Boye-Jacobsen
            6 hours ago













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.



          For delete, there's not much difference between :95d<CR> and 95Gdd (both five keys, one of them shifted). For change, the :change command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single . on a separate line), as :help :change explains.



          If that's weird for you, then by all means use 95Gcc, or :95norm! cc<CR> if you insist on going through command-line mode.






          share|improve this answer












          If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.



          For delete, there's not much difference between :95d<CR> and 95Gdd (both five keys, one of them shifted). For change, the :change command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single . on a separate line), as :help :change explains.



          If that's weird for you, then by all means use 95Gcc, or :95norm! cc<CR> if you insist on going through command-line mode.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          Ingo Karkat

          128k14141193




          128k14141193








          • 1




            Agreed, use 95G instead of :95
            – Conner
            21 hours ago










          • Ok, that makes sense - Thanks for your answer!
            – Esben Boye-Jacobsen
            6 hours ago














          • 1




            Agreed, use 95G instead of :95
            – Conner
            21 hours ago










          • Ok, that makes sense - Thanks for your answer!
            – Esben Boye-Jacobsen
            6 hours ago








          1




          1




          Agreed, use 95G instead of :95
          – Conner
          21 hours ago




          Agreed, use 95G instead of :95
          – Conner
          21 hours ago












          Ok, that makes sense - Thanks for your answer!
          – Esben Boye-Jacobsen
          6 hours ago




          Ok, that makes sense - Thanks for your answer!
          – Esben Boye-Jacobsen
          6 hours ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372201%2fvim-jump-to-line-and-change-from-another-line%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

          'app-layout' is not a known element: how to share Component with different Modules

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement