r/neovim • • 1d ago

Dotfile Review Monthly Dotfile Review Thread

18 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

4 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 • • 12h ago

Color Scheme Sanzo - where color follows what the code is, not decoration

Thumbnail
gallery
47 Upvotes

A colorscheme built around hierarchy. Each kind of code gets its own color group, split between what comes from the language and its standard library and what's defined in your code.

The palette is just my taste, and it's exposed so you can swap in the colors from your favorite color scheme. The hierarchy stays intact.

Repo: https://codeberg.org/navahas/sanzo.nvim
The reasoning behind it: https://culturecode.dev/posts/what-most-colorschemes-miss


r/neovim • • 1d ago

Plugin triforce.nvim - The plugin is now available once again

30 Upvotes

Hi there, DrKJeff16 here. I'm the co-maintainer of u/ghegi's gisketch/triforce.nvim.

Recently, u/ghegi informed me that his GitHub account has been wrongfully suspended, but an appeal has already been made. In the mean time, he has given me explicit permission to mirror the repository on my own account while the appeal is reviewed. As soon as he gets his account back this mirror will be archived/deleted.

You can find the mirrored repository link at https://github.com/DrKJeff16/triforce.nvim

Sorry for the inconvenience, this was sudden and unexpected.

- Sincerely, DrKJeff16


r/neovim • • 1d ago

Discussion Is Garbage Day actually useful?

9 Upvotes

I installed garbage-day.nvim 3/4 years ago when i first started using nvim. I saw it in someone else's config and thought to myself 'that sounds nice, it frees up memory automatically'. I've never really questioned it since it runs quietly in the background and i assumed i was getting some gain form it.

Recently i've been going back through my config and i'm beginning to question if its worth keeping. My main gripe with it is its interaction with RustAnalzyer sourced via rustacean.nvim. After 15 minutes garbage day will stop rusts LSP, but fails to restart when i refocus nvim, i wonder if theres some missing interaction between these two plugins.

For my use case (usually have one tmux / nvim instance open at one time), do you think i'm gaining any additional cpu / memory / battery life gains ?


r/neovim • • 12h ago

Discussion Cash cow plug-ins 🤑

0 Upvotes

Recently, I started getting emails from business developers who are proposing to place my 10 github star plug-ins in front of .. I guess .. you guys, to make me tons of 🫰 I hope you're ready to start paying up. It seems like neovim users have finally been put in the same category as Apple users who can be charged a premium 😆

BTW, are there any paid plug-ins around in the neovim ecosystem? There was a closed source and paid vim fuzzy finder plug-in back in the day. I don't remember its name nor have I used it but I did consider paying for it back then.

On a more serious note: Are you financially supporting the plug-in ecosystem? If so, I'd like to know more. Not even sure whether there are any needs.


r/neovim • • 1d ago

Need Help Lazy PackageManager found existing packages warning issue.

Enable HLS to view with audio, or disable this notification

13 Upvotes

- ⚠️ WARNING found existing packages at `/home/redeye/.local/share/nvim/site/pack/core`

Hi, i am stuck with new issue.

I am trying to configure the Neovim from scratch, before that i use LazyVim but it is using lot of not required plugins for me btw.

The reasone for i am trying to config the neovim from scratch, to remove not required plugin, optimize the neovim more, understand more about neovim and my setup.

When i user lazyvim there has a tons and tons of pre-build plugins and keybinds and it was hard to understand and work withit.

Now the issue is.

When i load the lazy plugin manager, the site folder was creating automatically, after that when i checkhealth lazy, it is showing found existing packages at warning.

I have no idea what is warning was trying to say, anyone know how to solve this warning message?


r/neovim • • 1d ago

Need Help┃Solved How do you achieve a seamless "VS Code Remote - SSH" experience in Neovim? (Tuning remote-nvim.nvim or better alternatives?)

39 Upvotes

Hey r/neovim,

Coming from VS Code, one feature I genuinely miss and rely on heavily is the Remote - SSH extension—where you connect to a remote server and the editor handles file browsing, remote LSP, and terminal execution as if you were working locally.

I’m trying to replicate this workflow in my Neovim setup. I installed remote-nvim.nvim, but my experience hasn't felt as smooth or reliable as I hoped (connection hiccups, latency, and quirks with remote LSP/config synchronization).

Here is my current configuration file:  My remote-nvim.lua configuration on GitHub

luareturn {
  "amitds1997/remote-nvim.nvim",
  version = "*",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    "nvim-telescope/telescope.nvim",
  },

config
 = function()
    local ssh_config = vim.fn.
expand
("~/.ssh/config")
    local config_paths = {}
    if vim.fn.
filereadable
(ssh_config) == 1 then

table.insert
(config_paths, ssh_config)
    end

require
("remote-nvim").
setup
({
      ssh_config = {
        ssh_config_file_paths = config_paths,
      },
    })
  end,
}

A few questions for those who do daily remote development with Neovim:

  1. Tuning remote-nvim.nvim: Are there specific settings, SSH configurations, or plugins you use alongside it to make it rock solid and fast?
  2. Alternative workflows: Do you prefer remote-nvim.nvim, or is a different workflow better in practice?
  3. LSP & Mason on Remote: How do you handle language servers (e.g., clangd, pyright, rust-analyzer) on servers where you might not have root/sudo privileges?

A few questions:

  1. Optimizing remote-nvim.nvim: Are there specific options in remote-nvim or OpenSSH settings (like ControlMaster / multiplexing) that make it significantly faster and prevent disconnections?
  2. Best non-tmux remote setups: If you don't use tmux, what is your daily driver for remote SSH development? (e.g. remote-nvim.nvim, SSHFS / sshfs.nvim, distant.nvim, or native Neovim remote UI)?
  3. LSP & Mason on the remote machine: How do you keep language servers (clangd, pyright, rust-analyzer) running smoothly on the server without slowing down your local Neovim client?

Would appreciate any advice, configs, or workflow recommendations! Thanks in advance!


r/neovim • • 1d ago

Plugin brygga.nvim - plugin that enables /ide in Claude Code

15 Upvotes

Hi everyone,

I have spent a lot of time in Claude Code recently, almost as much time (maybe even more?) as in Neovim.

I have tried many Claude Code plugins but none of them did exactly what I wanted so I created brygga.nvim.

The plugin enables the /ide functionality in Claude Code CLI that lets Claude see what text is selected (v-block), diagnostics symbols etc. in Neovim.

Since I eager load all my plugins with vim.pack the plugin loads its “internals” lazily and only adds about 0.5ms to the startup time of nvim on my computer.

I’ll leave a link here in case some of you also are looking for a /ide only plugin for Neovim

https://github.com/ThorstenRhau/brygga.nvim


r/neovim • • 2d ago

Plugin Five year anniversary of ‘mini.nvim’

Thumbnail
nvim-mini.org
489 Upvotes

r/neovim • • 1d ago

Need Help Resolving non-Latin keymap issues natively, without plugins

4 Upvotes

I'm so tired of plugins like https://github.com/Wansmer/langmapper.nvim breaking constanly on every update. I'm now on v0.13 and the plugin is broken.

This is langmappers TLDR:

  • Translating all globally registered mappings;
  • Translating local registered mappings for each buffer;
  • Registering translated mappings for all built-in CTRL+ sequences;
  • Provides utils for manual registration original and translated mapping with single function;
  • Hacks built-in keymap's methods to translate all registered mappings (including mappings from lazy-loaded plugins);
  • Real-time normal mode command processing variability depending on the input method.

Basically I want to achieve those things natively, inside my config. Is nvim with v0.13 at the point where it's not a pain in the ass to achieve or is it still massively neglected?


r/neovim • • 1d ago

Plugin REPLConnect.nvim

4 Upvotes

TLWR: I have a Neovim plugin and small Julia package that connects a Julia or R REPL to a Neovim session, allowing for a variable explorer pane and viewer, as well as a plot pane that works over SSH, and object autocompletion based on objects that are loaded in the REPL.

Small announcement of a Neovim plugin and associated Julia and R packages I've been playing around with for the last couple of weeks to help aid my development of data-heavy analysis. There are a couple of things that I've missed about IDE-based development since switching to Neovim about 3 years, and most have been resolved with improvements to the language server(s) and testing environment. However, the main pain point that stuck around (apart from debugging) was the RStudio/Positron-style variable viewer and plotting pane. When Posit announced Ark kernel and lsp a few years ago I was interested to see if it would ever be extended to work in Neovim, and about a year or so of work Jacob released jet.nvim that provides an interface to do this through language-specific extension (e.g., jet.ark). I got to playing around with an implementation for the IJulia kernel, that you can see at jet.julia. It works and provides some useful features like the object autocompletion and variable pane/viewer. But I much prefer working in the actual Julia REPL over the IJulia kernel, so I wondered if we could achieve a similar outcome using Unix sockets to pass information to and from the REPL.

REPLConnect.nvim, REPLConnect.jl, and REPLConnect.R are the outcome of this experimentation (with a lot of the JSON-RPC approach based on the work by positron-julia, as well as some heavy inspiration from jet.nvim).

