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
    Sep 21 at 21:21
  • Maybe it's just a neovim thing.
    – nsg
    Sep 21 at 23:41
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
    Sep 22 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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