2nthony

2nthony

github
twitter

Rebuilding the Vim editor once again

All Vim in this article refers to NeoVim. The reason for using Vim is "aesthetics and functionality," or you can Google this question.

https://evilaassets.oss-cn-shanghai.aliyuncs.com/uPic/2023/02/VWHt8I.jpg!jpg

Reasons

The previous customization was not user-friendly enough. Fortunately, Takuya 🐾 devaslife has updated the Vim Setup video, which is already the fourth edition, averaging one edition per year. Since I also need to make changes, I will follow along and make some modifications.

Using Vim Based on Personal Situation

After customizing Vim and using it for a long time, I did not feel a significant improvement in efficiency from Vim. Perhaps it's because I haven't used VS Code almost at all during this period, so I can't make a comparison, which has blurred this concept for me.

The reasons I switched to Vim are roughly as follows:

  • Semi-transparent frosted glass effect. I can easily achieve a semi-transparent frosted glass effect through iTerm 2.
  • Pure keyboard operation. I can replace most mouse operations with the keyboard. I just really dislike switching back and forth between the keyboard and mouse.
  • Low memory usage. Below is a comparison of the memory usage of Vim and VS Code when starting the same minimal viable project and opening the same file. The comparison is not entirely accurate.

iTerm 2 + Vim + Node(LSP)

The following node processes are not entirely certain whether they are all caused by Vim LSP, so let's assume they are all included.

Operations performed before taking the screenshot:

  • Open and close file search (nvim-tree)
  • Open file search and confirm opening file (telescope nvim)
  • Open Git (toggleterm + lazygit)
  • Enter some content to trigger LSP and code suggestions (lspconfig + nvim-cmp)

https://evilaassets.oss-cn-shanghai.aliyuncs.com/uPic/2022/08/RfMfJk.png!jpg

VS Code

Operations performed before taking the screenshot:

  • Open built-in terminal
  • Enter some content to trigger code suggestions

https://evilaassets.oss-cn-shanghai.aliyuncs.com/uPic/2022/08/gDmgin.png!jpg

It is visually apparent that Vim consumes much fewer resources.

Conclusion

It is very fulfilling to see the effect after setting up Vim for a project (just like typing for a few minutes after customizing a keyboard and listening to the sound of keystrokes). However, I no longer want to go through the trouble of configuring Vim.

If I could start over, I would choose pre-configured editors like LunarVim, which are convenient and effortless.

Update

For various reasons, I have started using LunarVim again. The reasons are nothing more than laziness and not wanting to tinker with this anymore. Although LunarVim has made many improvements, I still prefer my previous customization. I have migrated and overridden a lot of settings, and fortunately, some of the PRs I casually mentioned were useful to me and got merged. However, the hidden risk is that it is more community-oriented.

The process is still not smooth sailing due to incomplete and outdated documentation, which has led to situations where I need to look at the code to figure out how to override the original configuration. In order to maintain stability, the stable version of LunarVim locks the commits of plugins. However, coincidentally, there was a major version update of Volar (vue-language-server), which caused the LSP server to fail to start in Vue projects and resulted in a lack of language support. The solution is to delete these commits, but I still chose a more difficult way to write a hack configuration to automatically delete these commits because I believe that this kind of thing may happen again.

Links

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.