<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diego Quiroz on Medium]]></title>
        <description><![CDATA[Stories by Diego Quiroz on Medium]]></description>
        <link>https://medium.com/@diegoquirozg?source=rss-de3cf4c6a067------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zW1Jy8U1k_7MAd8JqlebYQ.jpeg</url>
            <title>Stories by Diego Quiroz on Medium</title>
            <link>https://medium.com/@diegoquirozg?source=rss-de3cf4c6a067------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:38:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diegoquirozg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use Neovim LSP]]></title>
            <link>https://diegoquirozg.medium.com/how-to-use-neovim-lsp-e8f79f1f0d7c?source=rss-de3cf4c6a067------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8f79f1f0d7c</guid>
            <category><![CDATA[language-server-protocol]]></category>
            <category><![CDATA[neovim]]></category>
            <category><![CDATA[lsp]]></category>
            <dc:creator><![CDATA[Diego Quiroz]]></dc:creator>
            <pubDate>Thu, 13 May 2021 05:03:42 GMT</pubDate>
            <atom:updated>2021-07-12T05:15:19.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYtk7agozPkxr_I8ttl4RQ.png" /></figure><p>Neovim is a powerful editor used all around the world mainly by software developers. But the software development process is not that peasant if you don’t have tools that can make the process easier and faster. Two of those tools are code linting and completion.</p><p>Modern code editors like VS Code uses something called a Language Server, this is the most advanced technology that helps code editors to understand errors in the code while they are writing it. In terms of Microsoft:</p><blockquote>A <em>Language Server</em> is meant to provide the language-specific smarts and communicate with development tools over a protocol that enables inter-process communication.</blockquote><p>So Editors connect to Language Servers via a protocol commonly known as LSP (Language Server Protocol) to complete tasks like linting and code autocompletion.</p><h3>Configure LSP with Neovim 0.5.0</h3><p>Neovim 0.5.0 (currently in development) has native LSP support, so plugins like Conquer of Completion (CoC) or ALE are not needed anymore for some of the most common uses of an LSP: completion and linting.</p><p>To begin with this tutorial, we need to install the <a href="https://github.com/neovim/nvim-lspconfig">LspConfig</a> plugin (developed and mantained by Neovim devs). This is not a plugin to implement LSP but the collection of common configs that will allow you to connect easily your Language Servers. With this you’ll be able to use <em>:LspInfo</em>, <em>:LspRestart</em>, <em>:LspStop</em> and <em>:LspStart</em> commands. All LSP Client features are implemented on Neovim Core, this plugin is just for easy configuration.</p><p>For this you can use your favorite Neovim plugin manager, in my case is Dein (any other like Plug or Packer will work too).</p><p>Inside your <em>init.vim</em> file you will add:</p><pre># Using Plug:<br>:Plug &#39;neovim/nvim-lspconfig&#39;</pre><pre># Using Dein:<br>call dein#add(&#39;neovim/nvim-lspconfig&#39;)</pre><p>Now we have acces to the power of LSP inside our editor, but we now need to add a Language Server. For this, there are many options, but <a href="https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md">this</a> are the recommended by developers of Neovim.</p><p>In this tutorial we will follow the process for tsserver. So let’s install it.</p><pre>npm install -g typescript typescript-language-server</pre><p>Now Neovim can have access to tsserver, we just need to add the folowing line to our <em>init.vim</em></p><pre>require(‘lspconfig’).tsserver.setup{}</pre><p>And with this, Neovim will have access to the Typescript Server Protocol.</p><h3>Adding Completion</h3><p>Unfortunately for us, there is something extra we need to add to our Neovim config if we want autocompletion, the easiest way is a plugin called <a href="https://github.com/hrsh7th/nvim-compe#prerequisite">nvim-compe</a>.</p><p>So we will need to install it like we saw earlier:</p><pre># Using Plug:<br>:Plug &#39;hrsh7th/nvim-compe&#39;</pre><pre># Using Dein:<br>call dein#add(&#39;hrsh7th/nvim-compe&#39;)</pre><p>Now we just need to add the following configurations to have Autocompletion of installed servers up and running.</p><p>Using Vimscript</p><pre>set completeopt=menuone,noselect</pre><pre>let g:compe = {}<br>let g:compe.enabled = v:true<br>let g:compe.autocomplete = v:true<br>let g:compe.debug = v:false<br>let g:compe.min_length = 1<br>let g:compe.preselect = &#39;enable&#39;<br>let g:compe.throttle_time = 80<br>let g:compe.source_timeout = 200<br>let g:compe.incomplete_delay = 400<br>let g:compe.max_abbr_width = 100<br>let g:compe.max_kind_width = 100<br>let g:compe.max_menu_width = 100<br>let g:compe.documentation = v:true</pre><pre>let g:compe.source = {}<br>let g:compe.source.path = v:true<br>let g:compe.source.buffer = v:true<br>let g:compe.source.calc = v:true<br>let g:compe.source.nvim_lsp = v:true<br>let g:compe.source.nvim_lua = v:true<br>let g:compe.source.vsnip = v:true<br>let g:compe.source.ultisnips = v:true</pre><p>Using Lua:</p><pre>vim.o.completeopt = “menuone,noselect”</pre><pre>require(&#39;compe&#39;).setup {<br>  enabled = true;<br>  autocomplete = true;<br>  debug = false;<br>  min_length = 1;<br>  preselect = &#39;enable&#39;;<br>  throttle_time = 80;<br>  source_timeout = 200;<br>  incomplete_delay = 400;<br>  max_abbr_width = 100;<br>  max_kind_width = 100;<br>  max_menu_width = 100;<br>  documentation = true;</pre><pre>  source = {<br>    path = true;<br>    buffer = true;<br>    calc = true;<br>    nvim_lsp = true;<br>    nvim_lua = true;<br>    vsnip = true;<br>    ultisnips = true;<br>  };<br>}</pre><p>And we are done. We can access our Typescript buffers having Linting and completion:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgCmiG1XnYZ4FsXs0w75YA.png" /></figure><h3>Adding more languages:</h3><p>To add more languages you just need to search for your Language Server and install it like pyright:</p><pre>npm i -g pyright</pre><p>And add support for it inside your <em>init.vim</em></p><pre>require(‘lspconfig’).pyright.setup{}</pre><p>If you want to change configs, just add them to the <strong>setup</strong>:</p><pre>require(&#39;lspconfig&#39;).pyright.setup{<br>  settings = {<br>    python = {<br>      analysis = {<br>        autoSearchPaths = true,<br>        useLibraryCodeForTypes = true<br>      }<br>    }<br>  }<br>}</pre><p>If this was any help for you, please share it.❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8f79f1f0d7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>