An easy way I have found to use Vim/Neovim as an IDE

Henry Barreto's photo
Henry Barreto
·Oct 20, 2022·

3 min read

Vim is so known that I think its presentation is redundant, but here we go: Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. Vim can be configured to work in a very simple (Notepad-like) way, called evim or Easy Vim. One of its main features is that its use is based only on the keyboard, What have made me to invest a few hours to be reasonably productive on its usage.

Neovim is a fork of Vim aiming to improve the codebase, allowing for easier implementation of APIs, improved user experience and plugin implementation. In other words, Neovim is what was the vim for the good and old vi, but with steroids.

With 30% less source-code than Vim, the vision of Neovim is to enable new applications without compromising Vim's traditional roles. Will Neovim deprecate Vimscript? No. Lua is built-in, but Vimscript is supported with the most advanced Vimscript engine in the world (featuring an AST-producing parser). Which plugins does Neovim support?

Vim and Neovim are extremely extensible, so extensible what many people say it is already an IDE. There are a lot of amazing Vim/Neovim plugins abroad, but what, I believe, is one of the bests is the Conquer of Completion (coc.nvim) that promise to become your text editor into an IDE like VSCode.

To use it, you need a plugin manager; I use the vim-plug. Vim/Neovim has a configuration file called either ~/.vimrc for Vim or init.vim for Neovim, located in somewhere. Put this snippet on this file and run :PlugInstall to install it.

" Use release branch (recommend)
Plug 'neoclide/coc.nvim', {'branch': 'release'}

After installation, you can add extensions, like the VSCode, to your text editor. Thus, in the Vim/Neovim plugins, there are a lot of Conquer of Completion extensions to many proposes. That is the list of extensions I use on my working day.

To install a Conquer of Completion extension, use :CocInstall [name].

If you need a specific extension, try to search on your favorite search engine for: coc [your need here]

Conquer of Completion has a configuration file, what can be opened using the command :CocConfig. I frequently visit it when I need a custom Language Server for some file type, which I did not find on my search or when it was abandoned by its maintainer.

Neovim has a native Language Server client embedded

The last step is to configure your shortcuts. You can create your own from zero, or use a generic configuration file, wrote on vim script to Vim/Neovim or on Lua for Neovim, on the repository and specialize it to your usage. Thereafter, your new IDE is ready to use; it is time for a test-drive.

References

Did you find this article valuable?

Support Henry Barreto by becoming a sponsor. Any amount is appreciated!

See recent sponsors Learn more about Hashnode Sponsors
 
Share this