The general idea is that the Neovim plugin handles all the core functionality, and each language has it's own Neovim plugin to hooks into the core one, and a language-specific package to handle stuff from the REPL's end of things. I have added a small function call to my startup.jl file (and my ~/.Rprofile) that activates it for each interactive REPL session and does things like track REPL entry history (only the last 10 by default) so you can detach and reconnect to a different running REPL in the situation where you have a couple running in parallel, or "capture" plots so they are sent to the internal plot viewer that opens in Neovim and can work over SSH (this hooks into snacks.nvim and assumes you have a terminal that uses the Kitty image protocol).

# in my startup.jl

if isinteractive()
    # you likely want to disable VimBindings for a nvim
    # terminal if you use VimBindings
    if !haskey(ENV, "NVIM")
        using VimBindings
    end

    using REPLConnect: REPLConnect
    REPLConnect.start()
    REPLConnect.capture_plots!(true)
    REPLConnect.record_history!(true)

end

If you prefer to use REPLs created outside of Neovim and send code using something like vim-slime, that's no problem, but you can also create Neovim splits and terminals and connect to those if you prefer. The choice is yours. The thing about this plugin that I'm (probably unreasonably) pleased with is that it's possible to define default layouts in your neovim config so the various panes that open/close as you need them do so in a pre-specified way, and you can set them differently for external REPLs vs vertical nvim terminals vs horizontal nvim terminals. And, there's even a function to "capture" the current layout allowing you to manually adjust the sizing to your preferences and then bake it into your Neovim config!

