r/neovim 8d ago

Dotfile Review Monthly Dotfile Review Thread

22 Upvotes

If you want your dotfiles reviewed, or just want to show off your awesome config, post a link and preferably a screenshot as a top comment.

Everyone else can read through the configurations and comment suggestions, ask questions, compliment, etc.

As always, please be civil. Constructive criticism is encouraged, but insulting will not be tolerated.


r/neovim 2d ago

101 Questions Weekly 101 Questions Thread

10 Upvotes

A thread to ask anything related to Neovim. No matter how small it may be.

Let's help each other and be kind.


r/neovim 7h ago

Random Full legal name

123 Upvotes

Ok, so waaay back when terminals were literally printing on paper, there was this program called ed. Short for Text editor. It edited streams of text.

Then there was this one called ex. Short for Extended ed.

I learned now that vi was made as the Visual ex.

Well, vim is literally called Vi IMproved.

Which means that neovim's full legal name is "New Visual Improved Extended Stream Editor, the 12th".


r/neovim 9h ago

Plugin bib.nvim - manage your references from neovim!

16 Upvotes

I use pandoc and markdown a lot for academic work, and I wasn't happy with the existing plugins. I wanted something simple: completion from .bib files and Zotero integration. I used to use zotcite (https://github.com/jalvesaq/zotcite) — huge thanks to its author — but it's a bit too opinionated for me, with a few quirks around .bib file discovery. So I dug into its codebase, grabbed a few things I liked, added the features I wanted, and bib.nvim (https://github.com/phrmendes/bib.nvim) was born.

Highlights:

  • Finds .bib files via YAML frontmatter, LaTeX keys, or a .bib.json project marker
  • Tries .bib first for completion, then falls back to your Zotero library
  • Runs an in-process LSP server with code actions: open attached PDFs and extract notes from Zotero
  • Hides Zotero item IDs behind the scenes — @ABC123#smith2020 renders as just @smith2020
  • :Bib search and :Bib search zotero open a fuzzy picker over your references

And a few more in the README. Hope someone finds it useful!


r/neovim 22h ago

Plugin VimTeX v2.18

136 Upvotes

VimTeX is a Vim and Neovim plugin for writing LaTeX.

I just released VimTeX v2.18. There are several improvements and fixes, although nothing major. One interesting piece of news, though, is that I've made a simple web page to make it easy to refer to the docs online: https://vimtex.org/.

Thanks to everyone for your continued interest and special thanks to everyone that has contributed with PRs!


r/neovim 22h ago

Random I came back to Neovim after long absence. It feels soo good

55 Upvotes

I have been playing with Neovim in the past, but I got lazy overtime. My config was always broken in some way, I didn't want spend hours browsing documentation, so I just had it in that broken state enjoying using it anyway.

Then I got my job which required me to work on windows (and neovim on windows worked terribly slow back them, as far as I know because of powershell. Idk how does it look now) and I didn't have time to troubleshoot it, so I quickly got visual studio code and began doing my job.

I tried to come back but without success, especially as I was too lazy to setup copilot and debug tools. I also didn't want to learn new shortcuts from "Neovim distributions" like AstroVim. This way I stayed on visual studio for few years. However, I was missing Neovim.

I decided to come back once again. I asked copilot to make my config (I used visual studio for that), and review that. It made few stupid config options, but most of it is fine.

Right now I got some more time, so I am exploring the config trying to learn (or rather remind myself) shortcuts to for example manage tabs, and what plugins I have.

I missed neovim + tmux sooo much. We are so back


r/neovim 16h ago

Plugin iedit.nvim - Multiple cursor editing for Neovim, inspired by Emacs iedit mode

9 Upvotes

Hey r/neovim,

I've been working on iedit.nvim, a plugin that brings Emacs's iedit-style multiple cursor editing to Neovim. Instead of relying on external tools or heavy frameworks, it's a pure Lua implementation that feels right at home with Vim keybindings.

What it does: Place your cursor on a word, hit a key, and every occurrence gets highlighted. From there you can edit them all at once — insert, append, delete, replace, you name it. It's like cdo/cfdo but interactive and real-time.

Key highlights: - Vim-style Normal & Insert mode key bindings (i, a, I, A, C, D, s, S, x, etc.) - Navigate between occurrences with n/N/gg/G/f{char} - Toggle individual occurrences on/off with <Tab> - Word motions (w, b, e) work across all cursors - Support for regex patterns and line ranges - Configurable highlight groups (active / current / inactive)

Quick start:

lua require('iedit').setup() vim.keymap.set('n', '<leader>e', "<cmd>lua require('iedit').start()<cr>")

Available via lazy.nvim, packer.nvim, nvim-plug, and LuaRocks.

Repo: https://github.com/wsdjeg/iedit.nvim

Feedback and suggestions are welcome!


r/neovim 1d ago

Plugin A Pi Coding Agent Integration for Neovim

Enable HLS to view with audio, or disable this notification

18 Upvotes

r/neovim 10h ago

Plugin Neoagent: A coding agent implemented as a pure Lua plugin

1 Upvotes

Hey community

Yesterday I realized I had a few codex resets that were close to expiring, so I started using it to port pi, which is my favorite terminal coding harness, to a Neovim plugin.

It is 100% implemented in Lua and has the same command dependencies as pi, with the addition of curl as an http client. Additionally, if "magick" program is installed, it will be used to manipulate images before posting them to LLM APIs.

The UI is based on two floating windows: one for the conversation transcript, another for input. That means the full power of Neovim editing can be used for prompting. The way I'm using it is with a single mapping that toggles the window when I want to use it.

There are two builtin presets:

  • Neo: a chat agent with similar tools that you find in a normal pi installation (read/write/edit/bash)
  • Chat: Just a simple chat UI without tools or prompts.

Sticking to Pi's philosophy, the plugin is extremely hackable and anyone can assemble their own agents and views just like the builtin presets. It is meant to be more of an agent framework than an opinionated coding harness.

For now the main preset is very similar in capabilities to what you would find in pi. Later I plan to experiment with more concepts, such as exposing tools that access Neovim APIs (treesitter, LSP...). Might also see if I can port some of Codex sandboxing to it. But overall I'd like it to be flexible in that users will ultimately decide how to wire things up.

Here is the repo: https://github.com/tarruda/neoagent

Hope someone enjoys!


r/neovim 1d ago

Tips and Tricks A dirty hack to handle "nvimception"

11 Upvotes

Hey vimmers,

When using nvim's built-in terminal emulator (aka :terminal), one may spawn a "nested" neovim instance. Usually this happens as the result of using another command (as opposed to an explicit nvim invocation): git commit, etc (any command that calls $EDITOR).

Given that both instances share the same keymaps, dealing with this scenario can be awkward. To the point that there are multiple plugins that attempt to deliver better ergonomics, each with its own approach. I considered using one of them, but for my use case (rarely running into this situation), I found a simpler alternative.

It relies on a somewhat common (even recommended) remap:

vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')

And the fact that, for terminal reasons™, <C-[> is equivalent to <Esc> (AFAIK, this depends on the environment / terminal emulator). However, in these specific circumstances, you can use <C-[> to exit insert mode inside the nested instance, while <Esc> can be used to exit terminal mode inside the parent instance, giving you full "navigation" control.

Of course, this is a "dirty hack" because it ends up introducing a "cognitive overhead" (as in, "should I use <Esc> or <C-[> to do X?"), but it does have its advantages. Namely, it fully preserves the parent instance's window layout (i.e., unlike some of the plugins, which create new tabs). This fits nicely with my use case, where I'm often comparing or copy-pasting stuff from different commands.

Should you use this in practice? Probably not; if this situation bothers you, you're better served with one of aforementioned plugins. This is more a trick if:

  1. You're already using the <Esc> remap;
  2. You accidentally trigger a nested instance, and you end up thinking you're "stuck" in insert mode (inside the nested instance)

Additionally, this "trick" also works with other "well behaved" CLI programs: you don't have to worry about <Esc> being mapped in terminal mode, just use <C-[>.

As I mentioned, this may not work with all terminal emulators. I'm using foot.


r/neovim 1d ago

Need Help Is there a way of monitoring the progress of `:grep` or `:vimgrep` using progress messages?

16 Upvotes

Hello. As the title says. I want to add a :h progress-message for the status of executing a grep command over a large amount of files. I am aware that :vimgrep outputs the filenames it searches, but :grep doesn't seem to do that, which I'm assuming is because it essentially interfaces with an external program. Is it possible to do what I'm talking about in Neovim?


r/neovim 2d ago

Plugin present.nvim inspired by tjdevries/present.nvim

Enable HLS to view with audio, or disable this notification

60 Upvotes

I created it with 90% code from Claude for my personal use-cases,
but If it can help you, I'm also happy.
https://github.com/kunkka19xx/present.nvim
:)
(I used to use TJ's plugin https://github.com/tjdevries/present.nvim but this is not really fit with my style on markdown and missing some things like footer, header, in-slide separator...)


r/neovim 1d ago

Plugin codemap.nvim — a tiny treesitter-powered function sidebar (feedback welcome!)

Enable HLS to view with audio, or disable this notification

17 Upvotes

Full disclosure: I fully vibecoded this using Claude — so if something looks off under the hood, that's why. That said, I tested it thoroughly and it's been working well for me.

Hey! I built a small plugin called codemap.nvim and figured I'd share it here.

It's a lightweight sidebar that lists all the functions/methods in your current buffer. Click a name and it jumps you straight to it in the source buffer. The list auto-refreshes as you move between buffers or edit code.

Currently supports Go, C, C++, Lua, and Python — adding a new language is just a couple of lines, so more should be easy to add over time.

It's pretty early and minimal by design, so I'd genuinely love any feedback — bugs, missing features, languages you'd want supported, or just general "this could be done better" type comments. Thanks for reading!

Repo: https://github.com/m2k3d/codemap


r/neovim 1d ago

Tips and Tricks Fully Lua Neovim Configuration Managed by Nix

Thumbnail
3 Upvotes

r/neovim 2d ago

Plugin touchup.nvim: Non invasive Markdown rendering

Thumbnail
github.com
92 Upvotes

I have tried many different markdown renders: markview.nvim, render-markdown.nvim or md-render.nvim. They are great, but they support way too many features and cosmetic foolery. LaTeX, rendering tables, hiding URLs etc. Good reason to create yet another Markdown plugin :)

Since Markdown is becoming the language of LLMs I wanted something minimal that would not jump around when going over a document or require another window rendering the results. Hence I forged some of the org-bullets.nvim logic to Markdown, added smart enter and some other concealing touches making sure none of them actually move the text you're reading/editing.

For tables I use https://github.com/hukkin/mdformat to just align the dashes and https://github.com/Feel-ix-343/markdown-oxide for Obsidian like exploration. This is all the bits I observed liking from org-mode and other knowledge systems.

This was made with assistance of AI


r/neovim 2d ago

Plugin Introducing Dora, a netrw-style directory explorer for Neovim 0.12+

Enable HLS to view with audio, or disable this notification

145 Upvotes

Hello, I'd like to share Dora - a netrw-style file explorer built for Neovim 0.12+. The goal of Dora is to make common interactions such as navigation and filesystem edits quick and easy by using carefully picked keys for builtin keymaps, and including useful features such as saving/restoring cursor position wherever possible, providing a browser-like history stack, and an undoable trash operation.

Dora falls into the category of netrw-style "split explorers", such as oil.nvim and vim-dirvish, while also providing a tree view. The only other plugin I'm aware that fills this niche is Fyler.nvim. However, unlike Fyler, Dora does not support editing the buffer, which frees up keys like h and l for use in mappings. Since I navigate much more frequently than I manipulate the filesystem, I find this to be a worthwhile tradeoff.

If this interests you, please give it a spin and let me know any feedback/issues you have and I'll do my best to address it. Thanks :)

Repo: https://github.com/beardedsakimonkey/nvim-dora


r/neovim 2d ago

Plugin squix.nvim - run SQL and navigate results with vim bindings

Thumbnail
gallery
142 Upvotes

Since last october I've been developing and using squix, a simple SQL runner for the terminal that lets you save and rerun queries across different databases. nvim is also my main and favorite editor, so I started working on a plugin to bring squix into it.

So for squix.nvim I went with this approach: write your SQL in a normal nvim buffer, then run an Ex command with your cursor on the query (or a visual selection) to open a terminal split with the results. Once there, the same vim bindings you use to move through character apply to the table cells instead:hjkl to navigate, gg/G jumps to the first/last row, v visually selects a range of cells and y yanks it, / searches cell contents, and so on (press H for the fulls shortcut list).

The main loop looks like this:

  • :SquixInit to create and save a database connection
  • :SquixSwitch to pick your active connection (future queries run against it)
  • :SquixRun to run the query under your cursor (or your selection)
  • :SquixAdd to save a query, later rerun it with :SquixRunNamedQuery

No keybinds are set by default, map whatever you like with setup()

Although squix CLI is more well established, the nvim plugin is still in its early days, so feedback on the workflow, commands, or anything that feels off would be appreciated. If you want to try it out, install the squix CLI:

go install github.com/eduardofuncao/squix/cmd/squix@latest
# check the repo for the release binaries 
# or options for nix, arch or homebrew

and then the plugin:

-- with lazy
{ "eduardofuncao/squix.nvim", opts = {} }

-- or with vim.pack
vim.pack.add({ "eduardofuncao/squix.nvim" })
require("squix").setup({})

Repos with docs and more detailed instructions:


r/neovim 2d ago

Need Help┃Solved Rust-analyzer ridiculously slow

3 Upvotes

Hey there, I started adding some proc macros to my rust project, and ever since, neovim has been almost unusable to code in because it's running so slow. I'm assuming it's an issue with rust-analyzer as some people have mentioned that proc macros can make it slow. But this is just ridiculous. Neovim is supposed to be lightweight but it takes so long that the editor starts to break down (my cursor will just disappear for a few minutes at a time). Does anyone have any ideas on how to fix this?

Some extra context:
- This does not happen when I'm working on other projects, only on my main rust project.
- Here is my LspInfo:
I know the 70 buffers seem weird, all of them are like: 15u a "[Scratch]" line 0, maybe that's the problem?

- LSP log level : WARN
- Log path: C:/Users/tav51/AppData/Local/nvim-data/lsp.log
- Log size: 4082 KB

vim.lsp: Active Clients ~
- rust_analyzer (id: 1)
  - Version: 0.3.2929-standalone (7ea2b259ca 2026-06-07)
  - Root directory: ~\Documents\FoundryEngine\Foundry
  - Command: { "rust-analyzer" }
  - Settings: {
      ["rust-analyzer"] = {
        lens = {
          debug = {
            enable = true
          },
          enable = true,
          implementations = {
            enable = true
          },
          references = {
            adt = {
              enable = true
            },
            enumVariant = {
              enable = true
            },
            method = {
              enable = true
            },
            trait = {
              enable = true
            }
          },
          run = {
            enable = true
          },
          updateTest = {
            enable = true
          }
        }
      }
    }
  - Attached buffers: 70, 90

r/neovim 2d ago

Need Help Trying to get GDscript LSP working in Neovim as a beginner; how do i enable it?

2 Upvotes

Context: i have used Quickstart for my entire init.lua. This means automatic gdscript support from treesitter, but i'm struggling with how to make LSP work with gdscript. This is what the entire LSP codeblock looks like:

---

vim.pack.add { gh 'j-hui/fidget.nvim' }

require('fidget').setup {}

-- This function gets run when an LSP attaches to a particular buffer.

-- That is to say, every time a new file is opened that is associated with

-- an lsp (for example, opening \main.rs` is associated with `rust_analyzer`) this`

-- function will be executed to configure the current buffer

vim.api.nvim_create_autocmd('LspAttach', {

group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),

callback = function(event)

-- NOTE: Remember that Lua is a real programming language, and as such it is possible

-- to define small helper and utility functions so you don't have to repeat yourself.

--

-- In this case, we create a function that lets us more easily define mappings specific

-- for LSP related items. It sets the mode, buffer and description for us each time.

local map = function(keys, func, desc, mode)

mode = mode or 'n'

vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })

end

-- Rename the variable under your cursor.

-- Most Language Servers support renaming across files, etc.

map('grn', vim.lsp.buf.rename, '[R]e[n]ame')

-- Execute a code action, usually your cursor needs to be on top of an error

-- or a suggestion from your LSP for this to activate.

map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })

