Vim: Jump to line and change from another line?












0















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



























    0















    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

























      0












      0








      0








      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 Nov 19 '18 at 10:01









      Esben Boye-JacobsenEsben Boye-Jacobsen

      761414




      761414
























          1 Answer
          1






          active

          oldest

          votes


















          3














          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
            Nov 19 '18 at 16:46











          • Ok, that makes sense - Thanks for your answer!

            – Esben Boye-Jacobsen
            Nov 20 '18 at 8:07











          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',
          autoActivateHeartbeat: false,
          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









          3














          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
            Nov 19 '18 at 16:46











          • Ok, that makes sense - Thanks for your answer!

            – Esben Boye-Jacobsen
            Nov 20 '18 at 8:07
















          3














          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
            Nov 19 '18 at 16:46











          • Ok, that makes sense - Thanks for your answer!

            – Esben Boye-Jacobsen
            Nov 20 '18 at 8:07














          3












          3








          3







          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 Nov 19 '18 at 10:24









          Ingo KarkatIngo Karkat

          132k14148198




          132k14148198








          • 1





            Agreed, use 95G instead of :95

            – Conner
            Nov 19 '18 at 16:46











          • Ok, that makes sense - Thanks for your answer!

            – Esben Boye-Jacobsen
            Nov 20 '18 at 8:07














          • 1





            Agreed, use 95G instead of :95

            – Conner
            Nov 19 '18 at 16:46











          • Ok, that makes sense - Thanks for your answer!

            – Esben Boye-Jacobsen
            Nov 20 '18 at 8:07








          1




          1





          Agreed, use 95G instead of :95

          – Conner
          Nov 19 '18 at 16:46





          Agreed, use 95G instead of :95

          – Conner
          Nov 19 '18 at 16:46













          Ok, that makes sense - Thanks for your answer!

          – Esben Boye-Jacobsen
          Nov 20 '18 at 8:07





          Ok, that makes sense - Thanks for your answer!

          – Esben Boye-Jacobsen
          Nov 20 '18 at 8:07




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • 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%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







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini