Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:04:51+00:00 2026-05-27T05:04:51+00:00

I have my Vim window set to 90 columns using set columns=90 , but

  • 0

I have my Vim window set to 90 columns using set columns=90, but this causes problems when commands (pyunit-vim, in particular) open new vertical splits, because each window then only has 45 columns, which is far too narrow. Ideally, I’d like to add splits to the existing width, rather than impinge upon it. Is there some way to specify this behaviour?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:04:52+00:00Added an answer on May 27, 2026 at 5:04 am

    EDIT: just noticed possible duplicate comment, after I’d entered this answer. That code there looks a bit better and more general purpose than mine (mine is targeted at OP who was dealing with one wide or two-wide splits). Also, I think you could delete WinLeave autocmd in mine, since leaving a window will be paired with entering a different window in scenarios I can think of.

    I think you can get close to what you want by assigning autocmds to WinEnter and WinLeave. The code below sets things up to call a size-adjusting function whenever you enter or leave a window. A better event for entry, I think, may be BufWinEnter. You may need to tweak, but code similar to this in your vimrc would work, I think:

    autocmd WinEnter * call AdjustSize()
    autocmd WinLeave * call AdjustSize()
    function! AdjustSize()
        if (winwidth('%')<50) && (&columns<=90)
            set columns = 2 * &columns
            "then make widths the same
            exe "normal! \<c-w>="
        else 
            set columns=90
            " or adjust size only if window isnt' huge...
            " if columns >= 150
            "     set columns = 90
            " endif
        endif
    endfunction
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a Vim window open with 2 splits in it (3 total
I'm using Perforce with Vim on Windows. I currently have an auto command set
I'm using Vim for editing source code, but I would also like to have
I'm relatively new to Vim and have been using it without issues so far.
In vim, I can have a nice small window that lists all my open
I have these Vim mappings for Git. Most of the commands below work, but
I have installed the vim-latex package using Ubuntu Synaptic package manager and updated my
Depending on my task in Vim I have several tabs open. How can I
I have recently started using Vim as my text editor and am currently working
I have NERDTree on the left side of my Vim's window (and the main

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.