diff options
Diffstat (limited to 'tutorials/vim')
-rw-r--r-- | tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html | 180 |
1 files changed, 170 insertions, 10 deletions
diff --git a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html index 075d777..17f8c84 100644 --- a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html +++ b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html @@ -6,6 +6,146 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> <title>how-to-fix-neovim-nerdtree-rendering-issue</title> <style> + html { + line-height: 1.5; + font-family: Georgia, serif; + font-size: 20px; + color: #1a1a1a; + background-color: #fdfdfd; + } + body { + margin: 0 auto; + max-width: 36em; + padding-left: 50px; + padding-right: 50px; + padding-top: 50px; + padding-bottom: 50px; + hyphens: auto; + overflow-wrap: break-word; + text-rendering: optimizeLegibility; + font-kerning: normal; + } + @media (max-width: 600px) { + body { + font-size: 0.9em; + padding: 1em; + } + h1 { + font-size: 1.8em; + } + } + @media print { + body { + background-color: transparent; + color: black; + font-size: 12pt; + } + p, h2, h3 { + orphans: 3; + widows: 3; + } + h2, h3, h4 { + page-break-after: avoid; + } + } + p { + margin: 1em 0; + } + a { + color: #1a1a1a; + } + a:visited { + color: #1a1a1a; + } + img { + max-width: 100%; + } + h1, h2, h3, h4, h5, h6 { + margin-top: 1.4em; + } + h5, h6 { + font-size: 1em; + font-style: italic; + } + h6 { + font-weight: normal; + } + ol, ul { + padding-left: 1.7em; + margin-top: 1em; + } + li > ol, li > ul { + margin-top: 0; + } + blockquote { + margin: 1em 0 1em 1.7em; + padding-left: 1em; + border-left: 2px solid #e6e6e6; + color: #606060; + } + code { + font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace; + font-size: 85%; + margin: 0; + } + pre { + margin: 1em 0; + overflow: auto; + } + pre code { + padding: 0; + overflow: visible; + overflow-wrap: normal; + } + .sourceCode { + background-color: transparent; + overflow: visible; + } + hr { + background-color: #1a1a1a; + border: none; + height: 1px; + margin: 1em 0; + } + table { + margin: 1em 0; + border-collapse: collapse; + width: 100%; + overflow-x: auto; + display: block; + font-variant-numeric: lining-nums tabular-nums; + } + table caption { + margin-bottom: 0.75em; + } + tbody { + margin-top: 0.5em; + border-top: 1px solid #1a1a1a; + border-bottom: 1px solid #1a1a1a; + } + th { + border-top: 1px solid #1a1a1a; + padding: 0.25em 0.5em 0.25em 0.5em; + } + td { + padding: 0.125em 0.5em 0.25em 0.5em; + } + header { + margin-bottom: 4em; + text-align: center; + } + #TOC li { + list-style: none; + } + #TOC ul { + padding-left: 1.3em; + } + #TOC > ul { + padding-left: 0; + } + #TOC a:not(:hover) { + text-decoration: none; + } code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} @@ -15,6 +155,7 @@ pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } + .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @@ -49,7 +190,7 @@ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ - code span.bu { } /* BuiltIn */ + code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ @@ -62,7 +203,7 @@ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ - code span.im { } /* Import */ + code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ @@ -74,6 +215,7 @@ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ + .display.math{display: block; text-align: center; margin: 0.5rem auto;} </style> </head> <body> @@ -85,22 +227,40 @@ <li><a href="#the-actual-solution">The Actual Solution</a></li> </ul> </nav> -<p>I really like neovim since <a href="https://github.com/neoclide/coc.nvim">COC</a> 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 <em>needed</em> NerdTree but every time I'd scroll the window, I'd get a mess.</p> +<p>I really like neovim since <a +href="https://github.com/neoclide/coc.nvim">COC</a> 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 <em>needed</em> NerdTree but every time I'd scroll the window, +I'd get a mess.</p> <h2 id="the-problem">The Problem</h2> <p><img src="/static/mess.gif" /></p> -<p>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.</p> +<p>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.</p> <p><img src="/static/nomess-vim.gif" /></p> -<p>It's also not because of my meme tmux setup, the same issue happens in terminator, which I happened to have installed.</p> +<p>It's also not because of my meme tmux setup, the same issue happens +in terminator, which I happened to have installed.</p> <p><img src="/static/mess-terminator.gif" /></p> <h2 id="the-attempt">The Attempt</h2> -<p>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:</p> +<p>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:</p> <pre class="vimscript"><code>au WinScrolled * redraw!</code></pre> -<p>As it turns out, the "WinScrolled" event <em>only</em> exists in neovim, so this command won't work in plain vim (see <code>:help autocmd-events</code> for the list of events in each program).</p> +<p>As it turns out, the "WinScrolled" event <em>only</em> exists in +neovim, so this command won't work in plain vim (see +<code>:help autocmd-events</code> for the list of events in each +program).</p> <h2 id="the-actual-solution">The Actual Solution</h2> -<p>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:</p> -<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="bu">export</span> <span class="va">TERM=</span><span class="st">'tmux256-color'</span></span></code></pre></div> +<p>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:</p> +<div class="sourceCode" id="cb2"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">export</span> <span class="va">TERM</span><span class="op">=</span><span class="st">'tmux256-color'</span></span></code></pre></div> <p><img src="/static/fixed.gif" /></p> <p>No more hacky autocommands!</p> -<p>If I had the foresight to test the issue in xterm first, I probably would have seen it right away....</p> +<p>If I had the foresight to test the issue in xterm first, I probably +would have seen it right away....</p> </body> </html> |