Neovim

19 readers
1 users here now

Neovim is an hyperextensible Vim-based text editor. Learn more at neovim.io.

founded 2 years ago
MODERATORS
26
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/neoneo451 on 2025-06-13 09:30:18+00:00.


In the spirit of:

What other good practices are there? No need to be the "best", just what you prefer and works for you.

I will start with a refactor I was doing on obsisdian.nvim yesterday, where I split the huge util.lua file into three modules:

  • util.lua has all the "pure" functions
  • api.lua has all the impure functions that interacts with the editor state
  • builtin.lua has all the functions that are the default behavior but also are user-definable

So I think once you have a plugin that has significant size, it is neccessary to not throw every simple helper into a util file, and don't care about their organization.

Neovim itself is also having a problem of a huge lsp.util file The culling of vim.lsp.util.

Also, if a helper is only used once, you might as well inline it, so that logic is more apprent at the call site.

This is also good for testing as well, also mini.test rules :)

Just a small thing I want to share, what more do you have?

27
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/TibFromParis on 2025-06-12 17:52:17+00:00.


Hey folks! ๐Ÿ‘‹

I've been working on package-ui.nvim, a floating window interface that makes managing dependencies like NPM, Cargo a breeze directly from Neovim.

๐ŸŽฏ What This Solves:

Every language has its own package manager with different commands and workflows. This plugin provides a single, consistent interface for all of them.

Repo : https://github.com/MonsieurTib/package-ui.nvim

๐Ÿš€ Core Functionality:

The plugin provides a unified interface with five main components:

  • Search - Find packages across registries in real-time
  • Installed - View currently installed packages with update indicators
  • Available - Browse search results and available packages
  • Versions - Explore different versions of selected packages
  • Details - Comprehensive package information including dependencies, licenses, and descriptions

๐Ÿ“ฆ Currently Supported Package Managers:

NPM:

  • Automatically detects package.json files in your project
  • Integrates with npmjs.com registry for package search and details
  • Shows outdated packages with available updates
  • One-click install/uninstall with automatic package.json updates

Cargo:

  • Automatically detects Cargo.toml files in your project
  • Integrates with crates.io registry for comprehensive crate information

๐Ÿ”ฎ Roadmap : More Package Managers Coming

The architecture is specifically designed to easily add new package managers.

Here's what's planned:

  • Python pip
  • Go modules
  • Ruby gems

๐Ÿ“‹ Universal Workflow (Works for All Package Managers):

  1. :PackageUI - Opens the interface, auto-detects your project type
  2. Type to search packages from the appropriate registry
  3. Navigate with j/k, Tab between components
  4. Press Enter to browse available versions
  5. Press 'i' to install your chosen version
  6. Press 'u' on installed packages to uninstall
  7. View real-time dependency info and update notifications

โš™๏ธ Installation (lazy.nvim):

{
  "MonsieurTib/package-ui.nvim",
  config = function()
    require("package-ui").setup()
  end,
}

๐Ÿค Community Input Needed:

Which package manager should I prioritize next? What features would make your multi-language development workflow smoother? The codebase is designed to be community-driven and extensible.

28
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/yutkat on 2025-06-13 00:51:23+00:00.

29
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Lavinraj on 2025-06-12 14:55:17+00:00.

30
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/mplusp on 2025-06-12 12:19:49+00:00.


I made another short video in my "Vim Tips & Tricks" series. Really having fun making these. Hope you like it!

31
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Substantial_Tea_6549 on 2025-06-12 12:12:51+00:00.


https://www.youtube.com/watch?v=UjWrhW19PtQ

32
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Moshem1 on 2025-06-12 12:24:58+00:00.


i know there are some lua alternative but go figure writing the complex vim regex going on in the config to achieve that.

https://i.redd.it/3ffqzdfmph6f1.gif

Plugin:

https://github.com/AndrewRadev/switch.vim

My config (with lazy.nvim):

https://github.com/mosheavni/dotfiles/blob/cbd0bb67779db07ec385a2854329631163028a8b/nvim/.config/nvim/lua/plugins/init.lua#L43-L112

33
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/iamkarasik on 2025-06-12 02:40:30+00:00.


