Neovim Habits Layer
Up: Neovim Config Tutorial Down: plugins
Before the plugins arrive, the editor already has manners. This layer is where Neovim learns how to sit, look around, clean up, and not panic.
Settings
lua/settings.lua is full of small sensory choices:
| Setting area | Intent |
|---|---|
| Buffers | Hidden buffers stay alive, so switching files is cheap. |
| Splits | New windows open right and below, matching reading direction. |
| Search | Smartcase and live substitution previews make search safer. |
| UI | Relative numbers, cursorline, whitespace markers, and high scrolloff keep location obvious. |
| State | Backups, swap, and undo live under Neovim data paths. |
| Diagnostics | Virtual text, signs, and sorted diagnostics keep errors visible without owning the screen. |
| Providers | Unused Perl and Ruby providers are disabled to reduce startup noise. |
The config also disables netrw because file management is handed to Oil.
Keymaps
lua/keymappings.lua edits Vim muscle memory without turning the keyboard into a puzzle box.
Useful patterns include:
| Key idea | Why it exists |
|---|---|
Y yanks to end of line | Makes Y behave like D and C. |
Q disabled | Avoids accidental Ex mode. |
n and N recenter | Search results land in the middle of the room. |
Esc clears search | The screen calms down quickly. |
| Terminal window navigation | Terminal buffers behave like normal splits. |
Visual J and K move blocks | Rearranging code stays tactile. |
Command abbreviations fix common capitalized saves like :W and :Q.
Autocommands
lua/autocommands.lua is the caretaker:
| Autocmd | Why it exists |
|---|---|
| Yank highlight | Confirms that a yank happened. |
Disable diagnostics in node_modules | Avoids screaming inside vendored dependency forests. |
| Filetype fixes | Teaches Neovim about Fortran, R Markdown, notebooks, shell variants, Salt, and more. |
| Markdown wrap | Writing notes feels like prose, not log output. |
q and Esc close utility buffers | Help, quickfix, and test panels leave politely. |
| Python write hook | Runs import cleanup helpers when available. |
These habits are not flashy. They are the floorboards. You notice them mostly when they are missing.
Related: bootstrap, editor plugins