-- WARN: This is not Goto Definition, this is Goto Declaration.

-- For example, in C this would take you to the header.

map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')

-- The following two autocommands are used to highlight references of the

-- word under your cursor when your cursor rests there for a little while.

-- See \:help CursorHold` for information about when this is executed`

--

-- When you move your cursor, the highlights will be cleared (the second autocommand).

local client = vim.lsp.get_client_by_id(event.data.client_id)

if client and client:supports_method('textDocument/documentHighlight', event.buf) then

local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })

vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {

buffer = event.buf,

group = highlight_augroup,

callback = vim.lsp.buf.document_highlight,

})

vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {

buffer = event.buf,

group = highlight_augroup,

callback = vim.lsp.buf.clear_references,

})

vim.api.nvim_create_autocmd('LspDetach', {

group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),

callback = function(event2)

vim.lsp.buf.clear_references()

vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }

end,

})

end

-- The following code creates a keymap to toggle inlay hints in your

-- code, if the language server you are using supports them

--

-- This may be unwanted, since they displace some of your code

if client and client:supports_method('textDocument/inlayHint', event.buf) then

map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')

end

end,

})

-- Enable the following language servers

-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.

-- See \:help lsp-config` for information about keys and how to configure`

---@type table<string, vim.lsp.Config>

