Neovim - Effective Editing

Part I - Intro

Vim and Neovim alike has always been developer's favourite. It allows efficient and effortless editing, after sufficient training that is, while being lightweight and available pretty much on any system.

Vim's text editing model provides comfortable and logical operations on text objects. For example, in order to delete everything inside current paragraph, you only need to press

dip - delete in (current) paragraph.

Similarly, to copy everything inside double quotes, you only need to type

yi" - yank inside double quotes

with "yank" being Vim's way of saying "copy"

Not everything is so logical and easy to guess however. In the beginning, many will have hard time grasping how to move around and understand different "modes" that Vim has. Some of the more popular ones are:

There's certainly more to be said about Vim's way of editing text, which I will not cover here but which can be learned through various online tutorials or using Vim's built-in tutorial - vimtutor

Part II - Improved features

Neovim is a modern fork of Vim, which provides some nice features. One of the most useful one is native LSP (language server protocol) support, which can provide intelligent code completion, code navigation, linting capabilities, reminiscent of VSCode's IntelliSense. It's worth noting that there exists an LSP extracted from VSCode, so you can get pretty much the exact same features for HTML, CSS and JavaScript files by installing it. Here's

Neovim also provides pretty essential feature for me - live preview of a substitution command. Normally, when you want to search and replace some piece of text, you need to use Command mode and type in something like this

However, with Neovim's inccommand feature turned on, it now looks like this:

Part III - Customization

Neovim can be extensively customized and extended with a use of Vimscript - internal scripting language. Example function, which toggles markdown checkbox, may look something like this:

Using it, Vim's community managed to create a lot of useful extension that can make using it a lot more pleasant and easier. The one's I am currently using are:

Conclusion

Neovim is certainly boasts a few good features that may or may not be native in most recent versions of standard Vim. Built-in support for LSP, better substitution command as well as native Lua support which can be used to write plugins and config in, may be a thing that will make it worth to switch versions.

References