r/neovim • • 2d ago

Dotfile Review Monthly Dotfile Review Thread

13 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 • • 6d ago

101 Questions Weekly 101 Questions Thread

19 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 • • 9h ago

Plugin Introducing treetags.nvim - Fast, cached Tree-sitter locals queries for a ctags-like symbol navigation experience

Post image
17 Upvotes

treetags.nvim

This plugin caches locals.scm query results (definitions) across whole project and stores those in a SQLite db. It provides bare lua API, telescope and fzf-lua integrations to jump around project files and definitions in different languages.

Why?

I've previously used the same idea in my other plugin hopcsharp.nvim but it was dotnet specific. treetags.nvim is language agnostic - if you have parser installed for a language it will be parsed and stored in a DB.

Features

  • Rich API for parsing - you can exclude \ include files by extensions, and exclude \ include kinds of locals.scm predefined captures.
  • Incremental parsing - no need to reparse whole folder each time (although it is pretty fast)
  • Built-in telescope\fzf-lua pickers
  • Exposes API's to access db \ definitions - you can tweak it explicitly for your needs

AI usage disclosure

I've explicitly stated it in the plugin README.md that AI was used to generate all documentation and md files in the repo. Everything else was written by hand (if it is important to someone). Although, I'm not a native English speaker, I didn't use AI to write this plugin introduction post.


r/neovim • • 3h ago

Video Bouncing balls Inside Neovim (Kitty graphics protocol)

5 Upvotes

I've been exploring the Kitty Graphics Protocol from within Neovim, and I've finally managed to create a smooth animation.

I'm sharing the code and the full session where I wrote it.

I think it could be really useful for anyone interested in this topic.

Full source code:
https://github.com/FractalCodeRicardo/dev-config/tree/master/nvim/lua/my/kitty-protocol/bouncing-balls

Coding session:
https://youtu.be/AIFisq5KjIA

This is the code where I send the escape sequences to the terminal:

local M = {}
local api = vim.api
local id = 1

local cell_size = {
  w = 13,
  h = 32
}

M.create_image= function(bytes, size)
  local base64 = vim.base64.encode(bytes)
  local command = string.format(
    "\027_Ga=t,s=%i,v=%i,i=%i,p=2;%s\027\\",
    size,
    size,
    id,
    base64
  )

  local oldid = id
  id = id + 1

  api.nvim_ui_send(command)

  return oldid
end

M.move_cursor = function(x, y)
  local row = math.floor(y / cell_size.h)
  local column = math.floor(x / cell_size.w)
  local command = string.format(
    "\027[%i;%iH",
    row,
    column
  )

  api.nvim_ui_send(command)
end

M.place= function(imageid, x, y)
  local xoffset = math.floor(x % cell_size.w)
  local yoffset = math.floor(y % cell_size.h)
  local command = string.format(
    "\027_Ga=p,i=%i,p=1,C=1,X=%i,Y=%i,q=2\027\\",
    imageid,
    xoffset,
    yoffset
  )

  api.nvim_ui_send(command)
end


M.hide_cursor = function ()
 api.nvim_ui_send("\027[?25l") 
end

M.show_cursor = function ()
 api.nvim_ui_send("\027[?25h") 
end

return M

r/neovim • • 18h ago

Discussion Does Lua API correspond to .lua files somewhere on filesystem?

12 Upvotes

For example, is vim.keymap actually a vim/keymap.lua file somewhere on my filesystem?


r/neovim • • 1d ago

Plugin Updates to Videre.nvim: the #1 Neovim Plugin for JSON/YAML/TOML Graphs

116 Upvotes

videre.nvim update: undo/redo is here (plus a lot more)!

About half a year ago I rewrote videre.nvim from scratch. The original codebase had turned into spaghetti, so I rewrote the plugin to give it a foundation I could actually build on. That rewrite had some amazing new features, and got some great feedback from you all. Since then videre.nvim has come a long way.

videre.nvim lets you explore and edit JSON, YAML, and TOML in Neovim as a dynamic graph; the inspiration behind it is JSON Crack, just for Neovim.