local servers = {

-- clangd = {},

-- gopls = {},

-- pyright = {},

-- rust_analyzer = {},

--

-- Some languages (like typescript) have entire language plugins that can be useful:

-- https://github.com/pmizio/typescript-tools.nvim

--

-- But for many setups, the LSP (\ts_ls`) will work just fine`

-- ts_ls = {},

--

stylua = {}, -- Used to format Lua code

-- Special Lua Config, as recommended by neovim help docs

lua_ls = {

on_init = function(client)

client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua)

if client.workspace_folders then

local path = client.workspace_folders[1].name

if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end

end

client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {

runtime = {

version = 'LuaJIT',

path = { 'lua/?.lua', 'lua/?/init.lua' },

},

workspace = {

checkThirdParty = false,

-- NOTE: this is a lot slower and will cause issues when working on your own configuration.

-- See https://github.com/neovim/nvim-lspconfig/issues/3189

library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), {

'${3rd}/luv/library',

'${3rd}/busted/library',

}),

},

})

end,

---@type lspconfig.settings.lua_ls

settings = {

Lua = {

format = { enable = false }, -- Disable formatting (formatting is done by stylua)

},

},

},

}

vim.pack.add {

gh 'neovim/nvim-lspconfig',

gh 'mason-org/mason.nvim',

gh 'mason-org/mason-lspconfig.nvim',

gh 'WhoIsSethDaniel/mason-tool-installer.nvim',

}

