0

I often have neovim in a horizontal split mode with two buffers. The top buffer is the text file that I'm editing, and the bottom buffer is running a terminal using the term feature. I typically use line number and relative line numbering in my buffer with code, but would like to turn that off in my buffer with the term. Is there a way to specify that buffers that are activated as terms automatically set nornu and set nonu?

2
  • Weird, I’m pretty sure in vim when I do :terminal there are no line numbers (I have both kinds set globally as well).
    – D. Ben Knoble
    Commented Sep 21, 2021 at 21:21
  • Maybe it's just a neovim thing.
    – nsg
    Commented Sep 21, 2021 at 23:41

1 Answer 1

2

You can open the terminal (or create a map) with

:exe 'ter'|se nornu nonu

Or create an auto-command in .vimrc:

autocmd TerminalOpen * set nonu nornu
1
  • 1
    In neovim, the corresponding autocmd event is TermOpen
    – nsg
    Commented Sep 22, 2021 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.