Loading ...
Sorry, an error occurred while loading the content.
 

Why does Vim still have vi-compatibility mode?

Expand Messages
  • Dmitry Frank
    Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it? As a consequence, we have to keep set nocompatible in our .vimrc;
    Message 1 of 7 , May 29, 2014

      Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it?

      As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in Vi}, {Vi: no ++opt}, etc.

      and I can't really understand why developers keep it so carefully.


      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Benjamin Klein
      ... (Disclaimer: I m not an official Vim developer and don t necessarily know the official reasons myself.) Tim Pope brought up the vi equivalent issue when
      Message 2 of 7 , May 29, 2014
        On May 29, 2014, at 4:50 AM, Dmitry Frank <dimon.frank@...> wrote:

        Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it?

        As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in Vi}, {Vi: no ++opt}, etc.

        and I can't really understand why developers keep it so carefully.


        (Disclaimer: I'm not an official Vim developer and don't necessarily know the official reasons myself.)

        Tim Pope brought up the "vi equivalent" issue when Neovim was announced, I think back in February.

        "#1 concern about neovim is that dropping compatibility mode prevents OS's from shipping it as vi. That's a big perk of vim"

        That could have something to do with it.

        On the other hand, I am on OS X, which is one of those OSs. I installed Vim using Homebrew anyway -- and I don't actually often use many other computers than my own (though I realize that many must). So the "Vim is everywhere" argument, for me, has very little to do with why I use it, and is no argument (for me personally!) in favor of compatibility mode.

        The mileage of the sane rest of the universe probably varies.

        Ben

        --
        b

        Sent from my iPhone

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • tux.
        ... What s wrong with that? If you don t want that, use NeoVim or something. -- -- You received this message from the vim_dev maillist. Do not top-post! Type
        Message 3 of 7 , May 29, 2014
          Dmitry Frank schrob am Donnerstag, 29. Mai 2014 um 11:50 Zeit:

          > and I can't really understand why developers keep it so carefully.

          What's wrong with that?

          If you don't want that, use NeoVim or something.

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • glts
          Hi, ... vi is part of the POSIX standard, IEEE Std 1003.1. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html -- David -- -- You received this
          Message 4 of 7 , May 29, 2014
            Hi,

            On Thursday, May 29, 2014 11:50:47 AM UTC+2, Dmitry Frank wrote:
            > Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it?
            >
            >
            > As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in Vi}, {Vi: no ++opt}, etc.
            >
            >
            > and I can't really understand why developers keep it so carefully.

            vi is part of the POSIX standard, IEEE Std 1003.1.

            http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html


            --
            David

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • Christian Brabandt
            ... No: ,----[ :h cp ]- ... `---- Mit freundlichen Grüßen Christian -- Das Leben ist eine Treppe: Wir wissen nie, ob es mit uns aufwärts oder abwärts
            Message 5 of 7 , May 29, 2014
              On Do, 29 Mai 2014, Dmitry Frank wrote:

              > Could anyone explain why does Vim still have vi-compatibility mode? Why
              > would one use it?
              >
              > As a consequence, we have to keep set nocompatible in our .vimrc; there is

              No:

              ,----[ :h 'cp' ]-
              | When a |vimrc| or |gvimrc| file is found while Vim is starting up,
              | this option is switched off, and all options that have not been
              | modified will be set to the Vim defaults. Effectively, this means
              | that when a |vimrc| or |gvimrc| file exists, Vim will use the Vim
              | defaults, otherwise it will use the Vi defaults. (Note: This doesn't
              | happen for the system-wide vimrc or gvimrc file, nor for a file given
              | with the |-u| argument). Also see |compatible-default| and
              | |posix-compliance|.
              `----

              Mit freundlichen Grüßen
              Christian
              --
              Das Leben ist eine Treppe: Wir wissen nie, ob es mit uns aufwärts oder
              abwärts geht.
              -- Ernst R. Hauschka

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Kerneels Roos
              ... never forget your roots.... nor your humble beginnings..... nor your grandpa! :p ... -- Kerneels Roos Cell: +27 (0)79 696 6038 Tel: +27 (0)811 2108
              Message 6 of 7 , May 29, 2014
                On 2014-05-29 01:46 PM, Christian Brabandt wrote:
                > On Do, 29 Mai 2014, Dmitry Frank wrote:
                >
                >> Could anyone explain why does Vim still have vi-compatibility mode? Why
                >> would one use it?
                never forget your roots....
                nor your humble beginnings.....
                nor your grandpa! :p

                >> As a consequence, we have to keep set nocompatible in our .vimrc; there is
                > No:
                >
                > ,----[ :h 'cp' ]-
                > | When a |vimrc| or |gvimrc| file is found while Vim is starting up,
                > | this option is switched off, and all options that have not been
                > | modified will be set to the Vim defaults. Effectively, this means
                > | that when a |vimrc| or |gvimrc| file exists, Vim will use the Vim
                > | defaults, otherwise it will use the Vi defaults. (Note: This doesn't
                > | happen for the system-wide vimrc or gvimrc file, nor for a file given
                > | with the |-u| argument). Also see |compatible-default| and
                > | |posix-compliance|.
                > `----
                >
                > Mit freundlichen Grüßen
                > Christian

                --
                Kerneels Roos
                Cell: +27 (0)79 696 6038
                Tel: +27 (0)811 2108
                LinkedIn: http://za.linkedin.com/in/kerneels

                Skype: cornelis.roos

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              • Tony Mechelynck
                ... I think the basic reason is that Bram finds backwards compatibility important, and I can t fault him with that. Anyway, as Christian said, as soon as Vim
                Message 7 of 7 , Jun 7, 2014
                  On 29/05/14 11:50, Dmitry Frank wrote:
                  > Could anyone explain why does Vim still have vi-compatibility mode? Why
                  > would one use it?
                  >
                  > As a consequence, we have to keep |set nocompatible| in our |.vimrc|;
                  > there is much noise in docs like |{not in Vi}|, |{Vi: no ++opt}|, etc.
                  >
                  > and I can't really understand why developers keep it so carefully.
                  >

                  I think the basic reason is that Bram finds backwards compatibility
                  important, and I can't fault him with that. Anyway, as Christian said,
                  as soon as Vim finds your vimrc it will set 'nocompatible' (except when
                  using the -u option), so ":set nocompatible" isn't needed unless there
                  might be times when you would include your vimrc by means of the -u
                  option; and even then you may add -N on the same command-line to achieve
                  the same effect.

                  There may still be users around who came to Vim from Vi and who never
                  came around to use 'nocompatible' mode, or to set their customizations
                  by means of a vimrc rather than an exrc. I think I've met some such
                  people on vim_use occasionally.

                  Also, Vi is part of the POSIX standard, and that standard describes in
                  excruciating detail how the program must behave. See ":help
                  posix-compliance" for the details: when $VIM_POSIX is set, Vim will even
                  copy some details of Vi behaviour which Bram regards as clear bugs (and
                  which it doesn't copy in non-POSIX 'compatible' mode).

                  If you want 'nocompatible' mode, as I do, make sure to put the -N switch
                  on the Vim command-line whenever you also include -u (be it as -u NONE
                  or -u filename.vim) and also when you aren't sure that there is a .vimrc
                  or a _vimrc in your current $HOME directory.


                  Best regards,
                  Tony.
                  --
                  ~
                  ~
                  ~
                  ".signature" 4 lines, 50 characters written

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/d/optout.
                Your message has been successfully submitted and would be delivered to recipients shortly.