How to increase the vertical split window size in Vim

后端 未结 9 1624
抹茶落季
抹茶落季 2020-12-22 15:57

:vsplit (short form: :vs) split the Vim viewport vertically. :30vs splits the viewport, making the new window 30 characters wide. Once

相关标签:
9条回答
  • 2020-12-22 16:07

    I am using the below commands for this:

    set lines=50     " For increasing the height to 50 lines (vertical)
    set columns=200  " For increasing the width to 200 columns (horizontal)
    
    0 讨论(0)
  • 2020-12-22 16:12

    Along the same lines, I use the following in my .vimrc to let me move through the splits, automatically expanding the one I'm moving to to its full size and shrinking all the rest to their minimum height or width:

    " Switch between window splits using big J or K and expand the split to its 
    " full size. 
    " 
    " Move vertically in the window through the horizontal splits... 
    map <C-J> <C-w>j<C-w>_ 
    map <C-K> <C-w>k<C-w>_ 
    
    " Move horizontally in the window through the vertical splits... 
    map <C-H> <C-w>h<C-w>\| 
    map <C-L> <C-w>l<C-w>\| 
    
    0 讨论(0)
  • 2020-12-22 16:13

    I am using numbers to resize by mapping the following in .vimrc

    nmap 7 :res +2<CR> " increase pane by 2 
    nmap 8 :res -2<CR> " decrease pane by 2
    nmap 9 :vertical res +2<CR> " vertical increase pane by 2
    nmap 0 :vertical res -2<CR> " vertical decrease pane by 2
    
    0 讨论(0)
  • 2020-12-22 16:17

    CTRL-W >

    and

    CTRL-W <

    to make the window wider or narrower.

    0 讨论(0)
  • 2020-12-22 16:17

    And Ctr-W =

    will make them equal

    0 讨论(0)
  • 2020-12-22 16:17

    In case you need HORIZONTAL SPLIT resize as well:
    The command is the same for all splits, just the parameter changes:

    - + instead of < >

    Examples:
    Decrease horizontal size by 10 columns

    :10winc -
    

    Increase horizontal size by 30 columns

    :30winc +
    

    or within normal mode:

    Horizontal splits

    10 CTRL+w -

    30 CTRL+w +

    Vertical splits

    10 CTRL+w < (decrease)

    30 CTRL+w > (increase)

    0 讨论(0)
提交回复
热议问题