Cómo aumentar el tamaño de la ventana dividida vertical en Vim


:vsplit (forma corta: :vs) divide la vista Vim verticalmente. :30vs divide la ventana, haciendo que la nueva ventana tenga 30 caracteres de ancho. Una vez creada esta ventana de 30 caracteres, ¿cómo cambiaría su tamaño a 31 o 29?

Con ventanas horizontales Ctrl-W + aumenta el número de líneas por uno. ¿Cuál es el comando equivalente para aumentar las columnas en una?

Author: saluce, 2010-12-06

9 answers

CTRL-W >

Y

CTRL-W

Para hacer la ventana más ancha o más estrecha.

 421
Author: Herbert Sitz,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-09-06 21:30:01

Y Ctr-W =

Los hará iguales

 230
Author: RusAlex,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-14 09:22:37

En caso de que necesite DIVISIÓN HORIZONTAL cambiar el tamaño también:
El comando es el mismo para todas las divisiones , solo el parámetro cambia:

- + en lugar de < >

Ejemplos:
Disminuir tamaño horizontal en 10 columnas

:10winc -

Aumentar tamaño horizontal en 30 columnas

:30winc +

O en modo normal:

Divisiones horizontales

10 CTRL+w -

30 CTRL+w +

Divisiones verticales

10 CTRL+w (disminución)

30 CTRL+w > (incremento)

 93
Author: freeo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-05-21 14:06:22

Otro consejo de mi lado:

Para establecer el ancho de la ventana a digamos exactamente 80 columnas, use

80 CTRL+W |

Para establecer el ancho máximo, simplemente omita el número anterior:

CTRL+W |
 41
Author: Phil,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-06-26 11:26:59

Tengo estos mapeados en mi .gvimrc me permite pulsar comando-[flecha] para mover la altura y el ancho de mi ventana actual:

" resize current buffer by +/- 5 
nnoremap <D-left> :vertical resize -5<cr>
nnoremap <D-down> :resize +5<cr>
nnoremap <D-up> :resize -5<cr>
nnoremap <D-right> :vertical resize +5<cr>

Para MacVim, tienes que ponerlos en tu .gvimrc (y no su .vimrc) ya que de lo contrario serán sobrescritos por el sistema .gvimrc

 28
Author: Ted Naleid,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-12-07 04:43:37

En la misma línea, utilizo lo siguiente en mi .vimrc para permitirme moverme a través de las divisiones, expandiendo automáticamente la que estoy moviendo a su tamaño completo y reduciendo todo el resto a su altura o ancho mínimo:

" 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>\| 
 9
Author: the Tin Man,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-12-08 16:55:31

Estoy usando números para cambiar el tamaño mediante la asignación de lo siguiente en .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
 2
Author: Gajendra Jena,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-14 10:51:37

Esto es lo que estoy usando a partir de ahora:

nnoremap <silent> <Leader>= :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
nnoremap <silent> <Leader>0 :exe "vertical resize " . (winwidth(0) * 3/2)<CR>
nnoremap <silent> <Leader>9 :exe "vertical resize " . (winwidth(0) * 2/3)<CR>
 1
Author: meain,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-05-02 16:57:52

Estoy usando los siguientes comandos para esto:

set lines=50     " for increase the height to 50 lines (Vertical)
set columns=200  " for increase the width to 200 columns (Horizontal)
 0
Author: imbichie,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-08-06 11:02:01