-- Automatically install LSPs and related tools to stdpath for Neovim

require('mason').setup {}

-- Ensure the servers and tools above are installed

--

-- To check the current status of installed tools and/or manually install

-- other tools, you can run

-- :Mason

--

-- You can press \g?` for help in this menu.`

local ensure_installed = vim.tbl_keys(servers or {})

vim.list_extend(ensure_installed, {

-- You can add other tools here that you want Mason to install

})

require('mason-tool-installer').setup { ensure_installed = ensure_installed }

for name, server in pairs(servers) do

vim.lsp.config(name, server)

vim.lsp.enable(name)

end

end

-----

I tried setting vim.lsp.enable('gdscript') myself but that didn't change anything while i was editing my gdscript file. I also tried putting it in the servers list ( "local servers{ ..." ) but then i got the error that the server didn't exist. What am i missing?

I'm on Windows 11

nvim v0.12.4

Please let me know if you want me to give any more information


r/neovim 1d ago

Plugin prompt.nvim - native completion for @, /, and ! when writing terminal AI prompts in Neovim

0 Upvotes

I use terminal AI tools, but I prefer writing longer prompts in Neovim through their external-editor support.

The problem was that opening the prompt in an editor meant losing the tool-aware completion available in the terminal UI. References such as `@src/auth.ts`, slash commands, skills, and shell commands were just plain text.

