Skip to main content
Set columns & lines with one command
Source Link
Ralf
  • 9.4k
  • 1
  • 13
  • 32

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|setcolumns=100 lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|set lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100 lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

Remove disclaimer: this works fine in Terminal.app on macOS (I tested it)
Source Link
Rich
  • 32.6k
  • 4
  • 74
  • 141

I don't have a Mac, but I tested the following on Linux with Gnome-Terminal.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|set lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

I don't have a Mac, but I tested the following on Linux with Gnome-Terminal.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|set lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|set lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.

Source Link
Ralf
  • 9.4k
  • 1
  • 13
  • 32

I don't have a Mac, but I tested the following on Linux with Gnome-Terminal.

You can use an autocmd with the event VimLeave to reset lines and columns before Vim closes. Add the following to your vimrc:

augroup term_size
    autocmd!
    autocmd VimLeave * set columns=100|set lines=30
augroup END

The autocmd is executed once when Vim is about to exit and resets colums and lines.

I use a autocmd-group to prevent multiple definition of the autocmd when the vimrc is sourced multiple times (e.g. during testing Vim setup). The autocmd! clears the group before the autocmd for VimLeave is defined. See :help autocmd-groups.