return {
  {
    'arnold-c/REPLConnect.jl',
    dependencies = { 'arnold-c/REPLConnect.nvim' },
    main = 'replconnect.julia',
    opts = { command = { 'julia', '--project=.' } },
  },
  {
    'arnold-c/REPLConnect.R',
    dependencies = { 'arnold-c/REPLConnect.nvim' },
    main = 'replconnect.r',
    opts = { command = { 'arf' } },
  },
  {
    'arnold-c/REPLConnect.nvim',
    main = 'replconnect',
    ft = { 'r', 'julia' },

    -- The :REPL* commands are filetype specific, so no per-language routing is needed.
    -- NOTE: only :REPLStart is confirmed; verify the other command names.
    keys = {
      { '<leader>ra', '<cmd>REPLAttach<cr>', desc = 'REPL: attach to external REPL' },
      { '<leader>rd', '<cmd>REPLDetach<cr>', desc = 'REPL: detach from REPL' },
      { '<leader>rs', '<cmd>REPLStart<cr>', desc = 'REPL: start REPL with default split' },
      { '<leader>rS', '<cmd>REPLStop<cr>', desc = 'REPL: stop REPL(s) within the project directory' },
      { '<leader>rl', '<cmd>REPLLayout<cr>', desc = 'REPL: save current layout to clipboard' },
      { '<leader>rp', '<cmd>REPLPlots<cr>', desc = 'REPL: toggle plots pane' },
      { '<leader>rv', '<cmd>REPLVariables<cr>', desc = 'REPL: toggle variables pane' },
    },

    opts = {
      -- Ignore objects that may be automatically loaded into your environment
      -- by your startup files that you don't want polluting your variable pane
      exclude = {
        'default_dir',
        'default_templates',
        'default_user',
        'home_dir',
        'in_global_env',
        'installed_deps',
        'inplace_template',
        'internal_template_dir',
        'optional_dependencies',
        'personal_templates',
        'required_dependencies',
        'specified_activate_project',
      },
      completion = true, -- runtime completion LSP in buffers of attached REPLs' languages
      poll_interval_ms = 1500, -- refresh the visible variables pane; 0 = off
      update_while_busy = false, -- fetch changes while the REPL evaluates
      repl = { -- :REPLStart; these apply to every language
        split = 'vertical', -- or "horizontal"
        enter = true, -- start in terminal mode
        capture_plots = true,
        plot_limit = 50,
      },
      layout = {
        -- One layout string per way the REPL is shown.
        horizontal = [[
            editor / repl @ 36% | ((plots \ view) @ 60% / vars) @ 35%
        ]],
        vertical = [[
            repl @ 22% | editor | ((plots \ view) @ 62% / vars) @ 35%
        ]],
        external = [[
            editor | ((plots \ view) @ 56% / vars) @ 40%
        ]],
      },
      plots = {
        renderer = 'auto', -- "snacks" | "image.nvim" | "external" | custom table
        -- stream images via Snacks: "auto"
        -- (over SSH, if snacks is loaded) | true | false
        remote = 'auto',
        auto_open = true,
        keymaps = {
          close = 'q',
          next = '<C-n>',
          previous = '<C-p>',
          refresh = 'r',
          follow = 'f',
          external = 'o',
          save = 's',
        },
      },
      viewer = {
        keymaps = {
          close = 'q',
          refresh = 'r',
          next_page = ']p',
          previous_page = '[p',
          scroll_right = '<Tab>',
          scroll_left = '<S-Tab>',
          next_slice = { '<C-n>', ']s' },
          previous_slice = { '<C-p>', '[s' },
          select_slice = '<LeftMouse>',
        },
      },
    },
    config = function(_, opts)
      require('replconnect').setup(opts)

      -- On the first Julia/R file of a session, offer to attach to
      -- running REPLs of that language. A lone session in the cwd is
      -- attached automatically;
      -- anything else (several, or none in the cwd) brings up the picker.
      local discover = require 'replconnect.discover'
      -- filetype -> REPLConnect language
      local languages = { julia = 'julia', r = 'r' }
      local prompted = {}

      local function connect(filetype)
        local language = languages[filetype]
        if not language or prompted[filetype] then
          return
        end
        prompted[filetype] = true

        local cwd = vim.fn.getcwd()
        local sessions = vim.tbl_filter(function(info)
          return discover.language(info) == language
        end, discover.list { cwd = cwd })
        if #sessions == 0 then
          return
        end

        local here = vim.tbl_filter(function(info)
          return info.cwd == cwd
        end, sessions)
        vim.cmd('REPLAttach' .. (#here == 1 and (' ' .. here[1].pid) or ''))
      end

      vim.api.nvim_create_autocmd('FileType', {
        group = vim.api.nvim_create_augroup('replconnect.connect-first-file', { clear = true }),
        pattern = vim.tbl_keys(languages),
        callback = function(args)
          vim.schedule(function()
            connect(vim.bo[args.buf].filetype)
          end)
        end,
      })

      -- Lazy-loaded on a filetype: the triggering buffer's FileType already fired.
      connect(vim.bo.filetype)
    end,
  },
}

One other neat feature is the variable viewer (that can be accessed by pressing v on a variable in the general variable pane) not only works for dataframes and other Tables.jl objects, but also for 3D arrays and for function methods. This last one allows you to quickly view all the method definitions for a function, which is pretty handy with generics in R and multiple dispatch in Julia, and also comes with a go-to-definition gd keymap that brings you to the file location where the function is defined (using a snacks picker to choose the correct method). It is set up to use the language server, but right now seems to always trigger the fallback method that searches the projects' files manually. Either way, it seems to be working out OK in my day-to-day usage, but I'm working to figure out whether the issue is on my end (likely) or in how capabilities are advertised by the fatou lsp (unlikely).

It's definitely an early-beta type set of packages and will probably experience some (maybe breaking) changes over the coming months, but I've been daily driving it with Julia and R (via the arf REPL) for the last 1.5-2 weeks and it's been pretty reliable. I'd still probably default to jet.nvim or pyrola.nvim if I were needing something to "just work" as they are certainly more stable.

And final obligatory disclosure: yes, I did use AI to help write the bulk of this and iterate on a number of different architectures. I think the code is pretty reasonable as I've been going through and reviewing it along each step of the process, but you may prefer not to use it because of AI - that's fine! I just wanted to share in case others find it useful.


r/neovim • • 2d ago

Need Help┃Solved Neovim keep freezing in dotnet projects.

Enable HLS to view with audio, or disable this notification

12 Upvotes

```cs

"seblyng/roslyn.nvim",
enabled = true,
opts = {
  filewatching = "off",
  settings = {
    ["csharp|inlay_hints"] = {
      csharp_enable_inlay_hints_for_implicit_object_creation = true,
      csharp_enable_inlay_hints_for_implicit_variable_types = true,
      csharp_enable_inlay_hints_for_lambda_parameter_types = true,
      csharp_enable_inlay_hints_for_types = true,
      dotnet_enable_inlay_hints_for_indexer_parameters = true,
      dotnet_enable_inlay_hints_for_literal_parameters = true,
      dotnet_enable_inlay_hints_for_object_creation_parameters = true,
      dotnet_enable_inlay_hints_for_other_parameters = true,
      dotnet_enable_inlay_hints_for_parameters = true,
      dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix = true,
      dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name = true,
      dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent = true,
    },
    ["csharp|code_lens"] = {
      dotnet_enable_references_code_lens = true,
    },
    ["csharp|background_analysis"] = {
      dotnet_analyzer_diagnostics_scope = "openFiles",
      dotnet_compiler_diagnostics_scope = "openFiles",
    },
    ["csharp|completion"] = {
      dotnet_provide_regex_completions = true,
      dotnet_show_completion_items_from_unimported_namespaces = true,
      dotnet_show_name_completion_suggestions = true,
    },
    ["csharp|symbol_search"] = {
      dotnet_search_reference_assemblies = true,
    },
    ["csharp|formatting"] = {
      dotnet_organize_imports_on_format = true,
    }
  },
},

```

system_details: - OS: Arch_Linux - CPU: AMD Ryzen 5 3600 6C/12T - RAM: 16GB - GPU: Nvdia GT610

nvim_details: NVIM v0.12.6 Build type: RelWithDebInfo LuaJIT 2.1.1788856981

Here is my roslyn LSP configuration code and some more details about system and nvim.

Neovim was keep freezing during when i was editing the c# code.

I am newbe to neovim, i have no idea how to diagnose this freezing issue.

There has any tools to diagnose this issue?

Can i get how to diagnose the freezing issue?

SOLVED

The issue was nvim keep freezing during typing in razor file.

The issue was solved by installing html-lsp.

I fixed by see this ramboe video, thanks for ramboe for this awsm video.

Tanks for everyone try to help.


r/neovim • • 2d ago

Need Help Neovim web docs are broken for searching built-in docs?

19 Upvotes

For example, I'm trying to find docs on `:has()` or `vim.fn.has`, but search just doesn't return the proper result. Try it yourself: https://neovim.io/doc/


r/neovim • • 3d ago

Plugin [PLUGIN] atlas.nvim v0.8.0 - PR reviews and issues inside Neovim

Thumbnail
gallery
239 Upvotes

Hey r/neovim 

I have been working more on atlas.nvim and just released v0.8.0!

Some things added since my last post about v0.4.0:

- Code suggestions, multiline comments and LSP support in reviews
- Repository browsing
- Pipelines and job logs
- UI improvements and quality-of-life changes

It works with GitHub, GitLab and Bitbucket PRs, plus Jira/GitHub/GitLab issues. There have also been quite a few fixes around reviews and comments.

If you try it out, I would love to hear what works and what does not :)

https://github.com/emrearmagan/atlas.nvim


r/neovim • • 3d ago

Discussion Would Rewriting All of Neovim, Including Plugins and Configs Everything in 100% C Make It Faster?

Post image
215 Upvotes

I am just curious 100% C will make Neovim faster including plugin, configuration files everything.


r/neovim • • 2d ago

Plugin yaml.nvim: single-file YAML parser & encoder for your plugins

6 Upvotes

Hi everyone!

Just wanted to share this small, self-contained plugin for parsing YAML files into Lua tables and encoding Lua tables into YAML strings, all in a single file, so you can copy-paste it into your plugins if you ever need to support YAML.

I'm currently using it on some dev branches of other plugins I'm working on, and it works flawlessly, so I'm leaving it here in case it's useful to anybody.

Cheers!

https://github.com/cvigilv/yaml.nvim

AI disclosure: I used AI to convert a prototype parser and writer + the work I forked the repo from, into the final form you will see in the repo. I know we are in uncertain times regarding the ethics and use of this tool; therefore, I wanted to include this small disclosure at the end to be honest about the project's status.


r/neovim • • 2d ago

Need Help┃Solved Program output overwritten by [Program exited 0] message expected?

3 Upvotes

If the program output equals or more lines than the window size. Last line of the output will be overwritten by "[Program exited 0]" message.

For example there's a program output 12 lines of output, it supposed to look like this

1
2
3
4
5
6
7
8
9
10
11
12
[Program exited 0]

However if the windows size is equals or smaller than 12. It will be look like this

1
2
3
4
5
6
7
8
9
10
11
[Program exited 0] <-- 12 should be here

Last line will be truncated by program exit message.

This is the minimum code to reproduce the issue.

#include <stdio.h>

int main(int argc, char *argv[]) {
    int maxlines = 100;
    for (int i=0; i<maxlines; i++) {
        printf("meow\n");
    }
    printf("LAST LINE");
}

https://reddit.com/link/1x4tnte/video/3umskyp9w7vh1/player

I know in practice every program should always output \n at the end. However, if there are additional newline at the end, some of judge systems would not accept.

I'm not exactly sure if this this issue is intentional or unexpected. So I came here to get some feedback whether I should create a GitHub Issue for this.


r/neovim • • 3d ago

Random VimComplete: A Self-hosted Vim-motion Esolang with a Game of Life Implementation

14 Upvotes

I originally intended to simulate Rule 110 using Vim motions (hence the name), but I fell down the rabbit hole. So here we are.

VimComplete is a self-hosted esoteric programming language built around Vim motions. No Ex commands or the = register, which uses VimScript for evaluation. Each source line is executed using a :normal! command in the runtime.

Registers x, y, and z are used to capture the exit code, stdout, and stderr, respectively. Register c passes command-line arguments.

The repository currently includes:

  • A bootstrapped compiler with preprocessing, validation, optimisation, and code generation stages
  • A recursive text-substitution model for multi-module support, similar to C's #include
  • An implementation of Conway's Game of Life
  • A standard library with search and replace, assertions, file diffs, basic arithmetic, and more
  • Unit tests for the compiler and standard library
  • A Cobra-based CLI, step debugger, and Neovim syntax highlighting support

If you’re interested in how the source code works, docs/techniques.md describes some common techniques used for emulating standard programming constructs like subroutines, conditionals, iteration, and asserts.

Do clone the repository instead of browsing the source GitHub because GitHub can’t render raw controls characters, which the source code is filled to the brim with.

Repository link: ksaze/vim-complete

P.S. Surely this will help me land a job. Good going, me.


r/neovim • • 4d ago

Plugin shell-lsp: one static binary for bash/zsh/sh/dash/ksh that does the work of bashls, shellcheck, shfmt and more

34 Upvotes

I am a long time nvim user and terminal based workflow enjoyer, and as such I have been making and deleting shell scripts for a few years at this point.

I use zsh and found it frustrating that the bash language server didn't have support for zsh, beyond their syntax overlap. Much time was spent trying to optimize away process forks and evals, without really having the tooling geared towards it.

Another thing I found annoying was that even if I wrote bash, it wouldn't really lint in a way which allowed you to split your scripts into multiple files and to have proper linting for the usage of symbols in these merged scopes.

I didn't really like that it offloaded work to separate binaries for formatting and linting, despite this being built into the language server protocol spec.

Lastly I didn't like how it was written in Js and the performance overhead that came with it.

So I spent the last couple of days making a full LSP implementation in go for all unixlike shells.

shell-lsp

It was made using AI via a clean room method, where agents created a feature and test suite and fixtures spec by looking at the bash-language-server, shfmt and shellcheck. This specification was extended to map features supported by more fully featured language servers like gopls and rust-analyzer, to provide richer support for refactoring and contextual completions.

A separate set of agents then implemented this spec and test suite.

Feel free to open an issue or send a pr if you decide to try it out. :)


