summaryrefslogtreecommitdiffstats
path: root/.md/tutorials
diff options
context:
space:
mode:
Diffstat (limited to '.md/tutorials')
-rw-r--r--.md/tutorials/vim/.description1
-rw-r--r--.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md53
2 files changed, 54 insertions, 0 deletions
diff --git a/.md/tutorials/vim/.description b/.md/tutorials/vim/.description
new file mode 100644
index 0000000..9a4526d
--- /dev/null
+++ b/.md/tutorials/vim/.description
@@ -0,0 +1 @@
+Random little fixes I'e found for vim/neovim
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....
+