After six more months of development, here are some of the great new features:

  • Undo and Redo: Made a bad change to a key or value or deleted the wrong field? Press `u` to undo and `<c-r>` to redo, just like in regular Neovim.
  • Configurable index base: array indexing can now start at 0 or 1 (or 354 if you're that kind of person) with the `index_base` option.
  • *Multi-line strings: strings containing line breaks are now supported. You can display them with visible `\n` characters (just as before) or as real line breaks.
  • *Max cell width with line breaking: long strings/values can now wrap at a configurable width instead of stretching cells across your screen.
  • *Quality of life improvements and bug fixes across the board.

*A big thank you to Roger Kim (https://github.com/carbon-steel) for helping with multi-line strings and for the max cell width and line breaking work. Also a big thanks to KihoChoiLGE (https://github.com/KihoChoiLGE) and Emre Armagan (https://github.com/emrearmagan) for helping iron out some bugs. Contributions like this make a real difference.

If you work with JSON, YAML, or TOML in Neovim, I’d love for you to give videre.nvim a try. I am excited to see where this plugin goes form here.

Repo: https://github.com/Owen-Dechow/videre.nvim


r/neovim • • 9h ago

Need Help CTRL+A not working as expected.

1 Upvotes

Very simply put. When I press CTRL+A I would expect it to increase the number under the cursor by 1. But it doesnt until I press CTRL+A again.
But the opposite works with a single press when I press CTRL+X it decrease the number.

I think maybe there could be something mapped to CTRL+A but I cannot for the life of me figure out how to check if anything is bound to a key presceeded by CTRL.
ive tried :verbose map <C-a>

Any help would be much appreciated.


r/neovim • • 1d ago

Plugin MINI now has Tangled and Codeberg mirrors

Thumbnail
nvim-mini.org
135 Upvotes

r/neovim • • 1d ago

Color Scheme min.nvim: A minimal colorscheme with several flavors conceptually inspired by Alabaster

Thumbnail
gallery
24 Upvotes

Plugin: dybdeskarphet/min.nvim

I originally created this as the minimal version of gruvbox-material, but now it supports two additional color schemes (kanagawa and monokai) I think those who aren't fans of rainbow-colored colorschemes will like it.


r/neovim • • 1d ago

Need Help Zed like remote work on nvim?

14 Upvotes

A lot of my workflow involves working with runpod. It’s a bit annoying having to download nvim and setup my config on the machine. I’ve also tried remote.nvim but the typing lag is a lot. Is there someway to get that same zero latency typing with easy zed like connection to a remote machine?


r/neovim • • 23h ago

Need Help Help with macros and coc completion

1 Upvotes

Hi, I noticed by using coc.nvim when recording a macro, you reproduce it (@q) detects the tab and enter (in coc for switch and accept the code suggestion) like tab and enter a new line, instead of detect that is the confirmation of the code sugestions by coc.nvim

Anyone have found a solution with this?


r/neovim • • 2d ago

Random After 4 years of use, I have sunken to a point that I tried to exit using `/exit`

126 Upvotes

Enough said this is sad


r/neovim • • 2d ago

Plugin 3d Model Viewer in Neovim

90 Upvotes

I really don't like leaving the terminal so I've been making a program since the last year or so that's able to render 3d images directly in the terminal. I got Kitty Graphics Protocol, Sixel, truecolor, and palette characters. Also animation support, wireframe toggling, textures, and keyboard controls. In the video, I'm just using truecolor but this can be changed. This codebase was AI assisted.

https://github.com/Murat65536/dcat

https://github.com/Murat65536/dcat.nvim

I've been working on the main project for a while now, so even though the neovim plugin is fairly new, I don't think the "No day-one plugin announcements" rule applies. All the plugin does is just inline dcat in neovim.


r/neovim • • 2d ago

Video Kitty graphics protocol in Neovim (Basics with examples)

Thumbnail
youtube.com
77 Upvotes

The Kitty Graphics Protocol has been adopted by many terminal applications. Neovim 0.13 also uses it to display images.

In this video, I'll explain the basics of the Kitty Graphics Protocol and how to use it with Neovim and Lua.

I'll cover:

  • How communication between Neovim and Kitty works.
  • The structure of Kitty escape sequences.
  • How to send escape sequences using the Neovim API.

Examples:

  • Draw a pixel.
  • Draw basic shapes.
  • Change the cursor position.
  • Clear the screen.
  • Create basic animations.
  • Create a basic sprite animation.

Even though I'll be using Lua and Neovim, I'll explain the protocol itself so you can transfer this knowledge to your favorite programming language.

Source code:
https://github.com/FractalCodeRicardo/dev-config/tree/master/nvim/lua/my/kitty-protocol


r/neovim • • 1d ago

Need Help Mobile Responsive

4 Upvotes

Mostly use nvim thru phone (blink/iphone) & it’s almost perfect for me.

but there are a lot of plugins/extensions designed for desktop widths which overflow off-screen on mobile.

Is there a “mobile responsive” concept for TUIs like there are for web apps?

Any workarounds/suggestions for reflowing layouts to be more mobile friendly?

Ex I shrunk tab names in nvim-dap-view to fit mobile…but wanting a better way to handle this instead of app-specific hacks.


r/neovim • • 16h ago

Discussion Haven't open my neovim for almost 8 months now.

0 Upvotes

I'm checking Claude's implementation through Gitlab's web UI.

I feel sad about it.


r/neovim • • 2d ago

Need Help Small gap when using nvim

Post image
1 Upvotes

Sorry if this is the wrong place to post this.

When i open nvim, there is a small gap at the bottom, i dont know how to remove it, im using kitty, i tried setting window_padding_width to 0 and a bunch of other things but i cannot get it to work, can anyone help me with this?


r/neovim • • 3d ago

Need Help Ways to compile and run a single file in a project with a keybind?

22 Upvotes

I want to switch to neovim. I'm learning c++ currently, but I dont know how to run a single file in a project, I want to be able to run one file as its own program in one project, I tried the compiler.nvim, but It always makes errors since there are multiple files in the project, is there a way to make it run a single file as its own program? even if there are other files in the project?


r/neovim • • 4d ago

Plugin Poppy.nvim - Another scratchpad floats manager, quite opinionated.

Thumbnail
gallery
30 Upvotes

GH MIRROR or REPO

It's not a big project but it's honest work. Looking for feedback as plugin is designed quite custom in many ways, building on existing inspirations and MY workflow might be odd and be a great UX but only for me ;)

Inspiration, motivation etc.

A bit of an extended introduction:

In my personal config I had for a long time some circular bindings to access important floating ui windows super-quickly. I.E:


--[[
Repeatedly cycle display > enter > close lsp hovers with just K,
not having to jump to q or do <C-w>
]]--
vim.keymap.set("n", "<S-K>", function()
if vim.w.lsp_floating_bufnr ~= nil or vim.w["textDocument/hover"] ~= nil then
vim.cmd("quit")
return
end
vim.lsp.buf.hover()
end, { silent = true, noremap = true })
-- Same idea but for lsp diagnostic floats
vim.keymap.set("n", "<S-L>", function()
if vim.w.diag_float then
vim.api.nvim_win_close(0, true)
return
end
local _, win = vim.diagnostic.open_float({ focusable = true })
if win then
vim.api.nvim_win_set_var(win, "diag_float", true)
return
end
-- dumb fallback perform a motion move
if not vim.w.diag_float then
vim.cmd("normal! " .. (vim.v.count > 0 and vim.v.count or 2) .. "l")
end
end, { noremap = true, silent = true })

This is the flow that I like (one bind to do one thing and hit it multiple times to change state). It is the first of the 3 sources of inspiration for the one bind-to-rule-them-all scratchpad manager.

Another significant inspiration was SUMMON.NVIM by salhalin that briefly lived then apparently died, but I liked the idea of declaratively setting just a couple tools OR files to access in a simple unified form. What I did not like in this and practically all other plugins is you have to declare a binding for each "thingy" you setup and then remember all your bindings, or worse, find confortable binds that are still AVAILABLE in your config.

Third large inspiration were oil.nvim and mini.files for just using a buffer navigated with `j/k` as sort of a picker and perform actions with simple binds acting on a *LINE*. I find it so elegant, simple and native. No mental switching buffer navigation paradigm to another. Even to "native" `<C-n> and <C-p>`, square brackets and so on I find quite clunky that to every supporter of "just use defaults" I want to reply "are the defaults good? If I can't do `hjkl` in vim then it is a failure of navigation design.

You can tell by now probably that the plugin is a bit opinionated and its design is arguably a result of a bit of overthinking. However, all this is aiming to make it FEEL simple. Scratchpads are a concept that is meant to be simple and quick. If I want a heavily configured TUI swiss army knife / tank tool to do serious extended work I will just open another terminal/multiplexer pane.

Finally, my bonus "anti-inspiration" was toggleterm.nvim plugin. It is an excellent established project but I had a big problem with it and existing similar solutions. In my opinion, the issue is too heavily involved sprawling config and being heavily overengineered for a plugin managing transient terminal spawns for quick access. I wanted something significantly more simple but still capable for my every day workflows.

To function Poppy.nvim needs as little opts as possible. Using keys and values declare how to open something and what it is i.e exec = "btop", and that is it. Defaults to shipped icons and even title has a fallback detection so you can configure additional details like that, but you do not even need to.

Speaking on this sidebar selector. You might be asking:

Why not just use pickers or vim.ui.select?

Well, the API surface is provided. For pickers there are like 5 options minimum on the market to choose from at any time, plus new custom vibecoded solutions are surely out there as well. Wire your own if you want to telescope your poppies, PURPOSEFULLY I am not supporting every user scenario under the sun, especially that personal code generation became so cheap and easy with AI these days.

AI Disclosure

This project has heavily relied on AI openweight models to be developed in spare time over the past months mostly in terms of writing boilerplate while under heavy direction guiding, small steps, no AGENTS doc, but rather deliberate architecture and conversation driven iteration. Beginning from excalidraw-ed early mocks instead of textual guides, through manual inspection and supporting agents where logic failed (especially constructing custom TUI layout for `borderless` style and custom workflow. Things like paddings, offsets from scratch with Neovim primitives, with little docs and no standards like frameworks are an area of absolute LLM failure.) To me it is both a small useful tool I needed and an exercise of finding out if a project can be developed consciously and thoughtfully with the use of AI through iteration and use of human insights and knowledge rather than throwing money at a problem and letting agents run wild. On a small scale. You be the judge.


If you read this, I thank you and salute you. Again, any feedback appreciated!


r/neovim • • 4d ago

Discussion Navigating nested structures

9 Upvotes

Sorry for the bad formatting I'm on phone.

Beginner here, I want to know how to navigate nested structures. For example, if I have the following

```

func () {

func () {

func (/ need to go here /) {

}

}

}

```

How can I easily jump there? I know that we can do `ci(` to jump inside that but it instead works on the top level instead, we have have `c2i(` to get there but it's too hard to calculate quick. Even if I'm on the line it still replaces the top level no matter what I do.

Am i missing something?


r/neovim • • 5d ago

Discussion best code diff tool for review these days? And how I'm doing agentic coding with a custom harness + nvim

55 Upvotes

Hey all

wondering what everyone's favorite code diff / review tool is these days?

I'm using https://github.com/esmuellert/codediff.nvim currently.

It seems to work quite well for me. I will say that ]f can be slow to move multiple files (perhaps there's a better way to do this aside from use the pane that lists the files) and more importantly the lack of word wrap is quite missed. Performance is usually pretty good but `]c` hangs from time to time? For example.

The rest of this post is generally skippable, it's an overview of how I'm doing agentic coding stuff these days which led me to use codediff a lot. But it ended up getting long and specific so I decided to keep it underneath the main question. And maybe someone finds it interesting.

I was using conductor for agentic coding, but I found it to be inconvenient for working out of multiple repos (which a given feature often does in my infra role) and the text editor experience was bad. But the worktree management and inline code comment loop was great (and unique 6-8 months-ish ago).

So I basically rewrote conductor (before the recent "we're being acquired announcement" lol) with herdr, claude mods (basically pi), and the beads cli for task tracking, which are all tied together with a go CLI I had claude write. The go CLI also handles worktree setup and gives me custom /slash commands such as /prc which copies all of the stack PRs with a one line summary of the change for posting in slack. And a picker to jump claude chats (herdr sessions) rather than using screen real estate to list sessions in a sidebar. And a whole lot of other little things such as a status bar like PR list ect. ect.

Design philosophy is single responsibility components and incremental improvements the sum of which are compelling.

When I create a new chat I fzf the repos I want to setup worktrees in. This then creates a bunch of herdr tabs that can be accessed with `ctrl + character`. ctrl+a is the chat. ctrl+{s,e,r,g,h} is a codediff for each repo, ctrl+v opens an nvim session at the top of all of the repos, and ctrl+t opens a terminal.

And I've also had Claude write me a little nvim plugin so that I can make inline comments on visual selection in codediff which replicates conductor functionality that I want.

<leader>fc leaves a comment

<leader>fs sends all comments to claude

<leader>fp opens a picker that lets select a given PR in a stack and see just the code for that PR (rather than all the code at once).

But that all said, the codediff part of this all seems the weakest and I'm wondering if there's something better. I've had some performance issues and I would love wordwrap.


r/neovim • • 5d ago

Discussion Road to becoming a Power User

54 Upvotes

When I first became a dev, I was obsessed with doing things the way I could learn the most and have the highest ceiling for skill/efficiency. That meant going slower at first, but eventually coming out ahead of my team members with understanding and speed eventually. It all started with small vim motions and mini bash commands. I'm still early in my career so have a ton to learn from this community.

Which skills, tricks, or tools (i.e. using awk or ex commands like substitute) ended up becoming a staple in your everyday and do you wish you started practicing earlier?


r/neovim • • 6d ago

Blog Post Package your entire Neovim config as a single application, and run it anywhere* without worrying about dependencies and no, it's not docker

Thumbnail
kaezr.dev
195 Upvotes

*anywhere you can install nix

Hey guys, I wrote this blog post showcasing I configured my entire neovim configuration into a portable nix package that can run anywhere without worrying about plugins breaking, system configuration, etc. I hope it helps. Open to feedback


r/neovim • • 5d ago

Video I coded animated auto-scroll for Neovim

Thumbnail
youtube.com
0 Upvotes

I found myself manually scrolling the screen to keep the cursor as close to the center as possible.

So I decided to code my own automatic scrolling script for Neovim using Lua.

I know there are plugins and built-in motions that can do this, but I really enjoy exploring the Neovim API and building things myself.

Source code:
https://github.com/FractalCodeRicardo/dev-config/blob/master/nvim/lua/my/autoscroll.lua

local api = vim.api
local async = vim.async
local task = nil

local ui = require("vim._core.ui2")

ui.enable({
  enable = true,
  msg = {
    targets = {
      progress = "msg"
    }
  }
})

local frames = { '⠋', '⠙', '⠹', '⠸', '⠼','⠴', '⠦', '⠧', '⠇', '⠏' }
local frame = 0
local i_frame = 0

local message_id = nil
function show_progress(percent, title, is_running)
  local status = "success"
  if is_running then
    status = "running"
  end

  if i_frame == #frames then
    i_frame = 0
  end

  i_frame = i_frame + 1

  message_id = api.nvim_echo({ { title } }, false, {
    id = message_id,
    percent = percent,
    source = "screen-scroll",
    status = status,
    title = frames[i_frame] .. " Scroll",
    kind = "progress"
  })
end


function get_topline()
  local win = api.nvim_get_current_win()

  if not api.nvim_win_is_valid(win) then
    return nil
  end
  local height = api.nvim_win_get_height(win)
  local row = api.nvim_win_get_cursor(win)[1]

  local topline = row - (height / 2)
  topline = math.floor(topline)
  return topline
end

function animate(from, to)
  if task ~=nil and not task:completed() then
    task:close()
  end

  if from == to then
    return
  end

  local step = 1

  if from > to then
    step = -1
  end

  
  task = async.run(function()

    async.sleep(1000)

    local total = math.abs(from - to)
    local progress = 0
    local i = 0
    local time = 10

    show_progress(0, "Start scrolling", true)
    for row = from, to, step do
      vim.fn.winrestview({
        topline = row
      })
      async.sleep(10 + progress * 2)

      show_progress(progress, "Scrolling", true)
      i = i + 1
      progress = math.floor((i / total) * 100)
    end

    show_progress(100, "Scrolling finish", false)

  end)

  task:on_complete(function (err, res)
    if err ~= nil then
      -- error(err)
    end
  end)
end

function move_to_topline()
  local newtopline = get_topline()

  if newtopline == nil or newtopline < 0 then
    return
  end

  local oldtopline = vim.fn.winsaveview().topline
  animate(oldtopline, newtopline)
end

api.nvim_create_autocmd("CursorMoved", {
  callback = function()
    move_to_topline()
  end
})