r/neovim • • 5d ago

Random My gf gave me a star as a gift for reaching 1k stars on my neovim plugin

Post image
1.2k Upvotes

Hey vimmers,

Recently, nvim-dap-view reached 1k stars on GitHub! Hooray!

As a gift, I got this lovely star ',:)

Thanks to everyone who starred or contributed in some other way, you guys rock! Special thanks to demorome on GitHub, my first monthly sponsor!

For those who're still coding by hand and don't know it yet, nvim-dap-view is an interface for debugging directly from neovim, based on nvim-dap. It is extensively customizable and even comes with built-in inline variable inspection (via virtual text). It's awesome!

EDIT: hey guys, thanks for the comments! She said you were very kind!


r/neovim • • 4d ago

Need Help┃Solved Treesitter syntax highlighting issue in SCSS files.

5 Upvotes

Treesitter seems to have trouble on lines that are accessing anything from a namespace that isn't a simple variable.

I also find it weird how it doesn't really differentiate between different types of selectors, even though normal CSS files seem to be fine:

I haven't really touched the existing Treesitter config provided by kickstart.nvim at all.

EDIT: I replaced my SCSS parser with https://github.com/simeonoff/tree-sitter-scss, and it works ok now. It still doesn't differentiate between different types of selectors, but it's more usable now.


