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

Re: String options

Expand Messages
  • Antoine J. Mechelynck
    ... Anyway, in the rare case where it might be useful, you can use the following construct, which is not really complicated: if &fo =~ a set fo-=a else set
    Message 1 of 72 , Jan 6, 2005
      Bram Moolenaar wrote:
      > Jens Paulus wrote:
      >
      >
      >>8. String options
      >>There should be a way to toggle flags in string options. For example
      >>set invfo=a could toggle the a flag in the fo option. To toggle
      >>formatting here is a function to toggle flags in an option.
      >>fun Toggle(opname,flag)
      >
      > [...]
      >
      > Why would a user want to toggle a flag in a string option? Sounds quite
      > uncommon to me. The user would normally want to switch something on or
      > off. After a toggle you don't know what you get.
      >
      Anyway, in the rare case where it might be useful, you can use the
      following construct, which is not really complicated:

      if &fo =~ "a"
      set fo-=a
      else
      set fo+=a
      endif

      Best regards,
      Tony.
    • Jens Paulus
      Hi Bram, ... actually this is surprising. Here is again what causes problems. q:icolorscheme blue q:icolorscheme default q:icolorscheme
      Message 72 of 72 , Jan 14, 2005
        Hi Bram,

        On Fri, Jan 14, 2005 at 12:30:35 +0100, Bram Moolenaar wrote:
        > > On Tue, Jan 11, 2005 at 20:04:11 +0100, Jens Paulus wrote:
        > > > > > When changing the color scheme in gvim and maybe also in vim with q:so
        > > > > > $VIMRUNTIME/colors/file.vim the text background is not set correctly and
        > > > > > ggVGV needs to be done to set it right.
        > > > >
        > > > > Works fine for me. Please be more specific.
        > > > >
        > > > > Note that you are supposed to use the ":colorscheme" command to select a
        > > > > color scheme.
        > > >
        > > > now after trying the same with the :colorscheme command it is obvious
        > > > that there is the same problem like when using the :source command. Try
        > > > it out, open the command line window with the q: command and load
        > > > different color schemes in a row, load each of them using the command
        > > > line window.
        > >
        > > please let me know if this is reproduceable when you do it.
        >
        > No, I don't see any problems with colors.

        actually this is surprising. Here is again what causes problems.

        q:icolorscheme blue<Esc><CR>
        q:icolorscheme default<Esc><CR>
        q:icolorscheme darkblue<Esc><CR>
        q:icolorscheme default<Esc><CR>

        This can be continued.

        Best regards

        Jens
      Your message has been successfully submitted and would be delivered to recipients shortly.