Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Vim/Neovim/SpaceVim

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to use Vim/Neovim/SpaceVim". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and study and learn "how to use Vim/Neovim/SpaceVim" together.

1 Introduction

Neovim and SpaceVim

2 Neovim and SpaceVim

Neovim is a branch of Vim with 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 manner. It tailors related development modules for different language development and provides features such as autocompletion, syntax checking, formatting, debugging, etc. The default configuration file is ~/.SpaveVim.d/init.toml.

3.1 Neovim

The first is installation, Neovim installation is very simple, can be installed directly through the package manager:

paru -S neovim

After installation, you can use the nvim command to open it.

After a brief use, Neovim doesn't look much different from Vim (version 8.2). In general, such Neovim cannot be an IDE and requires several plugins to be added to use. Popular plug-in managers include the following:

vim-plug

vundle

neobundle

Pathogen

The author uses vim-plug, plug-in installation is not difficult, in init.vim between the two calls add the plug-in name:

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

Then type:PlugInstall in Neovim to install.

Generally speaking, if you want to build an IDE, you need to have at least the following functions:

Complete: Available plugins YouCompleteMe, vim-snippets

Highlight: Available plugins semantic-highlight.vim

Project directory tree: available plug-ins nerdtree

Run and debug: available plug-ins Vdebug

However, after installing and using Java, I tested it, and the effect was not very good. For the most commonly used completion, the completion prompt speed was not fast. On the other hand, the prompt speed was slower than IDEA, and the prompt was not intelligent enough to prompt the closest completion according to the variable at the current cursor. On the other hand, imports are not automatic (although they can be scripted, but require additional configuration).

3.2 SpaceVim

SpaveVim is equivalent to an out-of-the-box IDE that provides common IDE features by default, such as:

completion

highlight

Project Catalog Tree

operation and commissioning

quickly locate

Build Tool Support

Wait a minute. First of all, it is undeniable that SpaceVim provides a user-friendly interface by default:

Most recently opened files are recorded by default and can be quickly located numerically. The author also used Java for testing, although the built-in code completion plug-in, but unfortunately there is no automatic import function, and there is no variable name automatic completion function (refers to the creation of a variable called arrayList):

Of course, this may also be the reason why it is not fully configured. If you want to configure a better SpaceVim, you can refer to this article.

4 recommended

Here are some personal reasons to use Neovim:

Need an IDE or Vim configured from scratch

Strong hands-on ability, able to solve various problems

Ability to memorize and use various shortcuts

Familiar with various plug-ins, including but not limited to nerdtree, YouCompleteMe, etc.

Because if you want to use Neovim well, at least take some time, use plugins to install a variety of plugins (of course, because some plugins are only for Vim, so may encounter incompatibility problems), familiar with their use and know the shortcut keys, this memory and learning ability are a test, in the process, need to open init.vim countless times to configure.

Reasons to recommend SpaveVim:

Don't want to manually configure too many plugins and shortcuts

Need an out-of-the-box and lightweight IDE

No need to develop large projects

In SpaveVim, most of them are already configured, and the rest only need to be familiar with the interface through the official website documentation. The most important thing is to be familiar with the use of the Space key combination, such as:

Space+ number keys: Toggle windows

Space+b/B: buffer operations

Space+C: Command operation

Space+f: File manipulation

Space+l: language-related operations, such as running, etc.

Space+w: window operation

SpaceVim's shortcut learning curve is much lower than Neovim's need to configure various map demapping keys in init.vim.

However, compared to modern IDE, Neovim and SpaceVim still have a big gap, the most obvious is the support for various libraries, various packages and one-click deployment, so I personally think SpaceVim/Neovim is not particularly suitable for large projects. But there are tradeoffs, such as VSCode, which can be called a light and fast modern IDE with various plug-ins.

Thank you for reading, the above is "how to use Vim/Neovim/SpaceVim" content, after the study of this article, I believe you have a deeper understanding of how to use Vim/Neovim/SpaceVim this problem, the specific use of the situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report