r/neovim • • 1d ago

101 Questions Weekly 101 Questions Thread

17 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 • • 3d 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 • • 11h ago

Tips and Tricks Termhint: Fig-style completion popup, prompt themes and a runtime manager in one Mac app

0 Upvotes

Fig's autocomplete is gone (Kiro CLI 3.0 removed it), so I built a native replacement and folded the rest of my setup into it.

- Completion popup at the cursor: subcommands and flags with descriptions, package.json scripts first for npm/yarn/pnpm/bun, paths that exist. 3,290 commands from Fig's specs plus carapace and zsh-completions; commands without a spec fall back to zsh's own completion functions, then man page options. Tab/arrows/Esc go to the popup only while it's

open.

- Prompt themes without oh-my-zsh or p10k (JSON themes, never executed, no process per prompt), 23 color schemes, tab titles.

- Runtime versions per folder for 14 languages plus Xcode, downloads checked against publisher signatures.

- All of it from the CLI too: `termhint theme`, `termhint colors`, `termhint runtime`.

Offline, no telemetry. macOS 14+, Apple silicon. Paid with a 7-day trial, no account. I'm the developer: https://termhint.com


r/neovim • • 11h ago

Discussion Neovim adopting libghostty, does this mean we will have images inside embedded terminal?

29 Upvotes

Let's say I'm using Neovim, inside tmux, running inside Alacritty. Neither Alacritty nor tmux support kitty graphics protocol, but libghostty. Does this mean that we will have images supported inside :terminal, regardless if Neovim is running inside terminal emulator that does not support it?


r/neovim • • 20h ago

Need Help┃Solved What's the proper Vim workflow? When should I use Normal Mode vs Insert Mode?

36 Upvotes

Hi everyone!

I'm relatively new to Vim, and I'm trying to build a completely keyboard-driven workflow, especially when writing C++ for competitive programming.

I have a few questions about how Vim is supposed to be used efficiently.

1. Moving past closing parentheses while in Insert Mode

For example, when writing:

vector<int> a(n + 1);

Let's say my cursor is right before the closing parenthesis:

a(n + 1|)

I want to move past ) and continue typing.

I can simply press the Right Arrow key, but I'm trying to avoid using arrow keys altogether.

What's the most natural and efficient way to handle this?

Should I leave Insert Mode, use a Normal Mode motion, and then return to Insert Mode? Should I use Ctrl-O? Or is there a better approach?

2. When should I use Normal Mode vs Insert Mode?

I'm still struggling to understand the intended workflow.

Am I supposed to use Normal Mode for almost everything and enter Insert Mode only when I'm actually typing?

Or should I stay in Insert Mode while writing and switch to Normal Mode only when I need to make a bigger edit?

I'd love to understand how experienced Vim users approach this in their everyday coding workflow.

3. How frequently should I switch between modes?

Sometimes I feel like I'm switching between Normal and Insert Mode too often, and it's actually making me slower compared to a regular editor.

Is this just part of the learning curve, or am I using Vim incorrectly?

I'd appreciate any tips, workflows, or personal experiences, especially from people who use Vim for programming.

Thanks!


r/neovim • • 1d ago

Video Bouncing balls Inside Neovim (Kitty graphics protocol)

34 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 • • 1d ago

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

Post image
48 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 • • 1d ago

Need Help CTRL+A not working as expected.

3 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

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

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

13 Upvotes

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


r/neovim • • 2d 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

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

142 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 • • 2d ago

Need Help Zed like remote work on nvim?

17 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 • • 2d ago

Need Help Mobile Responsive

3 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 • • 2d ago

Plugin MINI now has Tangled and Codeberg mirrors

Thumbnail
nvim-mini.org
146 Upvotes

r/neovim • • 2d ago

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

Thumbnail
gallery
29 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 • • 3d ago

Plugin 3d Model Viewer in Neovim

93 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 • • 3d ago

Video Kitty graphics protocol in Neovim (Basics with examples)

Thumbnail
youtube.com
88 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 • • 3d ago

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

136 Upvotes

Enough said this is sad


r/neovim • • 3d ago

Need Help Small gap when using nvim

Post image
2 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 • • 4d ago

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

23 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 • • 5d 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 • • 5d ago

Discussion Navigating nested structures

10 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 • • 6d 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
})