r/neovim • • 4d ago

Need Help┃Solved Treesitter was set up but no syntax highlighting

8 Upvotes

Hello I have a small problem: I have installed treesitter, its dependencies, parsers and querries, and started it, but there is no difference made to my syntax highlighting. Can someone help me figure out what I am doing wrong?

Bastardized code I use:

--=====OPTIONS=====--

-- Set <space> as the leader key
-- See `:h mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '

-- OPTIONS
--
-- See `:h vim.o`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:h option-list`
-- To see documentation for an option, you can use `:h 'optionname'`, for example `:h 'number'`
-- (Note the single quotes)

vim.o.number = true -- Show line numbers in a column.

-- Show line numbers relative to where the cursor is.
-- Affects the 'number' option above, see `:h number_relativenumber`.
vim.o.relativenumber = false

-- Sync clipboard between OS and Neovim. Schedule the setting after `UIEnter` because it can
-- increase startup-time. Remove this option if you want your OS clipboard to remain independent.
-- See `:h 'clipboard'`
vim.api.nvim_create_autocmd('UIEnter', {
 callback = function()
   vim.o.clipboard = 'unnamedplus'
 end,
})

-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.o.ignorecase = true
vim.o.smartcase = true

vim.o.cursorline = true -- Highlight the line where the cursor is on.
vim.o.scrolloff = 10 -- Keep this many screen lines above/below the cursor.
vim.o.list = true -- Show <tab> and trailing spaces.

-- If performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
-- instead raise a dialog asking if you wish to save the current file(s). See `:h 'confirm'`
vim.o.confirm = true