Hi all,

I'm excited to share a new plugin I've been working on: sonarqube.nvim โ€” a Neovim integration for SonarQubeโ€™s language server (SonarLint).

๐Ÿ“ฆ GitHub: iamkarasik/sonarqube.nvim

sonarqube/sonarlint diagnostic warnings

๐Ÿ”ง Features:

  • View SonarQube issues directly in Neovim
  • LSP code-actions to apply fixes when available
  • Easy to set up

Iโ€™d love to hear your thoughts - and contributions are definitely welcome!

Thanks for checking it out โœŒ๏ธ

34
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/lostAnarchist1984 on 2025-06-11 10:44:19+00:00.


I used to use indent-blankline for some time but I found out that the listchars options was good enough for me (the string for tab and leadmultispace is U+258F followed by a space).

vim.opt.listchars = {
  tab = "โ– ",
  extends = "ยป",
  precedes = "ยซ",
  leadmultispace = "โ– "
}

The downside of using listchars is that empty lines will break the indent guide. Again, this is not a huge deal for me.

However, I didn't like that in programming languages where the indent size != 2, this would display the wrong number of indent guides, which looks really bad. Today I decided to try and fix it and I came up with this:

-- Set listchars
vim.api.nvim_create_autocmd("BufWinEnter", {
  callback = function()
    sw = vim.fn.shiftwidth()
    vim.opt.listchars = vim.tbl_deep_extend(
      "force",
      vim.opt_local.listchars:get(),
      {
        tab = 'โ–' .. (' '):rep(sw - 1),
        leadmultispace = 'โ–' .. (' '):rep(sw - 1)
      }
    )
  end
})

You may have to change the event BufWinEnter depending on when your shiftwidth gets set in your config. For me this happens with my .editorconfig file, so quite late. I'm quite satisfied with this. Let me know if you find this useful or can think of a way to improve the code.

35
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/waizui on 2025-06-11 13:56:53+00:00.

36
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/siduck13 on 2025-06-11 08:23:07+00:00.

37
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Kurren123 on 2025-06-10 17:33:59+00:00.


Hi all

Just wanted to share some exciting updates for mssql.nvim, my first plugin! It lets you write and execute SQL Server queries in Neovim. These updates include:

  • Save query results to Json, Excel, Csv or XML files
  • User commands added for everything using MSSQL <command>. Autocomplete only shows what is possible to execute at the time, eg MSSQL Connect won't show if you're already connected
  • Backup and restore from .bak files - select the .bak file and an SQL query will be generated to backup to/restore from it
  • Basic auto formatting
  • Simplified set up for people that want keymaps created for them
  • Better support for other status lines, eg Heirline used in AstroVim
  • Show LSP hover info on columns/variables/other objects using Ctrl+K
  • "Execute on default" - executing a query when not connected will look for a connection called "default", open it and execute, saving you a few keystrokes
  • Bugfixes

If you use SQL server, please do give it a try!

38
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Hashi856 on 2025-06-09 23:08:51+00:00.


I can touch type. I'm not the fastest in the west, but my average is around 70wmp. But I've always stuggled with the number keys. Most of them are just too far away from where my fingers rest. I can hit a few pretty easily, but 5, 6, and 7 are particularly hard. I've thrown months of practice at it, and I just can't him them consistantly. I either press the wrong key or I press more than one at the same time.

Anyway, relative number jumbing has always been a struggle for me, to the extent that I dont' really do it. Has anyone else had this issue? How did you get around it?

39
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/siduck13 on 2025-06-10 09:20:17+00:00.

40
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/joetifa2003 on 2025-06-10 04:37:56+00:00.

41
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Heide9095 on 2025-06-09 14:47:51+00:00.


Hi, I've never before used anything similar to the vim-motions or relied to shortcut heavy usage, and I am still learning. But a recent anectode inspired me to share my experience and thoughts as a newcomer bout the process of switching to-, learning about- and dealing with the post-nvim-syndrome.

Why I picked up nvim