So I built prompt.nvim. It lets you write prompts in a normal Neovim buffer while preserving the syntax expected by the underlying tool:

- `@` completes files and directories

- `/` completes commands, skills, prompts, or agents

- `!` completes executables and file arguments

Works with `blink.cmp`, `nvim-cmp`, or its built-in native completer

`:wq` returns the prompt to the terminal tool

Cancelling restores the original prompt byte for byte

It currently supports Claude Code, Codex CLI, Gemini CLI, OpenCode, and Pi. Claude Code and Codex are the stable connectors; the others are still experimental.

This is deliberately not another chat interface or AI client. It only makes Neovim a better external editor for tools that already support one.

Repository:

https://github.com/monkeymonk/prompt.nvim

The project is new, so I would particularly appreciate feedback on:

- the installation and shell setup

- completion behavior

- compatibility with different versions of the supported tools

- other terminal AI tools worth supporting


r/neovim 2d ago

Need Help Having problem with running lsp from a container to host

7 Upvotes

Hi! I have been trying to get Lsp work from my container to my host machine neovim. Most of my work is done inside the container so I have usually many of them. Right now I just mount my config, project directory to the container file and install neovim on every single one of them. This is kind of tedious and waste of my storage (not kind of but it is little bit taxing).

I would like to switch to simple workflow where I make changes to a file on the host machine and test or run the file in the container. This will make my life easier since I can't install a bunch of different dependencies on my system due to conflicting versions.