-- KEYMAPS
--
-- See `:h vim.keymap.set()`, `:h mapping`, `:h keycodes`

-- Use <Esc> to exit terminal mode
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')

-- Map <A-j>, <A-k>, <A-h>, <A-l> to navigate between windows in any modes
vim.keymap.set({ 't', 'i' }, '<A-h>', '<C-\\><C-n><C-w>h')
vim.keymap.set({ 't', 'i' }, '<A-j>', '<C-\\><C-n><C-w>j')
vim.keymap.set({ 't', 'i' }, '<A-k>', '<C-\\><C-n><C-w>k')
vim.keymap.set({ 't', 'i' }, '<A-l>', '<C-\\><C-n><C-w>l')
vim.keymap.set({ 'n' }, '<A-h>', '<C-w>h')
vim.keymap.set({ 'n' }, '<A-j>', '<C-w>j')
vim.keymap.set({ 'n' }, '<A-k>', '<C-w>k')
vim.keymap.set({ 'n' }, '<A-l>', '<C-w>l')

-- AUTOCOMMANDS (EVENT HANDLERS)
--
-- See `:h lua-guide-autocommands`, `:h autocmd`, `:h nvim_create_autocmd()`

-- Highlight when yanking (copying) text.
-- Try it with `yap` in normal mode. See `:h vim.hl.on_yank()`
vim.api.nvim_create_autocmd('TextYankPost', {
 desc = 'Highlight when yanking (copying) text',
 callback = function()
   vim.hl.on_yank()
 end,
})

-- USER COMMANDS: DEFINE CUSTOM COMMANDS
--
-- See `:h nvim_create_user_command()` and `:h user-commands`

-- Create a command `:GitBlameLine` that print the git blame for the current line
vim.api.nvim_create_user_command('GitBlameLine', function()
 local line_number = vim.fn.line('.') -- Get the current line number. See `:h line()`
 local filename = vim.api.nvim_buf_get_name(0)
 print(vim.system({ 'git', 'blame', '-L', line_number .. ',+1', filename }):wait().stdout)
end, { desc = 'Print the git blame for the current line' })

-- PLUGINS
--
-- See `:h :packadd`, `:h vim.pack`
--
-- Add the "nohlsearch" package to automatically disable search highlighting after
-- 'updatetime' and when going to insert mode.
vim.cmd('packadd! nohlsearch')

-- Install third-party plugins via "vim.pack.add()".
vim.pack.add({
 -- Quickstart configs for LSP
 'https://github.com/neovim/nvim-lspconfig',
 -- Fuzzy picker
 'https://github.com/ibhagwan/fzf-lua',
 -- Autocompletion
 'https://github.com/nvim-mini/mini.completion',
 -- Enhanced quickfix/loclist
 'https://github.com/stevearc/quicker.nvim',
 -- Git integration
 'https://github.com/lewis6991/gitsigns.nvim',
 -- Autopairs
 'https://github.com/altermo/ultimate-autopair.nvim.git',
 -- Tree-Sitter
 'https://github.com/nvim-treesitter/nvim-treesitter.git',
})

-- Treesitter stuff
require('nvim-treesitter').install {'cpp', 'lua'}

--Highlight C++ Treesitter
vim.api.nvim_create_autocmd('FileType', {
 pattern = '*',
 callback = function(args)
       local buf = args.buf
       local ft = vim.bo[buf].filetype

       local lang = vim.treesitter.language.get_lang(ft)
       if not lang then
          return
       end

       local ok_add = pcall(vim.treesitter.language.add, lang)
       if not ok_add then
               return
       end

       pcall(vim.treesitter.start, buf, lang)
 end,
})

-- require
require('fzf-lua').setup { fzf_colors = true }
require('mini.completion').setup {}
require('quicker').setup {}
require('gitsigns').setup {}
require('ultimate-autopair').setup {}
require('nvim-treesitter').setup {}

TURNS OUT THE STANDARD COLORSCHEME JUST DIDNT SUPPORT SYNTAX HIGHLIGHTING??


r/neovim • • 5d ago

Color Scheme oxide - a minimalist, monochrome-based colorscheme for neovim (and more)

Thumbnail
gallery
159 Upvotes

Hey, I've been working on oxide for over a year now and wanted to share it here ;)

I kept trying different colorschemes and never quite found one that suited me. I like minimalism and find too many colors distracting. I tried fully monochrome themes too, but realized I still wanted color to help distinguish different parts of the code.

With oxide, I use color for syntax highlighting and useful feedback, like errors and search matches. The rest of the UI stays quiet. The backgrounds, borders, and regular text use neutral grays without colored tints.

