How to insert and delete text in vi on Debian 9

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











up vote
0
down vote

favorite












I have only used vi on Debain 8 before and I was able to press "i" to add any text. Even delete was working fine. But now on Debian 9 it seems vi behaviour is different as pressing "i" nothing happens.



On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.



Right now I just want to change SSH port and for that I simply want to delete character "#" and change port 22 to something else but I can't even do this simple task now.



Is there a command tutorial available for vi on Debian 9?







share|improve this question






















  • esc esc i does it work?
    – Rui F Ribeiro
    Nov 29 '17 at 7:40














up vote
0
down vote

favorite












I have only used vi on Debain 8 before and I was able to press "i" to add any text. Even delete was working fine. But now on Debian 9 it seems vi behaviour is different as pressing "i" nothing happens.



On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.



Right now I just want to change SSH port and for that I simply want to delete character "#" and change port 22 to something else but I can't even do this simple task now.



Is there a command tutorial available for vi on Debian 9?







share|improve this question






















  • esc esc i does it work?
    – Rui F Ribeiro
    Nov 29 '17 at 7:40












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have only used vi on Debain 8 before and I was able to press "i" to add any text. Even delete was working fine. But now on Debian 9 it seems vi behaviour is different as pressing "i" nothing happens.



On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.



Right now I just want to change SSH port and for that I simply want to delete character "#" and change port 22 to something else but I can't even do this simple task now.



Is there a command tutorial available for vi on Debian 9?







share|improve this question














I have only used vi on Debain 8 before and I was able to press "i" to add any text. Even delete was working fine. But now on Debian 9 it seems vi behaviour is different as pressing "i" nothing happens.



On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.



Right now I just want to change SSH port and for that I simply want to delete character "#" and change port 22 to something else but I can't even do this simple task now.



Is there a command tutorial available for vi on Debian 9?









share|improve this question













share|improve this question




share|improve this question








edited Aug 25 at 21:25









Rui F Ribeiro

35.7k1271114




35.7k1271114










asked Nov 29 '17 at 6:31









Frank Martin

1083




1083











  • esc esc i does it work?
    – Rui F Ribeiro
    Nov 29 '17 at 7:40
















  • esc esc i does it work?
    – Rui F Ribeiro
    Nov 29 '17 at 7:40















esc esc i does it work?
– Rui F Ribeiro
Nov 29 '17 at 7:40




esc esc i does it work?
– Rui F Ribeiro
Nov 29 '17 at 7:40










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










Usually, on Debian 9, /usr/bin/vi is a symlink to vim or vim-tiny in version 8.0, while on Debian 8 it's been a symlink to version 7.4. Absolutely nothing has changed about the absolute basic commands like i or x. Even in readonly mode (option -R or started with command view) the commands work, just issuing a warning about changing a readonly file. Even the horrible "easy" mode (option -y) doesn't produce behaviour like you describe.



Bottom line: This is not caused by simply switching from Debian 8 to 9.



What to do:




  • type vi will tell you what you are actually executing, for example /usr/bin/vi


  • vi --version should tell you what you are really executing

  • If it's really some vi or vim, you are using some really weird keybindings! Test whether it's local or global by trying as another user

Update after reading OP's comment:



"On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.", so pressing i actually does something: it puts you in insert mode as before. You are just irritated because nothing is displayed in the last line. In this respect there should also not be any differences between Debian 8 and 9.



Two possible causes for this behaviour:



  • You have set noshowmode somewhere in your ~/.vimrc or some other configuration source. Type :set showmode or :set smd and see whether the behaviour is as you are used to. If yes, check for set nosmd or noshowmode in your or the system's vim configuration and remove it.

  • Or the locale you are using is defect. Do LANG=C and then start vi.





