r/neovim • • 2d ago

101 Questions Weekly 101 Questions Thread

6 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

Video remark.nvim a plugin to review code from coworkers or agents

Thumbnail
youtu.be
17 Upvotes

TLDR:

Most of the time I spend developing now is reviewing others code or AI code. I want to do that in Neovim

remark.nvim is a plugin I made that makes this easy

https://github.com/smnatale/remark.nvim


r/neovim • • 9h ago

Need Help Help: Kitty/Ghostty paired with snacks.nvim issue on ipynb.nvim

10 Upvotes

Does anybody know what happen here?

Whenever I add/delete new lines, there seems to be a line persistence issue. Strangely, this does not happen to the native terminal in MacOS; only Kitty and Ghostty experience this.


r/neovim • • 11h ago

Discussion Using terminals rather than tmux

22 Upvotes

Long time vim user (12 years) and tmux too. I've always combined my coding sessions within tmux because of panes, windows and all of that.

Recently, I've setup nvim-dap and nvim-dap-view which helped me avoid use of gdb or lldb outside of neovim plus the very convenient debugging session directly in the editor.

I've also started using the embedded terminal because it's way easier to copy/paste motions directly from the terminal view rather than going through the tmux pane. There are still some habbits that are hard to forget. For example, exiting the terminal view is a different keybind. I've mapped two shortcuts to get it quicker:

local function map(mode, suffix, help, func)
    vim.keymap.set(mode, suffix, func, { desc = help })
end

map("t", "<C-Esc>", "Escape terminal", [[<C-\><C-N>]])
map("t", "<C-O>", "Escape terminal (alternative)", [[<C-\><C-N>]])
map("t", "<C-T>", "Escape terminal and focus last window", [[<C-\><C-N><C-W>p]])

Now I feel like my tmux needs are pretty much unnecessary. I can do almost everything from neovim. Even though I rarely use tabs, sometimes I do just to separate the window layout without altering the main one.

I'm curious about your usage, advises or ideas and if you're using the embedded terminal with neovim or not.


r/neovim • • 16h ago

Discussion Is Neovim good for every language, or are there languages where you still can't replace a full IDE?

54 Upvotes

I'd like to know whether Neovim is good for any language, or whether it still can't fully replace an IDE in some cases. Do you have a language or platform where you just can't swap your IDE for Neovim?

In my case it's C#. Without an IDE I feel like I'm missing a lot. There are ready-made plugins, but they don't feel right for Neovim. They seem to imitate an IDE environment, with custom floating windows and panels like in a GUI. Personally, I don't think that's a plus in a TUI, but I might be wrong.

Will languages like Java and C# always be IDE-oriented? Other languages are perfectly fine with just Neovim or Zed, but with these two, Neovim feels somehow out of place. What is that related to? Why do languages like Rust and TypeScript feel natural in Neovim, while Java and C# don't?


r/neovim • • 18h ago

Blog Post Minimal Neovim Setup

Thumbnail gabrielchoong.com
47 Upvotes

Hello everyone. I spent a few days writing a blog about configuring a minimal Neovim setup. I have been using Neovim since the 0.10.0 update which was a bit over 2 years ago.

I would like to ask for feedback regarding of what could be improved. This is my first time writing a technical blog hence I would like to request for some real world feedback from the community.

All of the writing is written without any AI assists. Although some of the code snippets included in the blog post might contain traces of AI assisted code since they were yanked directly from my Neovim config which I did use it to help me debug certain issues a while ago.

Thanks in advance.

Gabriel


r/neovim • • 1d ago

Need Help Language-aware code alignment in Neovim?

14 Upvotes

Hi everyone! I have a use case that I'd like to automate somehow, and I'd like to know if anyone knows how to achieve this.

I'm looking for a Neovim solution that can do the following:

type User struct {
    ID string `json:"id,omitempty"`
    Status UserStatus `json:"status"`
    CreatedAt time.Time `json:"created_at"`
    Password UserPassword `json:"-"`
    Admin bool `json:"admin"`
}

// ... into this:

type User struct {
    ID        string       `json:"id,omitempty"`
    Status    UserStatus   `json:"status"`
    CreatedAt time.Time    `json:"created_at"`
    Password  UserPassword `json:"-"`
    Admin     bool         `json:"admin"`
}

