1

So suppose there's some text in vim terminal that is longer than the terminal width and it causes a wrap. Now suppose I go into normal mode in that terminal.

enter image description here

In normal mode, we have an addition of 4 new rows due to line numbers and spaces

enter image description here

This causes an awkward break in the line we saw before, which now takes 3 lines when it can still fit in 2 lines

enter image description here

Is there a solution to this? through a vim setting or a terminal setting?

This happens to me in different shells (bash/tcsh) different terminals emulators (windows terminal/mate terminal) in vim 8.1

3
  • 1
    Why do you enable numbering for terminal window? Mar 30 at 7:56
  • 1. I don't know how to configure settings specifically for terminal. my vimrc enables numbers unconditionally - if you know how to do that I'll appreciate it (maybe I will set nowrap for terminal). 2. it's easier to navigate when I have number and relative number set. Mar 30 at 10:09
  • Try :au TerminalWinOpen * :set nonu Mar 30 at 16:39

1 Answer 1

0

You can set the following autocommand to disable numbering in terminal windows:

augroup MyTerminal
au!
au TerminalWinOpen * :set nonumber norelativenumber
augroup END

Note: TerminalWinOpen does not exist in Neovim.

1
  • I used it to set nowrap which solves it as well, and keeps the numbers which I like. The wrap is still there due to terminal wrap, but the awkward break is gone. Apr 1 at 19:55

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.