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

Feature request: change settings using ncurses menus (TUI)

Expand Messages
  • Parker Jones
    Changing settings is something that I and perhaps many other users don t do often, so it s less familiar than other parts of vim. It would be a great
    Message 1 of 8 , Nov 3, 2009
    • 0 Attachment
      Changing settings is something that I and perhaps many other users don't do often, so it's less familiar than other parts of vim.  It would be a great development if it were easier to change settings by having a curses menu driven interface (obviously without replacing the existing command line input). 

      Recently, I wanted to change the syntax highlighting language, but even after spending 15 minutes reading the documentation I got fed up and gave up.  It really shouldn't be that hard.  A menu-driven interface could solve this by just letting the user pick out settings from a list and likewise choose from possible values.

      I have been using vi[m] for 20 years and it as always been my editor of choice.  Even though I use it for hours a day, one area has always proved to be a pain: changing settings.

      Cheers,
      Parker


      New Windows 7: Find the right PC for you. Learn more.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    • Parker Jones
      Hmm. Perhaps this was the wrong mailing list. I ll repost on vim users mailing list. Changing settings is something that I and perhaps many other users don t
      Message 2 of 8 , Nov 3, 2009
      • 0 Attachment
        Hmm.  Perhaps this was the wrong mailing list.  I'll repost on vim users mailing list.



        Changing settings is something that I and perhaps many other users don't do often, so it's less familiar than other parts of vim.  It would be a great development if it were easier to change settings by having a curses menu driven interface (obviously without replacing the existing command line input). 

        Recently, I wanted to change the syntax highlighting language, but even after spending 15 minutes reading the documentation I got fed up and gave up.  It really shouldn't be that hard.  A menu-driven interface could solve this by just letting the user pick out settings from a list and likewise choose from possible values.

        I have been using vi[m] for 20 years and it as always been my editor of choice.  Even though I use it for hours a day, one area has always proved to be a pain: changing settings.

        Cheers,
        Parker


        New Windows 7: Find the right PC for you. Learn more.



        Windows 7: Make your own home movies. Learn more.
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---

      • Gary Johnson
        ... Have you tried this? ... It s not exactly what you re looking for, but it s similar. ... I don t see how a menu-driven interface will help with this.
        Message 3 of 8 , Nov 3, 2009
        • 0 Attachment
          On 2009-11-04, Parker Jones wrote:
          > Changing settings is something that I and perhaps many other users don't do
          > often, so it's less familiar than other parts of vim. It would be a great
          > development if it were easier to change settings by having a curses menu driven
          > interface (obviously without replacing the existing command line input).

          Have you tried this?

          :options

          It's not exactly what you're looking for, but it's similar.

          > Recently, I wanted to change the syntax highlighting language, but even after
          > spending 15 minutes reading the documentation I got fed up and gave up. It
          > really shouldn't be that hard. A menu-driven interface could solve this by
          > just letting the user pick out settings from a list and likewise choose from
          > possible values.

          I don't see how a menu-driven interface will help with this.
          Writing syntax highlighting rules is more akin to writing a program
          than it is to choosing option settings.

          HTH,
          Gary



          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • James Vega
          ... I think this is referring to changing the filetype for a buffer, not changing the syntax highlighting rules. -- James GPG Key: 1024D/61326D40 2003-09-02
          Message 4 of 8 , Nov 3, 2009
          • 0 Attachment
            On Tue, Nov 03, 2009 at 11:02:38PM -0800, Gary Johnson wrote:
            > On 2009-11-04, Parker Jones wrote:
            > > Recently, I wanted to change the syntax highlighting language, but even after
            > > spending 15 minutes reading the documentation I got fed up and gave up. It
            > > really shouldn't be that hard. A menu-driven interface could solve this by
            > > just letting the user pick out settings from a list and likewise choose from
            > > possible values.
            >
            > I don't see how a menu-driven interface will help with this.
            > Writing syntax highlighting rules is more akin to writing a program
            > than it is to choosing option settings.

            I think this is referring to changing the filetype for a buffer, not
            changing the syntax highlighting rules.

            --
            James
            GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@...>
          • Gary Johnson
            ... OH. I see now. Thanks. If that s the case, then executing ... where the set of values can be found from ... seems pretty simple to me. Yes, I
            Message 5 of 8 , Nov 3, 2009
            • 0 Attachment
              On 2009-11-04, James Vega wrote:
              > On Tue, Nov 03, 2009 at 11:02:38PM -0800, Gary Johnson wrote:
              > > On 2009-11-04, Parker Jones wrote:
              > > > Recently, I wanted to change the syntax highlighting language, but even after
              > > > spending 15 minutes reading the documentation I got fed up and gave up. It
              > > > really shouldn't be that hard. A menu-driven interface could solve this by
              > > > just letting the user pick out settings from a list and likewise choose from
              > > > possible values.
              > >
              > > I don't see how a menu-driven interface will help with this.
              > > Writing syntax highlighting rules is more akin to writing a program
              > > than it is to choosing option settings.
              >
              > I think this is referring to changing the filetype for a buffer, not
              > changing the syntax highlighting rules.

              OH. I see now. Thanks.

              If that's the case, then executing

              :set ft=<filetype>

              where the set of <filetype> values can be found from

              :!ls $VIMRUNTIME/syntax

              seems pretty simple to me. Yes, I realize that's not nearly as
              clear and straightforward as selecting the file type from a menu,
              but a user should very rarely need to select the file type manually;
              Vim should almost always be able to determine the file type
              automatically.

              If Vim is not able to determine the correct file type automatically,
              the proper solution is to give it better guidance in the user's
              ~/.vim/filetype.vim, not require the user to set the file type
              manually every time he opens such a file.

              Regards,
              Gary



              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Christian Brabandt
              ... How about something like this: if !exists( s:ftlist ) let s:ftlist=map(split(globpath(&rtp, **/syntax/*.vim ), n ), fnamemodify(v:val, :t:r ) ) endif
              Message 6 of 8 , Nov 4, 2009
              • 0 Attachment
                On Wed, November 4, 2009 8:40 am, Gary Johnson wrote:
                > On 2009-11-04, James Vega wrote:
                >> I think this is referring to changing the filetype for a buffer, not
                >> changing the syntax highlighting rules.
                >
                > OH. I see now. Thanks.
                >
                > If that's the case, then executing
                >
                > :set ft=<filetype>
                >
                > where the set of <filetype> values can be found from
                >
                > :!ls $VIMRUNTIME/syntax
                >
                > seems pretty simple to me. Yes, I realize that's not nearly as
                > clear and straightforward as selecting the file type from a menu,
                > but a user should very rarely need to select the file type manually;
                > Vim should almost always be able to determine the file type
                > automatically.

                How about something like this:

                if !exists("s:ftlist")
                let s:ftlist=map(split(globpath(&rtp, "**/syntax/*.vim"), "\n"),
                'fnamemodify(v:val, ":t:r")')
                endif

                :com -nargs=1 -complete=customlist,<SID>FileTypeComplete Filetype :set
                ft=<args>

                fu! <SID>FileTypeComplete(ArgLead,CmdLine,CursorPos)
                let l=filter(copy(s:ftlist), 'v:val =~ "^".a:ArgLead')
                return sort(l)
                endfu

                > If Vim is not able to determine the correct file type automatically,
                > the proper solution is to give it better guidance in the user's
                > ~/.vim/filetype.vim, not require the user to set the file type
                > manually every time he opens such a file.

                true.

                regards,
                Christian


                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Marko Mahnič
                ... A curses menu implementation is provided with this library: http://www.vim.org/scripts/script.php?script_id=2606 It requires Python with ncurses. If you
                Message 7 of 8 , Nov 4, 2009
                • 0 Attachment
                  On Nov 3, 1:43 pm, Parker Jones <zoubi...@...> wrote:
                  > Changing settings is something that I and perhaps many other users don't do often, so it's less familiar than other parts of vim.  It would be a great development if it were easier to change settings by having a curses menu driven interface (obviously without replacing the existing command line input).  

                  A curses menu implementation is provided with this library:
                  http://www.vim.org/scripts/script.php?script_id=2606

                  It requires Python with ncurses. If you want to use the same menus
                  and other extras in gvim, a patch for if_python is required.

                  A newer (pre-release) version is also available at
                  http://sourceforge.net/projects/vimuiex/
                  http://vimuiex.sourceforge.net

                  Marko
                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Tony Mechelynck
                  ... I thought the OP _was_ referring to constructing a syntax script, which is indeed a kind of programming and would IMHO not benefit at all from a
                  Message 8 of 8 , Nov 28, 2009
                  • 0 Attachment
                    On 04/11/09 08:40, Gary Johnson wrote:
                    >
                    > On 2009-11-04, James Vega wrote:
                    >> On Tue, Nov 03, 2009 at 11:02:38PM -0800, Gary Johnson wrote:
                    >>> On 2009-11-04, Parker Jones wrote:
                    >>>> Recently, I wanted to change the syntax highlighting language, but even after
                    >>>> spending 15 minutes reading the documentation I got fed up and gave up. It
                    >>>> really shouldn't be that hard. A menu-driven interface could solve this by
                    >>>> just letting the user pick out settings from a list and likewise choose from
                    >>>> possible values.
                    >>>
                    >>> I don't see how a menu-driven interface will help with this.
                    >>> Writing syntax highlighting rules is more akin to writing a program
                    >>> than it is to choosing option settings.
                    >>
                    >> I think this is referring to changing the filetype for a buffer, not
                    >> changing the syntax highlighting rules.
                    >
                    > OH. I see now. Thanks.
                    >
                    > If that's the case, then executing
                    >
                    > :set ft=<filetype>
                    >
                    > where the set of<filetype> values can be found from
                    >
                    > :!ls $VIMRUNTIME/syntax
                    >
                    > seems pretty simple to me. Yes, I realize that's not nearly as
                    > clear and straightforward as selecting the file type from a menu,
                    > but a user should very rarely need to select the file type manually;
                    > Vim should almost always be able to determine the file type
                    > automatically.
                    >
                    > If Vim is not able to determine the correct file type automatically,
                    > the proper solution is to give it better guidance in the user's
                    > ~/.vim/filetype.vim, not require the user to set the file type
                    > manually every time he opens such a file.
                    >
                    > Regards,
                    > Gary

                    I thought the OP _was_ referring to constructing a syntax script, which
                    is indeed a kind of programming and would IMHO not benefit at all from a
                    menu-driven interface.

                    However, if the matter is merely choosing among the existing "known"
                    filetypes, then there _is_ a menu, however you must first enable it by
                    using "Syntax => Show filetypes in menu". Then you get a menu for
                    setting the 'syntax' option. Experiment shows that it also sets the
                    filetype, e.g., after you've added the filetypes to the Syntax menu,
                    clicking "Syntax => A => Aap" sets both 'filetype' and 'syntax' to "aap".

                    In Console Vim, it is possible to use the same menus as in gvim,
                    provided that your Console Vim is compiled with +menu. They look
                    slightly different because of the differences between a text interface
                    and a GUI; and they are at bottom rather than at top. See ":help
                    console-menus" about how to enable them in your vimrc.

                    I agree that automatic setting of filetypes is the Vim-like way to go.
                    Some filetypes are so similar that user guidance (I mean, guidance
                    _from_ the user _to_ filetype.vim) can help discriminate among them.
                    This can be done either by means of global options, or of modelines,
                    depending on the particular circumstances. For details, see:
                    :help filetype.txt
                    :help syntax.txt

                    Best regards,
                    Tony.
                    --
                    More than any time in history, mankind now faces a crossroads. One
                    path leads to despair and utter hopelessness, the other to total
                    extinction. Let us pray that we have the wisdom to choose correctly.
                    -- Woody Allen

                    --
                    You received this message from the "vim_dev" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                  Your message has been successfully submitted and would be delivered to recipients shortly.