I also like having a consistent palette across my tools, so I've made ports for Zed, VS Code, Ghostty, kitty, WezTerm, and Alacritty, as well as tools like Yazi and Lazygit.

You can find the Neovim version here: https://github.com/oxidescheme/nvim

It's still a small project, and I don't actively use every tool I've made a port for, so some ports may have rough edges thus bug reports are welcome, and I'd love to hear what you think, thanks!


r/neovim • • 5d ago

Video Neovim Multi-Line Editing Overview, Multicursor Included

138 Upvotes

Neovim nightly now ships native multicursor, so this was a good opportunity to summarize and showcase every other built-in way to edit many lines in neovim. Multi-editing in neovim is one of its coolest features and can be done in many ways depending on the task. With multicursor implemented in neovim way we have now even more power of editing.

Huge thanks to neovim team and maintainers for landing this feature!

https://youtu.be/S5kfUZQNzhU


#1 Visual Block: Ctrl-v

Select a rectangle, then I or A types into every row of it.

Keys Effect
Ctrl-v G I- <Esc> Insert - before the column on every line
Ctrl-v G $ A; <Esc> Append ; at every line end

Best for the same column on adjacent lines. Breaks when the target moves from line to line.

#2 Normal on a Range: :norm

Run normal-mode keys on each line of a range. Motions find each line's own target.

Command Effect
:%norm I- Prefix every line with -
:%norm xf]D Delete the [, jump to ], delete to the end

#3 Global Command: :g and :v

Pick lines by a condition anywhere in the file, then run a command on them.

Command Effect
:g/pattern/cmd Run cmd on lines that match
:v/pattern/cmd Run cmd on lines that do not
:v/:/s/^/[ok] / Prefix every line without a colon
:g/error/.!tr a-z A-Z Run a CLI on matching lines only

#4 Substitution: :s

Rewrite every match of a regex, with groups and case changes.

:%s/\v_(.)/\u\1/g turns snake_case into camelCase:

Part Meaning
\v Very magic: ( ) group without backslashes
_(.) An underscore and the letter after it
\u\1 That letter, uppercased
g Every match on the line

#5 External Commands: :{range}!

Any tool that reads stdin and writes stdout becomes an edit.

Command Effect
:%!sort -u Sort the lines, drop duplicates
:'<,'>!column -t Align the selection into columns
:%!jq . Pretty-print JSON

#6 Macros: q and @

Record an edit once, replay it anywhere.

Keys Effect
qq ... +q Record the edit, end on the next line
4@q Replay it four times
"qp Paste the macro as text to fix it

#7 Multicursor: Q (nightly)

Place cursors, and every edit lands at each one as you type. One undo reverts all of them.

Keys Effect
{Visual}Q A cursor on each selected line
zqgn A cursor on every search match
1Q / 2Q Force add / remove a cursor
:g/pattern/normal! nQ A cursor on every match, by condition
:cdo normal! Q A cursor at each quickfix item
@q The macro replays at every cursor

A cursor whose edit cannot start, like ct; on a line with no ;, is removed.

Which One to Use

Ask from the top; the first yes picks the method.

Question Method
A job a CLI tool already does? :%! external commands
Across files, or too many lines to watch? :s or :norm with :cdo
An edit you will replay later? Macro
One column on adjacent lines? Visual block
Lines picked by a pattern? :g or :v
One fixed string swapped for another? :s
Anything else on screen Multicursor

Keystroke Scoreboard

Same exercise, cursor on line 1, nvim --clean. Shortest other method against multicursor.

Exercise Other method Keys Multicursor Keys
add prefix <C-V>GI- <Esc> 6 VGQI- <Esc> 7
log levels qqxf]D+q4@q 11 VGQxf]D 7
brackets to quotes qqr"f]r"+q4@q 13 VGQr"f]r" 9
first field :%s/,.*<CR> 8 VGQf,D 6
add semicolons :%s/$/;<CR> 8 VGQA;<Esc> 6
wrap parens qqwi(<Esc>A)<Esc>+q4@q 14 VGQwi(<Esc>A)<Esc> 10
flip assignment qqdt=A=<Esc>p0xjq4@q 16 VGQdt=A=<Esc>p0x 12
conditional prefix :v/:/s/^/[ok] <CR> 15 /^\w*$<CR>zqgnI[ok] <Esc> 18
snake to camel :%s/\v_(.)/\u\1/g<CR> 18 /_<CR>zqgnx~ 9

Multicursor wins on-screen edits. A column or a condition still favors the classics.

Try It

Presentation source: https://github.com/Piotr1215/youtube/blob/main/nvim-multi-line-editing/presentation.md

Dotfiles: https://github.com/Piotr1215/dotfiles

Which method do you reach for first, and will multicursor change that?