Tuesday, July 22, 2014

Re: Fixating the number of columns

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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: