From 2841989fbcac0bb530133641127f0e73fb686114 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Mon, 3 Jan 2022 17:41:42 -0500 Subject: Added neovim article. Syntax fixes in markdown --- ...how-to-fix-neovim-nerdtree-rendering-issue.html | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html (limited to 'tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html') diff --git a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html new file mode 100644 index 0000000..075d777 --- /dev/null +++ b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html @@ -0,0 +1,106 @@ + + + + + + + how-to-fix-neovim-nerdtree-rendering-issue + + + + +

I really like neovim since COC is integrated with it to work nicely. Plus, I like the defaults and the fact there's a lot of active development on extensions. I didn't use it for a long time because I needed NerdTree but every time I'd scroll the window, I'd get a mess.

+

The Problem

+

+

Now, yes, I know I'm a heretic for using the arrow keys and not just jumping around, but I thought it was weird I didn't see this issue anywhere else. Also, vim doesn't have this problem.

+

+

It's also not because of my meme tmux setup, the same issue happens in terminator, which I happened to have installed.

+

+

The Attempt

+

There's a better way to do this, but I first figured just triggering a redraw on scroll would do the trick. You can do so by adding the following line to your init.vim file:

+
au WinScrolled * redraw!
+

As it turns out, the "WinScrolled" event only exists in neovim, so this command won't work in plain vim (see :help autocmd-events for the list of events in each program).

+

The Actual Solution

+

After installing COC and running a healthcheck, I realized that my TERM variable was set to 'xterm'. I'm not sure if I did that intentionally to run something or if it's just a legacy thing I left in from Debian's default bashrc, but all I had to do was change it:

+
export TERM='tmux256-color'
+

+

No more hacky autocommands!

+

If I had the foresight to test the issue in xterm first, I probably would have seen it right away....

+ + -- cgit v1.2.3