I picked up nvim for self-study C programming purposes, in which I am still a beginner. I liked the look of a simplistic interface and I saw some good comments about how with time the workflow ultimately becomes intuitive and efficient even though the learning curve can be difficult for some. Since I had no significant experiences that would be in the way, and I was not under any pressure - I thought: "why not".

Getting started and my first impressions

To be frank, I was completely lost. The interface was foreign, the terminology was alien, and there was a complete overflow of information that in retrospect was excessive and unrelated for a beginner wanting to learn how to setup and use nvim.

I often questioned if I really need all those plugins and customization to simply learn how to use the editor. It was a massive headache, really, and I did not get the positivity behind nvim as I could not even get started with something basic without being recommended an excessive list of plugins and processes that are beyond me.

I was not able to use the editor for coding as I was just confused in that regard for the first few days. But on the positive side I quickly found my way to :Tutor and :help, so I did start to get familiar with vim-motions early on.

Learning and using nvim

This section is a small advice for other newcomers aswell***.***

Finally after days of banging my head against a wall - I grew a skull thick enough to make a break-through. I asked simple questions and searched for simple short answers, and I researched every bit of terminology that I do not understand. And I finally felt some progress in learning about how to use vim.

Mainly two realizations helped alot:

  1. You can do almost anything in 'vanilla' nvim text-editing wise. If you got an idea for how you would like to edit your text en masse, or one specific part - there exists most likely a vim-motion combo for that. However if it does not exist nativly you can add that relativly easily yourself - and you should optimise as you go.
  2. You don't have to exit vim. Use the terminal to navigate your machine. Put your mouse aside - and use your keyboard. Setup and do everything you can through keybindings, hotkeys, shortcuts etc. to navigate in your machine. The workflow becomes so intuitive and seemless that time flies.

In genera,l my rule of thumb was and still is to learn to use vim's native features and gradually implement them one at a time in my workflow. If I have a necessity I check if wim supports it nativly, or if I can add it myself without hassle.

Post-nvim-syndrome

Two weeks of daily use is not a lot - but it is enaugh.

Recently I was doing some writing on a foreign laptop on another app - a list of materials and price calculations. A few minutes into the process I grew frustrated, I noticed it and laughed to myself. I was subconsciously trying to navigate the app using vim-motions, needless to say it id not work, and everytime the app did not respond and I had to use 'other less optimal methods' I was thinking: "yeah...I get it now. nvim is cool."

Conclusion

In short, a hassle to get started expecially if you have 0 idea about what you are doing. You don't just learn vim, you have to learn things around vim aswell, but once you get beyond the starting point - it grows on you.

42
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/JonkeroTV on 2025-06-09 16:05:52+00:00.


A tutorial for those looking to make their own color schemes. I hope to see many new ones!

43
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Hashi856 on 2025-06-08 23:57:04+00:00.


Edit: well I feel kind of dumb. I didnโ€™t realize this was a vim-neovim difference

I believe the default for neovim is to have a fat cursor in non-insert modes and a skinny one for insert. I see some people that keep the fat cursor all the time. I'm not sure if this is soley a personal preference thing (maybe that's what their first editor used and they're just used to it) or if there are good reasons and trade-offs for chosing one over the other.

What do you use and why?

44
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/daliusd_ on 2025-06-08 19:32:27+00:00.


nvim-treesitter main branch dropped incremental selection feature so I have created plugin for that. It is not direct clone of that feature - only the way I use it.

45
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/Exciting_Majesty2005 on 2025-06-09 05:49:29+00:00.

46
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/DrConverse on 2025-06-08 15:34:30+00:00.

47
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/oborvasha on 2025-06-07 20:05:57+00:00.


I am a big fan of github-style unified diffs, and was surprised that there are no plugins in neovim to view diffs like that.

https://preview.redd.it/dac7ltbgak5f1.png?width=3680&format=png&auto=webp&s=94cd33545fbc86bc6e999f8a72ef2d8fa5b203e4

The plugin is very simple and does not have a lot of features. Basically, when you run :Unified or :Unified <commit_ref>, it opens a file tree showing only your changed files. Navigating the tree automatically opens the corresponding file in a buffer and decorates it with highlights, signs, and virtual text to show the difference against the ref. Some inspiration was taken from very popular diffview.

