[IDE turns NeoVim] Part 1 Install basic NeoVim plugins and Setup

Tram Ho

I wrote two previous articles about the benefits of using NeoVim and basic NeoVim instructions. In this article I will guide you to install plugins and setup to turn NeoVim into your own IDEs.

From visual studio to neovim

Install and use basic neovim

Vim-plug

I use vim-plug as a plugin manager, NeoVim or Vim can use it. I recommend using NeoVim, the reason is because NeoVim is a refactor of Vim with 30% less code, better support for plugins integration. Setting:

Create a folder to store NeoVim’s config file at ~ / .config / nvim / init.vim

NeoVim will read this init.vim file by default when it boots up. Like when you code C / C ++ will want to have a file containing main () function, in NeoVim you can create many of your configs files outside and then source (include in C / C ++) into this init.vim file. .

I temporarily designed the nvim directory like this: codefun neovim In the directory tree above, only the configs folder, my_settings are created by me, the rest of the session , bundle , autoload folders are vim-plug created to manage packages. In this article, you just need to create configs folder and setup plugin.

The configs folder has not all the vim installation files. I want to separate these configs to make it easier to install and setup later. In the init.vimm file, I will run a script that reads all of these configs and loads them.

  • 01 plugins.vim: manage the plugins
  • 02.settings.vim: manage neovim’s settings
  • 03.plugin-settings.vim: manage settings of plugins.

Prefix 01. * to indicate the priority of the script when loaded. Plugins need to be loaded first, then the settings of neovim other settings are last loaded.

Setting

Plugins

I will take 2 plugins to make an example that is nerdtree (folder / file manager) and gruvbox (theme of neovim like I’m using). codefun neovim theme In the file 01.plugins.vim you add the following script:

There are many plugins you can search here

After adding, the steps you have to do are:: w to save it later : so% to reload configs later : PlugInstall to install Plugins

When you install any plugins, you should go to the plugin’s homepage (most are github) to see the user manual and do you need to install anything. Because most of the plugins installed need to be installed to work.

If you feel the plugin makes sense to you, then don’t hesitate a star for that project to encourage the author ❤️

For example, I just installed the nerdtree plugin (the folder / file manager) then I went to the nerdtree’s github page to see the docs

Settings

File 02.settings.vim will contain NeoVim’s general settings, global in nature and less likely to change over time. Some basic settings in the file 02.settings.vim:

Plugins Setting

The file 03.plugins-setting.vim will contain the plugin’s settings. I have just installed 2 plugins, nerdtree and gruvbox, now I start config as follows:

Copy the settings I created and pasted into your plugins-settings file. : w to save,: so% to reload the setting and you will see the theme of neovim has changed. Check if NerdTree’s settings have been eaten by pressing Ctrl + b to toggle nerdtree.

Conclude

I would like to stop here, this article I just want you to know how to install 1 plugin neovim, how to install neovim. Have you tried the installation if you have any questions or difficulties, please comment.

Register and follow me, the next article I will summarize the required plugins and how to set up for you to code in any language.

Source

https://codefun.dev/@lythanhnhan27294/ide-hoa-neovim-phan-1-cai-dat-plugins-va-setup-neovim-co-ban-1482174216

Update

[IDE turns NeoVim] Part 2.1 Essential plugins

Share the news now

Source : Viblo