8

By default the terminal buffer scrollback size is set to 1024, but that is not enough for me and I would like to change it.

help terminal does not explain how to configure this.

Floegipoky
  • 3,087
  • 1
  • 31
  • 47

2 Answers2

8

According to :help terminal-emulator-configuration, the scrollback buffer size is controlled by the terminal_scrollback_buffer_size variable.

For example, add the following to your config to set it globally to the maximum value, as defined in :help terminal-emulator-configuration:

let g:terminal_scrollback_buffer_size = 100000
Floegipoky
  • 3,087
  • 1
  • 31
  • 47
3
set scrollback=100000

in ~/.config/nvim/init.vim.

Braham Snyder
  • 511
  • 1
  • 6
  • 14
  • 2
    100000 seems to be the maximum (nvim v0.2.1...) so use -1 if you want more. –  Sep 20 '17 at 16:10
  • At least now, as of v0.5, I wouldn't use -1 because [it's deliberately not documented and it's counterintuitive](https://github.com/neovim/neovim/pull/9563#issuecomment-459387587): `set scrollback=-1` in your init.vim actually gives you only 10000 scrollback in `:term`. (You'd need to use `autocmd TermOpen * setlocal scrollback=-1`.) – Braham Snyder Jul 26 '21 at 03:35