My projects

My Neovim — an editor that fits me

I used Notepad++ for many years, then moved to Sublime Text 3 and eventually got hooked on PyCharm. Among graphical code editors, PyCharm is still my favorite. VS Code never stuck with me — it is simply not my thing.

The Russian title “My Neovim — an editor that fits me”, an editor window and a green letter N on a dark background.

But my real love is Neovim. It is my main code editor. Over time, it has come to feel like an extension of me: the movements, commands and key combinations are so familiar that working in graphical editors afterward can feel awkward. I simply do not want to give up that speed and freedom.

I see other people’s Neovim setups much like someone else’s workspace. Everything seems to be there, but it is not arranged the way I like. They often try to be universal, accumulate features I do not use and bring their own controls. I have my own opinions about all of that: which tools I need, which keys should trigger them and how the workflow should fit together.

So having my own configuration feels natural. I recently started rebuilding it from scratch. Not everything is implemented yet, but the foundation is already usable. I want to show what is there now and how you can try it.

What the configuration can do already

Search without browsing directories

One of the main features is search through Telescope. Press a few keys, start typing a filename and immediately see matching results with a preview. You can also search text across the project or switch between open files.

Ordinary folder browsing is available too. When following a directory tree is more convenient, you can open the built-in file browser.

Working with code and markup

The configuration includes syntax highlighting, automatic completion of brackets and quotes, and indentation for different languages. Thin vertical guides help show nesting. If a project defines its own indentation rules in .editorconfig, the editor follows them.

For web development, completions and diagnostics are already configured for HTML, Django templates, JavaScript, TypeScript, React and Vue. You can jump to a definition, view documentation or read an error message right in the editor. The exact features depend on the language and project settings. Automatic formatting on save is not enabled yet, and a dedicated Python language server is not configured yet either.

You can comment out lines and selections, and TODO: and FIXME: markers are highlighted. You can find them across the entire project and jump straight to the relevant location.

Emmet

Emmet is configured for markup and styles. For example, instead of creating a list manually, type ul>li.item$*3 and press Tab. You get:

html
<ul>
  <li class="item1"></li>
  <li class="item2"></li>
  <li class="item3"></li>
</ul>

In CSS, m10 expands to margin: 10px;. This also works in Django templates, JSX/TSX and Vue. Use Tab and Shift+Tab to move between fields in an expanded snippet.

My paired-tags.nvim plugin

I developed paired-tags.nvim specifically for this configuration. It is already included and handles paired tags.

Type <section> and a closing </section> appears. Rename one tag and its partner changes too. Place the cursor on a tag and its match is highlighted. Pressing Enter between adjacent HTML tags moves the content onto a separate, indented line.

The plugin also works with JSX/TSX, Vue and Svelte components, and helps with paired blocks and delimiters in Django and Jinja templates. If a pair cannot be identified unambiguously, the automatic change is skipped.

You can read more on the project page, and the source is available on GitHub.

Appearance

I chose Catppuccin for the appearance, with light and dark themes. On macOS, the editor follows the system appearance: change the theme in the system and Neovim changes with it.

The status line at the bottom shows the filename, editor mode, Git branch and diagnostics. In a narrow window, some information is hidden to leave room for the essentials.

How to try it

The source is in the hardcodd/nvim repository. The configuration has been tested on macOS with Neovim 0.12.5; other systems have not been tested yet. The commands below are for a Unix shell.

On macOS with Homebrew installed, you can install the main dependencies in one command:

sh
brew install neovim tree-sitter-cli ripgrep node python

You also need Git and Apple’s developer tools with a C compiler. If the latter are not installed yet, run xcode-select --install. Detailed requirements are in the README.

For a first look, I suggest installing the configuration separately from your regular Neovim settings:

sh
nvim_config_root="${XDG_CONFIG_HOME:-$HOME/.config}"
mkdir -p "$nvim_config_root"
git clone https://github.com/hardcodd/nvim.git "$nvim_config_root/nvim-hardcodd"
NVIM_APPNAME=nvim-hardcodd nvim

The name nvim-hardcodd gives it separate configuration and plugin directories. If that directory already exists, choose another unused name and replace it in the last two lines.

On the first launch, wait for plugins and language tools to download. You can check installation progress through :Lazy and :Mason. Restart the editor when installation is complete. Opening a file in a new language for the first time may also require a download for syntax highlighting.

For subsequent launches, use the same command:

sh
NVIM_APPNAME=nvim-hardcodd nvim

Getting started

If you are new to Neovim, the most important step is getting used to modes. Press i to enter text and Esc to return to commands. In my configuration, typing jk quickly also leaves insert mode.

Open the editor from your project directory. A few key combinations are enough to get started. Here, Space means the space bar, and the keys are pressed in sequence in normal mode.

Keys Action
Space f f Find a file.
Space f g Search text in the project.
Space f b Switch between open files.
Space e Open the file browser.
Space w Save the file.
Space x Close the current file.
Space q Quit Neovim.

Try finding a file, changing a few lines and saving the result. Then try Emmet, work with tags and get familiar with project search. Neovim also includes a built-in :Tutor lesson for learning its basic commands.

Use it as a starting point

What I like about Neovim is being able to build my own workspace gradually. You do not have to adopt someone else’s entire configuration: you can borrow useful ideas, change the controls, remove what you do not need and add what is missing.

My configuration is written in Lua, with settings separated by purpose. Key mappings are collected in lua/keymaps.lua, which is a useful place to start if you want to change the controls. The rest is described in the repository documentation.

The rebuild is still in progress, so the configuration will change. But if you have been wanting to try Neovim or need a starting point for your own setup, give it a try. For me, being able to shape the editor around the way I work is one of the main reasons I return to it every day.

Was this article useful?

Comments 0

Name: up to 40 characters.

After submitting, we will email you a link to confirm your email address.

Maximum 5000 characters.

No published comments yet.