How can I make my Lsp work from the container ifself.

Right now this is my config.

```lua vim.filetype.add({ extension = { mlir = "mlir", }, })

return {
  "neovim/nvim-lspconfig",
  dependencies = {
    "williamboman/mason.nvim",
    "williamboman/mason-lspconfig.nvim",
  },
  config = function()
    local default_servers = {
      "lua_ls",
      "pyright",
      "clangd",
    }

    local mlir_get_executable = function()
      local homedir = os.getenv("HOME")
      local custom_path = homedir .. "/personal/github/llvm-project/build/bin/mlir-lsp-server"

      local cmd = { "mlir-lsp-server" }
      if vim.fn.executable(custom_path) == 1 then
        cmd = { custom_path }
      elseif vim.fn.executable("mlir-lsp-server") == 0 then
        return
      end
      return cmd
    end

    vim.lsp.config('mlir', {
      cmd = mlir_get_executable(),
      filetypes = { "mlir" },
      root_markers = { '.git', 'compile_commands.json', 'build' }
    })

    vim.lsp.enable('mlir')
    vim.diagnostic.config({
      virtual_text = true,
      signs = true,
      update_in_insert = false,
      underline = true,
      severity_sort = false,
      float = true,
    })

    -- Install default servers on first boot
    require("mason-lspconfig").setup({
      ensure_installed = default_servers
    })

    vim.lsp.enable(default_servers)

    vim.api.nvim_create_autocmd("LspAttach", {
      callback = function(args)
        local client = vim.lsp.get_client_by_id(args.data.client_id)
        if client and client:supports_method('textDocument/completion') then
          vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
        end

        vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Lsp: Jump to Definition" })
        vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Lsp: Function docstring and signature" })
        vim.keymap.set("n", "<leader>s", vim.lsp.buf.workspace_symbol, { desc = "Lsp: Symbol Search" })
        vim.keymap.set("n", "dt", vim.diagnostic.open_float, { desc = "Vim: Diagnostics" })
        vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Lsp: Jump to References" })
        vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, { desc = "Lsp: Rename a Symbol" })
        vim.keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ aysnc = true }) end, { buffer = 0 })
        vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { buffer = 0 })
      end,
    })
  end
}

```

After hitting my head on nail with AI. I got this pretty much useless cause it doesn't work.