๐Ÿ”— Link

https://github.com/axkirillov/unified.nvim

48
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/JonkeroTV on 2025-06-07 16:22:06+00:00.


This is a guided walk through for those interested in creating there own plugin.

49
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/biserstoilov on 2025-06-07 07:24:09+00:00.


Hey r/neovim! ๐Ÿ‘‹

I've been working on a plugin called LVIM Space that brings advanced project and workspace management to Neovim. After months of development, I'm excited to share it with the community!

๐Ÿš€ What is LVIM Space?

LVIM Space is a comprehensive workspace management plugin that organizes your development workflow into Projects โ†’ Workspaces โ†’ Tabs โ†’ Files with full session persistence and a beautiful visual UI.

โœจ Key Features

  • ๐Ÿ—๏ธ Projects: Manage multiple projects independently
  • ๐ŸŒ Workspaces: Each project can have multiple contexts/workspaces
  • ๐Ÿ“‘ Tabs: Each workspace supports multiple tabs with their own layouts
  • ๐Ÿ“ Files: Tabs remember files, window layouts, and cursor positions
  • ๐Ÿ’พ Session Persistence: Auto/manual save and restore everything
  • ๐ŸŽจ Visual UI: Beautiful floating panels with NerdFont icons
  • ๐Ÿ”Œ API Integration: Public API for status line integration
  • โš™๏ธ Highly Configurable: Customize everything to your needs

๐ŸŽฌ Demo

https://github.com/user-attachments/assets/6c20d82b-abb5-445a-a630-2aca3adb76ae

๐Ÿ”ง Quick Setup

-- Install with your favorite plugin manager
require("lvim-space").setup({
    autosave = true,
    ui = {
        icons = {
            project = " ",
            workspace = " ", 
            tab = " ",
            file = " ",
        }
    },
    keymappings = {
        main = "<C-Space>",
        global = {
            projects = "p",
            workspaces = "w", 
            tabs = "t",
            files = "f",
        }
    }
})

Press <C-Space> to open the main panel and start organizing!

๐Ÿ”— Integration Example

Works great with status line plugins like tabby.nvim:

local pub = require("lvim-space.pub")
local tabs = pub.get_tab_info()
-- Returns: { {id=1, name="main", active=true}, {id=2, name="feature", active=false} }

๐ŸŽฏ Why I Built This

I used vim-ctrlspace for a long time but encountered several issues that led me to create this plugin. LVIM Space offers a unified approach with significant improvements:

  • SQLite Database: All data stored in a fast SQLite database instead of files
  • Reliability: No risk of corrupted session files or lost configurations
  • Performance: Fast loading and saving of state
  • Hierarchical Organization (Project โ†’ Workspace โ†’ Tab โ†’ File)
  • Visual Management instead of just commands
  • Seamless Integration with existing workflows

๐Ÿ“ฆ Installation

Lazy.nvim:

{
    "lvim-tech/lvim-space",
    dependencies = {
        "kkharji/sqlite.lua",
    },
    config = function()
        require("lvim-space").setup({})
    end
}

Packer:

use {
    "lvim-tech/lvim-space",
    requires = {
        "kkharji/sqlite.lua",
    },
    config = function()
        require("lvim-space").setup({})
    end
}

๐Ÿ”— Links

๐Ÿค Feedback Welcome!

I'd love to hear your thoughts! Whether it's:

  • Feature requests
  • Bug reports
  • Integration ideas
  • General feedback

Feel free to try it out and let me know what you think. I'm actively developing and responding to issues.

Thanks for checking it out! ๐Ÿ™


Built with โค๏ธ for the Neovim community

50
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/santhosh-tekuri on 2025-06-06 14:29:14+00:00.


vim.api.nvim_create_autocmd('FocusLost', {
    desc = "Copy to clipboard on FocusLost",
    callback = function()
        vim.fn.setreg("+", vim.fn.getreg("0"))
    end,
})

if you are using tmux you should enable focus-events:

set -g focus-events on

earlier I used to use <leader>y to copy to clipboard. but the above trick seems cleaner

view more: โ€น prev next โ€บ