Basically, I'm looking for automatic, language-aware alignment, similar to how you can comment or uncomment a block of code in Neovim using visual selection + gc.

I'm not looking for something specific to Go or struct fields, but rather a general-purpose solution.


r/neovim • • 1d ago

Need Help Looking for an HTML template plugin (simpler solution always welcome)

4 Upvotes

So I used NvChad for what seemed like forever.
But ever since version 0.12 I've been keeping things VERY minimal. I haven't done any web dev stuff in a long time, so I guess it would make sense that something like this would go unnoticed.

I'm not the biggest Lua fan...I mean I'd like to get better at it eventually, so for the time being I just sort of tolerate it and ever since the major update things have been kind of confusing.

But to get to the main point of this post; I was curious if there was some kind of plugin that could help me create an HTML template? It would be great if I didn't need another and there was a simpler solution that I'm not seeing.

Currently the plugins I'm using that I suspect would be related to the subject are:

mason, nvim-lspconfig, mason-lspconfig, and mason-tool-installer.

I'm also using the superhtml lsp, and while the popup works, apparently I guess it doesn't have any kind of "!DOCTYPE html" selection. I even tried the emmet-language server and that didn't work either.

I've never used it but, by any chance would blink.cmp solve this?

Any advice or feedback of course would be greatly appreciated. Many thanks in advance.


r/neovim • • 1d ago

Plugin lathe.nvim: a Java language server that takes its settings from your build

Post image
46 Upvotes

Lathe 0.4.0 is out. I posted about an earlier version here, so this is an update for anyone who missed it or wanted to try it.

Lathe is a Java language server with a first class Neovim support. Instead of building its own model of your project, it takes the compiler settings from your build and uses javac, so the editor sees your code the way the build does. Disclosure: Lathe is largely written by AI coding agents, and I review every change.

You don't need to change your build to try it: install lathe.nvim, open a Java file and run :LatheInit. You get completion, compiler errors, navigation and refactoring, plus run, test and debug (with neotest and nvim-dap).

0.4.0 supports Maven 3.6.3+, Gradle 8.8+, the OpenJDK build, runs on JDK 17+, and picks up the formatter your build uses.

Neovim 0.12+ on Linux or macOS. Beta, open source.

Plugin: https://github.com/ag-libs/lathe.nvim
Docs: https://github.com/ag-libs/lathe
Comparison with JDT LS: https://github.com/ag-libs/lathe#compared-with-jdt-ls

If you try it on your project, I'd like to hear how it goes.
Thank you for reading.


r/neovim • • 1d ago

Plugin Updates to leblocks/toggle.nvim

Post image
31 Upvotes

It's been 9 months since I posted about my toggling plugin: Yet another toggle plugin leblocks/toggle.nvim : r/neovim

leblocks/toggle.nvim

I've added couple of new features since then:

  • Option to preserve cursor position after toggle
  • Toggling in visual selected text
  • End of word toggling
  • Mappings by filetype - different toggles based on a current file filetype

I hope that with the help of community we can build very good and rich default mappings that will cover most of toggling use cases. I myself more of a dotnet, and a powershell developer and tried to bring some defaults that seemed logical to me, but with help of the community that can be done muuuuch better.


r/neovim • • 2d ago

Tips and Tricks Minimal mark picker

Post image
47 Upvotes

I'm using this tiny marks config (just 14 lines). What do you think? Is it better to just use the picker from Telescope/Fzf, or should we go with the barebones approach (:marks and m + LETTER)?

Anyway, I'm surprised by how easy it is to build a mark picker using the Neovim API!

-- set mark mLETTER
-- show marks sm

local function show_marks()
  local marks = vim.fn.getmarklist()
  local list = vim.tbl_map(function(m)
    return m.mark .. " -> " .. m.file
  end, marks)
  vim.ui.select(list, { prompt = "Marks" }, function(item, index)
    if index == nil then return end
    vim.cmd("normal! " .. marks[index].mark)
  end)
end

vim.keymap.set("n", "sm", show_marks)

r/neovim • • 2d ago

Plugin scaled_markdown.nvim

Thumbnail gallery
36 Upvotes

r/neovim • • 2d ago

Random Neovim 0.12.7 released

Thumbnail
github.com
222 Upvotes

r/neovim • • 2d ago

Meme Monthly meme thread

5 Upvotes

Monthly meme thread


r/neovim • • 3d ago

Color Scheme Stencil: yet another Alabaster with ANSI colors

Thumbnail
gallery
30 Upvotes

Here is another theme inspired by Tonsky's Alabaster: Stencil. The main idea is to make color actually work by highlighting only what's important:

  • Green: type declarations
  • Red: function and method declarations
  • Blue: variable, field, and property declarations
  • Purple: constants
  • Cyan: strings
  • Yellow: comments

I run Neovim in Ghostty using native window splits, and keeping terminal and Neovim colorschemes in sync is annoying. Since this palette only needs a handful of colors anyway, I hooked the theme directly to the terminal's ANSI colors.

I don't use many plugins, so some highlight groups might be missing. Markdown is also intentionally unhighlighted since it's designed to be readable as plain text.

I've been using it for a week and I'm quite satisfied with it so far. The screenshots show it running with Ghostty's built-in Moonfly and Alabaster themes.

Contributions are welcome, or feel free to fork it and adjust it to your own taste.


r/neovim • • 4d ago

Need Help Helix multicursor bindings for nvim 0.13

11 Upvotes

Have anyone managed to replicate the helix binds with s to add multicursors within selection?


r/neovim • • 4d ago

Need Help How do you navigate files in nvim?

91 Upvotes

I find it tedious to repeatedly press leader+ff to fuzzy find the file I'm looking for. I was wondering if there is any "nvim way" to do this better.


r/neovim • • 5d ago

Plugin imselect.nvim – Your input method follows what you edit, not just your Vim mode

94 Upvotes

Hey r/neovim!

I'd like to share a plugin I've been working on: imselect.nvim.

As a Chinese speaker who also writes a lot of LaTeX, I often find myself switching between Chinese and ASCII several times without ever leaving Insert mode. Automatically switching to ASCII on Escape helps, but it only solves part of the problem.

So I built a plugin that takes both Vim modes and Tree-sitter syntax into account when switching input methods.

What it does:

  • Switches between ASCII and your input method as you move between code, comments, strings, and prose, even within Insert mode.
  • Handles LaTeX math environments, including text inside \text{...} and snippet field jumps.
  • Restores your input method for / and ? searches while keeping : commands in ASCII.
  • Supports Linux, macOS, Windows, WSL, Neovide, and even remote Neovim sessions over SSH through Kitty.

There's also a small design detail that I'm particularly happy with.

The plugin doesn't continuously enforce an input method state. Instead, it switches when the editing context changes or when necessary at mode boundaries. This was originally a performance optimization to avoid unnecessary IME queries, but it had a nice side effect: you can manually switch your input method without the plugin fighting you.

For example, you can manually switch to Chinese inside a code region, continue typing and using completion, and the plugin will leave your choice alone until the context changes. Press Escape, and you're back in ASCII.

The demo shows a continuous LaTeX editing session with zero manual input method switches. It's recorded using a real Fcitx5/Rime input method, not simulated text input.

GitHub: https://github.com/dirichy/imselect.nvim

I'd love to hear how other multilingual Neovim users handle input method switching, especially those using Japanese, Korean, or input methods I haven't had a chance to test.

Feedback, bug reports, and suggestions are very welcome!


r/neovim • • 5d ago

Need Help repeating keymaps when resizing buffers

7 Upvotes

So Neovim has built-in keymaps for resizing buffers: CTRL_W +, CTRL_W -, CTRl_W < and CTRL_W >. But when resizing a buffer I often need to use the same keymap multiple times because I didn't get the desired size from the first try.

Is there a way to remap these built-in keymaps so that if I press CTRL_W and then repeatedly press +, -. < or > it will repeatedly resize the buffer?


r/neovim • • 5d ago

Discussion How does neovim handle keymap callbacks and commands?

19 Upvotes

Hello everyone. I have a couple of questions around what neovim does regarding the RHS arguments for keymaps.

Say I have a keymap set in a Lua ftplugin file, with an anonymous callback function defined as bellow:

vim.keymap.set({'n', 'v'}, '<leader>x', function() print("Hello There!") end, { buf = 0 })

As this is defined in a ftplugin file, a buffer local keymap to the anonymous callback should be created every time a Lua buffer is opened.

What I'm wondering is, is neovim or Lua smart enough to recognise that the callback is the same for every Lua buffer, and share the function between all of them? Or is neovim going to create a separate function for each buffer?

In a similar vein, if I have a keymap like vim.keymap.set({'n', 'v'},'j', 'gj'), will neovim parse the rhs string every time the keymap is triggered? Or does it store a function or something after the first parse?


r/neovim • • 6d ago

Plugin dbout.nvim – A database client for Neovim and query with JSON results

35 Upvotes

Hey everyone!

I'd like to share a Neovim plugin I've been working on.

dbout.nvim is a Neovim plugin that helps you connect to databases, execute SQL queries, and display the results in JSON format.

Key Features

  • JSON Result Display: View query results in a structured JSON format for easy reading and native highlighting.
  • No More Connection Strings In Your Neovim Config: All your database connections are securely saved locally on your machine.
  • Buffer-Isolated Connections: Every database query buffer maintains its own isolated connection state.
  • SQL Autocompletion Support: Provide completion sources for completion plugins, enabling automatic suggestions for database tables and columns while writing queries.

Supported Databases

  • SQLite
  • PostgreSQL
  • MySQL
  • MSSQL
  • MongoDB

Why I Built This

I know there are already quite a few database client plugins for Neovim, so you might wonder why I decided to build another one.

The main reason comes from my own experience.

Most existing database clients display query results in traditional text tables. I personally find it frustrating when dealing with tables that have many columns. Having to scroll horizontally back and forth just to inspect the results makes the whole experience quite uncomfortable.

Instead of rendering query results as text tables, dbout.nvim displays all query results in JSON format.

I find JSON much easier to navigate and inspect, especially when working with wide tables.

It's a design choice based on my own workflow, and hopefully some of you will find it useful too.

and here is my repo: https://github.com/zongben/dbout.nvim


r/neovim • • 6d ago

Need Help Lazy configuration setup

11 Upvotes

Hi, coming from VSCode, I wanted to give Neovim a try as IDE for my work machine (Kubuntu). For the most part I am managing fine following this tutorial for the setup: https://www.youtube.com/watch?v=zHTeCSVAFNY&list=PLsz00TDipIffreIaUNk64KxTIkQaGguqn and changing/adapting configs that have changed in the meantime by google-ing my way through everything.
However there is one major thing I am unsure of:

Lazy suggests a structured setup, where every plugin is in a separate file. So my config structure looks like this atm:

└─$ tree
.
├── init.lua
├── lazy-lock.json
└── lua
   ├── config
   │   └── lazy.lua
   └── plugins
       ├── colorscheme.lua
       ├── telescope.lua
       └── treesitter.lua

4 directories, 6 files

The question is: Where to put plugin-configs? for example for telescope...is it best practice to put them into lazy.lua:

vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})

or into telescop.lua:

    keys = {
      { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
      { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
      { "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Find buffers" },
      { "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" },
    },  

For me it would be generally feel cleaner to have settings for each plugin with it's separate file, but I am unsure.


r/neovim • • 6d ago

Discussion Thoughts on using a vibe coded configuration?

0 Upvotes

Been using neovim for about 6 months now. I started off with LazyVim and tweaked it to my needs, then vibe coded a very barebones configuration from the ground up which I have been using for 4-5 months. So the new configuration is basically LazyVim with everything I didn't need stripped out. When I work, I usually have a codex terminal open and if I notice anything I don't like about my configuration, I just say the word and codex will fix it.

Recently, however, I've felt that my configuration feels incredibly unpolished, even though I'm very comfortable doing my day to day work in it. I was trying to emulate the feel of default vi, but the amount of features I use and random stuff I needed to add (for example, auto pairing for /* */ comments in c++)

Where would you recommend I go from here? Codex is certainly better at writing lua than I'll ever be, and much faster too. So any tweaks I make to a config will still be written by AI, probably. I was wondering, should I go back to LazyVim and configure it from there, or continue with my ground-up configuration? Thanks!


r/neovim • • 7d ago

Need Help HELP: Just to be sure about modelines

5 Upvotes

Hey everyone,
Does we agree that modelines are specific vim rules/options set inside a file ?
But how does compiler doesn't trigger error on a c file with modelines ?
I'm new to neovim, I want to understand what modelines does.