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