Modern Neovim — Configuration Hacks
Configuration tips for a modern development environment with Neovim.
Let’s check out simple yet useful Neovim configuration hacks in this article!
This article is part of the Modern Neovim series.
The Neovim configuration files are available in this repository.
Getting Started
Neovim is designed to be a modern and maintainable editor, emphasizing improved performance, extensibility, and community-driven development. It provides a rich set of features and mechanisms for extending its functionality, making it a powerful tool for developers, writers, and other text editing enthusiasts.
The article will explore simple hacks and configuration recipes to make Neovim an ideal environment for everyone's needs.
Table of Content
· Getting Started
· Table of Content
· Last Location When Opening a File
· Auto Indent the Current Empty Line
· Signature Help, Documentation, and Completion for Lua APIs
· Auto Create Intermediary Directories
· = Operator in Command-Line Mode
· Version Manager using Bob
· Cursor Shape
· Language Servers
∘ Ruff LSP for Python
∘ Marksman for Markdown
· Configure Window Bar
· References
Last Location When Opening a File
The following auto command is designed to set the cursor position to the last used mark (if valid) after a buffer is read (loaded) in the current window.
The mark position is retrieved using the vim.api.nvim_buf_get_mark()
function and the cursor is set using the vim.api.nvim_win_set_cursor()
function.
-- Go to last location when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup "last_loc",
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount =…