diff options
author | mjfernez <mjf@mjfer.net> | 2022-01-03 17:41:42 -0500 |
---|---|---|
committer | mjfernez <mjf@mjfer.net> | 2022-01-03 17:41:42 -0500 |
commit | 2841989fbcac0bb530133641127f0e73fb686114 (patch) | |
tree | 33fe7b2f75d0ebdbfcaca6cd8fa3e0fc5fdb8dcf /.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md | |
parent | d0595724cd13a2274e34a813119cf457a796af75 (diff) | |
download | site-files-2841989fbcac0bb530133641127f0e73fb686114.tar.gz |
Added neovim article. Syntax fixes in markdown
Diffstat (limited to '.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md')
-rw-r--r-- | .md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md b/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md new file mode 100644 index 0000000..df0af33 --- /dev/null +++ b/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md @@ -0,0 +1,53 @@ +I really like neovim since [COC](https://github.com/neoclide/coc.nvim) +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 + +![](/static/mess.gif) + +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. + +![](/static/nomess-vim.gif) + +It's also not because of my meme tmux setup, the same issue happens in +terminator, which I happened to have installed. + +![](/static/mess-terminator.gif) + +## 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: + +```vimscript +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: + +```bash +export TERM='tmux256-color' +``` + +![](/static/fixed.gif) + +No more hacky autocommands! + +If I had the foresight to test the issue in xterm first, I probably +would have seen it right away.... + |