1 introduction

Recently I saw Neovim and Spacevim, so I gave it a try.

2 NeovimwithSpaceVim

Neovim is a branch of Vim that features a more modern GUI, embedded and scripted terminals, asynchronous work control, etc. The default configuration file is ~/.config/nvim/init. Vim. SpaveVim is a community-driven, modular Vim IDE that organizes and manages plug-ins and related configurations in a modular way. It provides customized development modules for different languages with features such as auto-completion, syntax checking, formatting, debugging, etc. The default configuration file is ~/.spavevim.d /init.toml.

3 Feeling of use

3.1 Neovim

The first is installation. Neovim installation is simple and can be installed directly from the package manager:

paru -S neovim

Once installed, it can be opened using the nvim command.

After a brief use, it turns out that Neovim is not much different from Vim (version 8.2). In general, such Neovim does not become an IDE and requires several plug-ins to be added before it can be used. There are several popular plug-in managers:

  • vim-plug
  • vundle
  • neobundle
  • Pathogen

I used Vim-Plug. It is not difficult to install the plugin. Insert the name of the plugin between the two calls in init.

call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
call plug#end()

Then type :PlugInstall in Neovim to install.

In general, if you want to build an IDE, you need to have at least the following features:

  • Completing: The plugins available are YouCompleteme, Vim-Snippets
  • Highlight: The Semantic-highlight.vim plug-in is available
  • Project directory tree: The NerdTree plugin is available
  • Run and debug: The plugin Vdebug is available

However, after the installation and use, the test of Java, the effect is not good, take the most commonly used completion for example, the speed of the completion prompt is not fast, on the other hand, the speed of the prompt is slower than IDEA, and the prompt is not intelligent enough, can not be based on the current cursor at the variable prompt the closest completion. On the other hand, there is no automatic import (although this can be done via scripts, it requires additional configuration).

3.2 SpaceVim

Spavevim acts as an IDE out of the box, providing common IDE features by default, such as:

  • completion
  • The highlighted
  • Project directory tree
  • Run the debug
  • Rapid positioning
  • Build tool support

And so on. First, there’s no denying that SpaceVim provides a user-friendly interface by default:

Recently opened files are logged by default and can be quickly located by number. The author also used Java for testing. Although the code completion plug-in is built in, unfortunately, there is no auto-import function, and there is no auto-completion function for variable names (which means to create a variable called arrayList) :

Of course, it’s also possible that it’s not fully configured, and if you want to configure Spacevim to work better, check out this article.

Four Suggestions

Here are my personal reasons for using Neovim:

  • Need a configuration from scratchIDEorVim
  • Hands-on ability is strong, can solve various problems
  • Able to memorize and use various shortcut keys skillfully
  • Familiar with various plugins, including but not limited tonerdtree,YouCompleteMe, etc.

Because if you want to use Neovim good, need to spend some time at least, using plug-in installed a variety of plug-ins (of course because some plug-in just for Vim, so could meet incompatible problems), familiar with and know the shortcut to use them, the memory and learning ability is a test, in the process, You need to open init.vim countless times for configuration.

Reasons for using Spavevim:

  • You don’t want to manually configure too many plugins and shortcuts
  • Need something out of the box and lightweightIDE
  • It doesn’t have to be a big project

In Spavevim, most of them have been configured. The rest just need to get familiar with the interface through the official website documents. The most important thing is to get familiar with the use of Space key combinations, such as:

  • Space + number keys: Switch window
  • Space+b/B: Buffer operation
  • Space+c: command operation
  • Space+f: file operation
  • Space+l: Language related operations, such as running, etc
  • Space+w: window operation

Compared to Neovim’s need to configure various maps to map keys in init.vim, Spacevim’s shortcut key learning curve is much lower.

However, compared to modern IDEs, Neovim differs a lot from Spacevim, most notably in its support for libraries, packages, and one-click deployment runs, so I don’t think Spacevim /Neovim is particularly suitable for large projects. There are compromises, of course, such as VSCode, which, with its various plugins, is a modern IDE that is both light and fast.

5 resources

If you want to learn Neovim/ Spacevim or want to configure both into a better IDE, here are some resources:

  • Neovim document
  • SpaceVim document
  • Vim c-plug document
  • Vundle document
  • VIMRC configuration for 24.3K Star
  • Vimawesome – A collection of Vim plugins
  • How to configure Vim as a repository for C/C++ IDE