# Solidity Support in Neovim in 5 Quick & Easy Steps! (Using Coc.nvim and asdf)

By [0xTARC](https://paragraph.com/@0xtarc) · 2023-11-08

---

#### Discover more from 0xTARC

Actionable advice to save you time, money, and effort in Web3 frontend development, from someone on the inside. Highly relevant for Web3 UI/UX designers, frontend developers, and leaders looking for technical direction.

![](https://storage.googleapis.com/papyrus_images/f6a41b96e33d66395931337a38299882c1443fa3348e541b6df12b53b474219d.jpg)

Having a working knowledge of Solidity for a crypto developer in the EVM ecosystem is critical. You can be much more productive when you have the ability to dive into the source yourself. And diving into Solidity source code becomes much easier when you have deep integration in your dev environment of choice. So of course as a neck-bearded Neovim user, I wanted to share how I set this up!

As of Solidity 0.8.11, the Solidity team has added [LSP](https://microsoft.github.io/language-server-protocol/) support to \`solc\`, “which means every IDE that has Language Server support will support Solidity out of the box.”

[https://blog.soliditylang.org/2021/12/20/solidity-0.8.11-release-announcement/](https://blog.soliditylang.org/2021/12/20/solidity-0.8.11-release-announcement/)

This makes it easy for us Vim / Neovim users to get intelligent code actions (autocomplete, go to definition, batch renames, etc.) when reading and writing Solidity!

So here’s my guide on the _easiest, fastest_ way to get Solidity support in your Vim / Neovim environment:

1.  Let’s install solc with a version manager. I recommend asdf. Let’s install asdf by following the instructions on their [homepage](https://asdf-vm.com/guide/getting-started.html#_1-install-dependencies).
    
    > What is asdf? asdf is a meta version manager - it gives you a common interface for installing and switching between multiple versions of multiple languages. I recommend asdf because it makes it easy to install and switch between versions of solc, node (for Typescript!), and other languages. The only language I’ve found it doesn’t play nice with is Rust. Good thing Rustaceans have rustup!
    
2.  Now add the official Solidity plugin to asdf and use it install your desired version of `solc` by running:
    
    1.  `asdf plugin add solidity <https://github.com/diegodorado/asdf-solidity.git>`
        
    2.  `asdf install solidity 0.8.9`
        
    3.  `asdf global solidity 0.8.9`
        
        1.  You can substitute `0.8.9` for `latest`, or any other specific version of solc.
            
    4.  Run `solc --version` to ensure it all worked.
        
    
    *   If you want to install a specific version of solc, say 0.8.12, you can do `asdf install solidity 0.8.12` to install, and `asdf global solidity 0.8.17` to make it available in your path
        
3.  Now install [Coc.nvim](https://github.com/neoclide/coc.nvim) by following the instructions in their README. This will allow us see LSP suggestions and run LSP actions in Vim.
    
    *   What is Coc? The Coc.nvim plugin stands up a Node process to host VSCode extensions, allowing you to use VSCode plugins in your Vim environment! And it works in both Vim _and_ Neovim - don’t be fooled by the name.
        
4.  Now install the coc-solidity plugin to get the Language Server actions into Vim by opening Vim / Neovim and running:
    
    1.  `:CocInstall coc-solidity`
        
5.  All done! Try it out by opening a `.sol` file, going to a variable usage, and trying the “go to definition” action. If you followed the Coc.nvim [example configuration](https://github.com/neoclide/coc.nvim#example-vim-configuration), you can do this with `gd` in normal mode.
    

That was 5 easy steps to get Solidity LSP support in Vim and/or Neovim. Have fun, and please reach out on Twitter if you have questions or suggestions for future posts [@0xTARC](https://twitter.com/0xTARC).

Bye for now,

\- Tarc

---

*Originally published on [0xTARC](https://paragraph.com/@0xtarc/solidity-support-in-neovim-in-5-quick-easy-steps-using-coc-nvim-and-asdf)*
