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

Re: Fixating the number of columns

Expand Messages
  • Tony Mechelynck
    ... I think this question is not specific to the Mac; I m resending this to the vim_use list. If you set the columns width to less than the maximum, it isn t
    Message 1 of 3 , Jul 22, 2014
    • 0 Attachment
      On Tuesday, July 22, 2014 12:38:49 AM UTC+2, Mikael Säker wrote:
      > I really like to work in full screen mode and also do ":set columns=90" or so to get a distraction free view of my files (see screenshot).
      >
      > However, the number of columns displayed is reset to max when I open some files (not sure what triggers that). Is it possible to somehow force the editor to stick to a certain number of columns?
      >
      > Cheers,
      >
      > Mikael

      I think this question is not specific to the Mac; I'm resending this to the vim_use list.

      If you set the 'columns' width to less than the maximum, it isn't full-screen mode; but it ought to be possible to use full height with less than full width, at least in gvim (in Console Vim it would mean resizing the underlying terminal, which is possible in some terminals and not in others), e.g. like this:

      if has('gui_running')
      set lines=999 columns=90
      endif

      Normally, plugins and scripts should not resize gvim. If you still see it happen, you can pin it on the culprit by means of

      :verbose set lines? columns?

      then if that script is yours you can correct it, and if it isn't you might be able to work around it by means of either a small script in an |after-directory|, or an |autocommand| for some well-chosen event.

      Note that if you try (or if some script tries) to set 'lines' and/or 'columns' to more than what is available, Vim will use the available maximum and adjust the option down to that; thus ":set lines=999" above intentionally uses more than the available number of lines in order to set gvim to full height. The above ":verbose set" etc. will show you that it is not actually set to nine hundred and ninety-nine lines.


      Best regards,
      Tony.
      --
      I suggest you locate your hot tub outside your house, so it won't do too
      much damage if it catches fire or explodes. First you decide which
      direction your hot tub should face for maximum solar energy. After much
      trial and error, I have found that the best direction for a hot tub to face
      is up.
      -- Dave Barry, "The Taming of the Screw"

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Tony Mechelynck
      ... If, OTOH, what you want is a full-size Vim with empty split windows on both sides of the current one, then it should also be possible, maybe this way
      Message 2 of 3 , Jul 22, 2014
      • 0 Attachment
        On 22/07/14 12:37, Tony Mechelynck wrote:
        > On Tuesday, July 22, 2014 12:38:49 AM UTC+2, Mikael Säker wrote:
        >> I really like to work in full screen mode and also do ":set columns=90" or so to get a distraction free view of my files (see screenshot).
        >>
        >> However, the number of columns displayed is reset to max when I open some files (not sure what triggers that). Is it possible to somehow force the editor to stick to a certain number of columns?
        >>
        >> Cheers,
        >>
        >> Mikael
        >
        > I think this question is not specific to the Mac; I'm resending this to the vim_use list.
        >
        > If you set the 'columns' width to less than the maximum, it isn't full-screen mode; but it ought to be possible to use full height with less than full width, at least in gvim (in Console Vim it would mean resizing the underlying terminal, which is possible in some terminals and not in others), e.g. like this:
        >
        > if has('gui_running')
        > set lines=999 columns=90
        > endif
        >
        > Normally, plugins and scripts should not resize gvim. If you still see it happen, you can pin it on the culprit by means of
        >
        > :verbose set lines? columns?
        >
        > then if that script is yours you can correct it, and if it isn't you might be able to work around it by means of either a small script in an |after-directory|, or an |autocommand| for some well-chosen event.
        >
        > Note that if you try (or if some script tries) to set 'lines' and/or 'columns' to more than what is available, Vim will use the available maximum and adjust the option down to that; thus ":set lines=999" above intentionally uses more than the available number of lines in order to set gvim to full height. The above ":verbose set" etc. will show you that it is not actually set to nine hundred and ninety-nine lines.
        >
        >
        > Best regards,
        > Tony.
        >

        If, OTOH, what you want is a full-size Vim with empty split windows on
        both sides of the current one, then it should also be possible, maybe
        this way (untested, and to be put in gvimrc, or in a function called at
        the GUIEnter event):

        set lines=999 columns=999
        if &columns > 90
        left vertical new
        wincmd w
        right vertical new
        wincmd W
        set winwidth=90
        wincmd =
        setlocal winfixwidth
        endif

        ":verbose set lines? columns?" (without the quotes of course) still
        applies to find out what altered your gvim size. For the sizes of the
        split-windows you could similarly ask

        :verbose set wfw? wiw? wmw?


        Best regards,
        Tony.
        --
        "Someone's been mean to you! Tell me who it is, so I can punch him
        tastefully."
        -- Ralph Bakshi's Mighty Mouse

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Mikael Säker
        ... Thanks. I ll try something like that. Mikael -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text
        Message 3 of 3 , Jul 30, 2014
        • 0 Attachment
          On Tuesday, July 22, 2014 12:38:08 PM UTC+2, Tony Mechelynck wrote:
          > On Tuesday, July 22, 2014 12:38:49 AM UTC+2, Mikael Säker wrote:
          >
          > > I really like to work in full screen mode and also do ":set columns=90" or so to get a distraction free view of my files (see screenshot).
          >
          > >
          >
          > > However, the number of columns displayed is reset to max when I open some files (not sure what triggers that). Is it possible to somehow force the editor to stick to a certain number of columns?
          >
          > >
          >
          > > Cheers,
          >
          > >
          >
          > > Mikael
          >
          >
          >
          > I think this question is not specific to the Mac; I'm resending this to the vim_use list.
          >
          >
          >
          > If you set the 'columns' width to less than the maximum, it isn't full-screen mode; but it ought to be possible to use full height with less than full width, at least in gvim (in Console Vim it would mean resizing the underlying terminal, which is possible in some terminals and not in others), e.g. like this:
          >
          >
          >
          > if has('gui_running')
          >
          > set lines=999 columns=90
          >
          > endif
          >
          >
          >
          > Normally, plugins and scripts should not resize gvim. If you still see it happen, you can pin it on the culprit by means of
          >
          >
          >
          > :verbose set lines? columns?
          >
          >
          >
          > then if that script is yours you can correct it, and if it isn't you might be able to work around it by means of either a small script in an |after-directory|, or an |autocommand| for some well-chosen event.
          >
          >
          >
          > Note that if you try (or if some script tries) to set 'lines' and/or 'columns' to more than what is available, Vim will use the available maximum and adjust the option down to that; thus ":set lines=999" above intentionally uses more than the available number of lines in order to set gvim to full height. The above ":verbose set" etc. will show you that it is not actually set to nine hundred and ninety-nine lines.
          >
          >
          >
          >
          >
          > Best regards,
          >
          > Tony.
          >
          > --
          >
          > I suggest you locate your hot tub outside your house, so it won't do too
          >
          > much damage if it catches fire or explodes. First you decide which
          >
          > direction your hot tub should face for maximum solar energy. After much
          >
          > trial and error, I have found that the best direction for a hot tub to face
          >
          > is up.
          >
          > -- Dave Barry, "The Taming of the Screw"

          Thanks. I'll try something like that.

          Mikael

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        Your message has been successfully submitted and would be delivered to recipients shortly.