```lua return { "neovim/nvim-lspconfig", dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", }, config = function() vim.filetype.add({ extension = { mlir = "mlir", }, })

local default_servers = {
  "lua_ls",
  "pyright",
  "clangd",
}

local function mlir_get_cmd()
  local custom = vim.fn.expand("~/personal/github/llvm-project/build/bin/mlir-lsp-server")
  if vim.fn.executable(custom) == 1 then
    return { custom }
  end
  if vim.fn.executable("mlir-lsp-server") == 1 then
    return { "mlir-lsp-server" }
  end
end

local mlir_cmd = mlir_get_cmd()
if mlir_cmd then
  vim.lsp.config("mlir", {
    cmd = mlir_cmd,
    filetypes = { "mlir" },
    root_markers = { ".git", "compile_commands.json", "build" },
  })
  vim.lsp.enable("mlir")
end

require("mason-lspconfig").setup({
  ensure_installed = default_servers,
})

vim.lsp.enable(default_servers)

local function attach_to_container(container)
  local host_prefix = "/home/pdev"
  local container_prefix = "/home/pydevc"

  local host_cwd = vim.fn.getcwd()
  local container_cwd = host_cwd:gsub("^" .. vim.pesc(host_prefix), container_prefix)

  for _, client in ipairs(vim.lsp.get_clients()) do
    client:stop(true)
  end

  local servers = {
    pyright = {
      cmd = { "pyright-langserver", "--stdio" },
      filetypes = { "python" },
    },
    clangd = {
      cmd = { "clangd" },
      filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
    },
    mlir = {
      cmd = { "mlir-lsp-server" },
      filetypes = { "mlir" },
    },
  }

  for name, spec in pairs(servers) do
    local cmd = {
      "podman",
      "exec",
      "-i",
      "-w",
      container_cwd,
      container,
      unpack(spec.cmd),
    }

    local config = {
      name = name,
      cmd = cmd,
      filetypes = spec.filetypes,
      root_dir = host_cwd,
      before_init = function(params)
        params.processId = vim.NIL
      end,
    }

    for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
      if vim.api.nvim_buf_is_loaded(bufnr)
          and vim.bo[bufnr].buftype == ""
          and vim.tbl_contains(spec.filetypes, vim.bo[bufnr].filetype) then
        vim.lsp.start(config, { bufnr = bufnr })
      end
    end
  end

  print("Attached LSPs to container: " .. container)
end

vim.api.nvim_create_user_command("AttachContainer", function(opts)
  attach_to_container(opts.args)
end, {
  nargs = 1,
})

vim.diagnostic.config({
  virtual_text = true,
  signs = true,
  update_in_insert = false,
  underline = true,
  severity_sort = false,
  float = true,
})

vim.api.nvim_create_autocmd("LspAttach", {
  callback = function(args)
    local client = vim.lsp.get_client_by_id(args.data.client_id)

    if client and client:supports_method("textDocument/completion") then
      vim.lsp.completion.enable(true, client.id, args.buf, {
        autotrigger = true,
      })
    end

    local opts = { buffer = args.buf }

    vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
    vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
    vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
    vim.keymap.set("n", "<leader>s", vim.lsp.buf.workspace_symbol, opts)
    vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
    vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
    vim.keymap.set("n", "<leader>f", function()
      vim.lsp.buf.format({ async = true })
    end, opts)
    vim.keymap.set("n", "dt", vim.diagnostic.open_float, opts)
  end,
})

end, } ```


r/neovim 2d ago

Plugin Nyx-Nvim - MCP bridge giving AI coding agents LSP/treesitter/git access inside Neovim

0 Upvotes

Built this to stop AI coding agents from working blind - instead of grep + raw file reads, the agent gets LSP references, treesitter AST, telescope search, and live buffer read/write through an MCP server.

Ran a small benchmark against the same model without these tools on a real codebase (Flask) - worth flagging upfront this was a single run per test, not a controlled statistical benchmark, so treat the numbers as directional rather than definitive. The gap showed up mainly on tasks needing deep context (refactoring, debugging) - less so on broad text search, where plain grep actually won.

Repo: https://github.com/Adithyaa71/nyx-nvim

Genuinely interested in this crowd's take on where MCP-based editor tooling actually helps vs where it's overkill.


r/neovim 4d ago

Plugin nvim-treesitter is apparently back

Thumbnail
github.com
897 Upvotes

Thanks immensely to clason for their contribution to such vital part of the ecosystem.

So vital that, with its short absence, there has been quite a fuss.


r/neovim 5d ago

Plugin I made a plugin for fast visual line navigation

226 Upvotes

I've always felt that jumping to a distant line is a bit awkward.

  • Typing a line number interrupts my flow.
  • Repeatedly pressing j/k gets tedious.
  • Searching only helps when I know what I'm looking for.

So I made hamal.nvim.

🔗 https://github.com/ergodice/hamal.nvim

✨ Features

  • 🎯 Jump to any visible line with only a few keystrokes
  • 🔀 Recursively divide the current window to narrow down your destination
  • ⚙️ Configurable number of divisions, keymaps, and highlights
  • ⚡ Lightweight
  • 📦 No dependencies

With the default 3-way division, a 100-line window can be navigated in at most 5 keypresses.

I'd love to hear what you think or if you have ideas for improving the navigation workflow.


r/neovim 4d ago

Need Help┃Solved How to clear a vim.notify() call from cmdline?

8 Upvotes

I want to output a notification to the user with vim.notify() but the notification should rewrite itself similarly to a printf("message\r") statement. The text will be something something a long the lines of "Found N pages" where the message would refresh itself to update N.

I've tried using vim.cmd.echo() to clear it or even just vim.cmd.echo() calls instead of vim.notify(), but I get the same behaviour. Any help with this would be great!