share|improve this answer





























    up vote
    0
    down vote













    if you have vi/vim installed then vimtutor should be on your machine, just enter that at the command line and follow the walkthrough.



    If you are familiar with vi then try vim, which is an improved vi but uses substantially the same controls, and see if that works as expected.



    The behaviour of i/esc to get in and out of edit mode should not have changed with the kernel update.






    share|improve this answer
















    • 1




      On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
      – Frank Martin
      Nov 29 '17 at 9:22










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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%2funix.stackexchange.com%2fquestions%2f407656%2fhow-to-insert-and-delete-text-in-vi-on-debian-9%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    Usually, on Debian 9, /usr/bin/vi is a symlink to vim or vim-tiny in version 8.0, while on Debian 8 it's been a symlink to version 7.4. Absolutely nothing has changed about the absolute basic commands like i or x. Even in readonly mode (option -R or started with command view) the commands work, just issuing a warning about changing a readonly file. Even the horrible "easy" mode (option -y) doesn't produce behaviour like you describe.



    Bottom line: This is not caused by simply switching from Debian 8 to 9.



    What to do:




    • type vi will tell you what you are actually executing, for example /usr/bin/vi


    • vi --version should tell you what you are really executing

    • If it's really some vi or vim, you are using some really weird keybindings! Test whether it's local or global by trying as another user

    Update after reading OP's comment:



    "On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.", so pressing i actually does something: it puts you in insert mode as before. You are just irritated because nothing is displayed in the last line. In this respect there should also not be any differences between Debian 8 and 9.



    Two possible causes for this behaviour:



    • You have set noshowmode somewhere in your ~/.vimrc or some other configuration source. Type :set showmode or :set smd and see whether the behaviour is as you are used to. If yes, check for set nosmd or noshowmode in your or the system's vim configuration and remove it.

    • Or the locale you are using is defect. Do LANG=C and then start vi.





    share|improve this answer


























      up vote
      3
      down vote



      accepted










      Usually, on Debian 9, /usr/bin/vi is a symlink to vim or vim-tiny in version 8.0, while on Debian 8 it's been a symlink to version 7.4. Absolutely nothing has changed about the absolute basic commands like i or x. Even in readonly mode (option -R or started with command view) the commands work, just issuing a warning about changing a readonly file. Even the horrible "easy" mode (option -y) doesn't produce behaviour like you describe.



      Bottom line: This is not caused by simply switching from Debian 8 to 9.



      What to do:




      • type vi will tell you what you are actually executing, for example /usr/bin/vi


      • vi --version should tell you what you are really executing

      • If it's really some vi or vim, you are using some really weird keybindings! Test whether it's local or global by trying as another user

      Update after reading OP's comment:



      "On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.", so pressing i actually does something: it puts you in insert mode as before. You are just irritated because nothing is displayed in the last line. In this respect there should also not be any differences between Debian 8 and 9.



      Two possible causes for this behaviour:



      • You have set noshowmode somewhere in your ~/.vimrc or some other configuration source. Type :set showmode or :set smd and see whether the behaviour is as you are used to. If yes, check for set nosmd or noshowmode in your or the system's vim configuration and remove it.

      • Or the locale you are using is defect. Do LANG=C and then start vi.





      share|improve this answer
























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        Usually, on Debian 9, /usr/bin/vi is a symlink to vim or vim-tiny in version 8.0, while on Debian 8 it's been a symlink to version 7.4. Absolutely nothing has changed about the absolute basic commands like i or x. Even in readonly mode (option -R or started with command view) the commands work, just issuing a warning about changing a readonly file. Even the horrible "easy" mode (option -y) doesn't produce behaviour like you describe.



        Bottom line: This is not caused by simply switching from Debian 8 to 9.



        What to do:




        • type vi will tell you what you are actually executing, for example /usr/bin/vi


        • vi --version should tell you what you are really executing

        • If it's really some vi or vim, you are using some really weird keybindings! Test whether it's local or global by trying as another user

        Update after reading OP's comment:



        "On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.", so pressing i actually does something: it puts you in insert mode as before. You are just irritated because nothing is displayed in the last line. In this respect there should also not be any differences between Debian 8 and 9.



        Two possible causes for this behaviour:



        • You have set noshowmode somewhere in your ~/.vimrc or some other configuration source. Type :set showmode or :set smd and see whether the behaviour is as you are used to. If yes, check for set nosmd or noshowmode in your or the system's vim configuration and remove it.

        • Or the locale you are using is defect. Do LANG=C and then start vi.





        share|improve this answer














        Usually, on Debian 9, /usr/bin/vi is a symlink to vim or vim-tiny in version 8.0, while on Debian 8 it's been a symlink to version 7.4. Absolutely nothing has changed about the absolute basic commands like i or x. Even in readonly mode (option -R or started with command view) the commands work, just issuing a warning about changing a readonly file. Even the horrible "easy" mode (option -y) doesn't produce behaviour like you describe.



        Bottom line: This is not caused by simply switching from Debian 8 to 9.



        What to do:




        • type vi will tell you what you are actually executing, for example /usr/bin/vi


        • vi --version should tell you what you are really executing

        • If it's really some vi or vim, you are using some really weird keybindings! Test whether it's local or global by trying as another user

        Update after reading OP's comment:



        "On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text.", so pressing i actually does something: it puts you in insert mode as before. You are just irritated because nothing is displayed in the last line. In this respect there should also not be any differences between Debian 8 and 9.



        Two possible causes for this behaviour:



        • You have set noshowmode somewhere in your ~/.vimrc or some other configuration source. Type :set showmode or :set smd and see whether the behaviour is as you are used to. If yes, check for set nosmd or noshowmode in your or the system's vim configuration and remove it.

        • Or the locale you are using is defect. Do LANG=C and then start vi.






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 29 '17 at 9:51

























        answered Nov 29 '17 at 9:31









        Philippos

        5,91211546




        5,91211546






















            up vote
            0
            down vote













            if you have vi/vim installed then vimtutor should be on your machine, just enter that at the command line and follow the walkthrough.



            If you are familiar with vi then try vim, which is an improved vi but uses substantially the same controls, and see if that works as expected.



            The behaviour of i/esc to get in and out of edit mode should not have changed with the kernel update.






            share|improve this answer
















            • 1




              On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
              – Frank Martin
              Nov 29 '17 at 9:22














            up vote
            0
            down vote













            if you have vi/vim installed then vimtutor should be on your machine, just enter that at the command line and follow the walkthrough.



            If you are familiar with vi then try vim, which is an improved vi but uses substantially the same controls, and see if that works as expected.



            The behaviour of i/esc to get in and out of edit mode should not have changed with the kernel update.






            share|improve this answer
















            • 1




              On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
              – Frank Martin
              Nov 29 '17 at 9:22












            up vote
            0
            down vote










            up vote
            0
            down vote









            if you have vi/vim installed then vimtutor should be on your machine, just enter that at the command line and follow the walkthrough.



            If you are familiar with vi then try vim, which is an improved vi but uses substantially the same controls, and see if that works as expected.



            The behaviour of i/esc to get in and out of edit mode should not have changed with the kernel update.






            share|improve this answer












            if you have vi/vim installed then vimtutor should be on your machine, just enter that at the command line and follow the walkthrough.



            If you are familiar with vi then try vim, which is an improved vi but uses substantially the same controls, and see if that works as expected.



            The behaviour of i/esc to get in and out of edit mode should not have changed with the kernel update.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 29 '17 at 7:38









            bu5hman

            1,164214




            1,164214







            • 1




              On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
              – Frank Martin
              Nov 29 '17 at 9:22












            • 1




              On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
              – Frank Martin
              Nov 29 '17 at 9:22







            1




            1




            On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
            – Frank Martin
            Nov 29 '17 at 9:22




            On Debian 8 when you press "i" then it says at the bottom "INSERT" which means now you can start changing text. On Debian 9 pressing "i" does nothing but if I press it twice then it shows one "i" and then I can write remaining text. I got the hang of it but I went ahead and used nano as suggested by @saga
            – Frank Martin
            Nov 29 '17 at 9:22

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407656%2fhow-to-insert-and-delete-text-in-vi-on-debian-9%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay