Neovim
- Ready to make the move from VSCode w/ Neovim emulator to Neovim proper. Need some recommendations please
Hello, I’m a developer wanting to change from VSCode to Neovim. I’ve been using a Neovim extension for VSCode, so I know how to drive it to some extent.
I work with:
- Rust
- Typescript
- React
I’m happy to use default NVim mostly with:
- ctags
- ins-completion
- netrwtreelisting
I want to keep things really simple and use defaults when reasonable.
I basically just want to know how to set up Rust analyser and (for ts) prettier/eslint.
Questions:
- Should I use a nvim conf file or lua? I’m happy to learn Lua if it’s recommended.
- If I need packages for the above functionality, which package manager is best (excuse the imprecise terminology)?
- Any additional recommendations?
Thank you.
- This week in neovim 78: NeovimConf speaker applications, render-markdown.nvim, telescope-frecency.nvim, smart-open.nvim, avante.nvimdotfyle.com NeovimConf speaker applications, render-markdown.nvim, telescope-frecency.nvim, smart-open.nvim, avante.nvim
This Week in Neovim 78 with news and updates from the Neovim plugin ecosystem and Neovim core.
- I've gotten my work to pay a "Neovim subscription" for two years
I posted about this on Reddit a year ago, and I figured write about it again:
> Like most companies, the one I work for will happilly pay for any employee's license to a proprietary IDE without batting an eye. Therefore, I argued that I should be able to spend that budget on a donation to an open source tool that I use daily instead. After a lot of back and forth I finally got them to donate an amount that would correspond to what they would pay for a yearly subscription to a proprietary tool to Neovim. > > Do you use Neovim at work? If so, I urge you to do the same thing! That way the core team can continue to deliver awesome new features to the editor we all love. Here's a link to where you can donate.
I now got my work to pay a $400 yearly "Neovim subscription" for the second time.
To those wondering how I did it, I basically just argued that since employees at my work have an allocated budget for buying proprietary tools, it makes sense if we could spend an equivalent amount on a FOSS alternative. That way the money spent would benefit us all, and since we use the tool to make money we have a responsibility to give back to the FOSS project.
There was a bit of a back-and forth for technical reasons because (at least in Sweden where I live), payments and donations are handled and regulated differently, but they finally made it work.
If you also use Neovim for work, I encourage you to do the same thing! That way the core team can continue to deliver awesome new features to the editor we all love. Here's a link to where you can donate. There's also the official merch store if you would like to support the project that way: https://store.neovim.io/.
- How do I change the clipboard program that neovim uses?
I start my coding workspaces in tmux sessions which persist when I log out. If I switch from a wayland session to an x11 session, then my copy and paste functionality in those neovim sessions are broken because it's still trying to use
wl-copy
. To be more precise:- Start a wayland session.
- Open a terminal and start a tmux session.
- Open neovim and do some work.
- Log out of wayland, log into an X11 environment
- Open a terminal and reconnect to the tmux session
"+y
broken.clipboard: error invoking wl-copy: Failed to connect to a Wayland server...
Restarting neovim isn't sufficient. I have to restart the entire tmux session or switch back to wayland. Is there some short cut I can take here?
- New plugin: refjump.nvim - jump to next/previous LSP reference with ]r/[rgithub.com GitHub - mawkler/refjump.nvim: Jump to next/previous LSP reference for item under cursor with ]r/[r
Jump to next/previous LSP reference for item under cursor with ]r/[r - mawkler/refjump.nvim
Hi! I've created refjump.nvim which is a plugin that lets you use
]r
/[r
to jump to the next/previous LSP reference in the current buffer for the item under the cursor.The plugin also automatically integrates with demicolon.nvim if you have it installed, which I recently posted about. This means that you can also repeat the jumps forward/backward with
;
/,
.Here's a video showing it in action.
Enjoy!
- PSA: demicolon.nvim now lets you create custom keymapsgithub.com GitHub - mawkler/demicolon.nvim: Overloaded ; and , keys in Neovim
Overloaded ; and , keys in Neovim. Contribute to mawkler/demicolon.nvim development by creating an account on GitHub.
demicolon.nvim is a plugin that lets you use
;
/,
to repeat more jumps than justt
/T
/f
/F
like diagnostic jumps with]d
/[d
and treesitter text-object jumps like]f
/[f
to next/previous function.Now you can also easily make your own custom jumps repeatable with
;
/,
. For example, I've now made gitsigns.nvim's]c
/[c
repeatable out of the box with demicolon.nvim. Here's the implementation if you're curious. For more information see the custom jumps section in the README. - Is there a solution to duplicated snippets yet?
When using LuaSnip together with nvim-cmp and a snippet library like friendly-snippets or luasnip-snippets you get a lot of duplicated snippets. That's because the language server also servers snippets. Also, you might want to create your own custom snippet that happens to share the name of a snippet that already exists.
For example, with the setup mention above, let's say that I also have a custom
fn
snippet for Rust files. When I typefn
, nvim-cmp suggests three snippets: one from rust-analyzer, one from friendly-snippets and my custom one.The solution to overriding friendly-snippets with your custom ones suggested in this open LuaSnip issue is to create your own fork of friendly-snippets. However, this is not ideal because it adds a lot of extra work to each user to ensure that their fork is up-to-date with upstream. Also, it doesn't solve the issue with language servers serving snippets with the same name. I know that for most language servers you can disable snippets, but that doesn't really solve the issue either because you might want some of those snippets.
What I would like is the option to only see one of the snippets listed if there are multiple ones with the same name. Which one would be controlled with a priority list, for example:
- If there's a custom user snippet, use that
- Otherwise, if there's an LSP snippet, use that
- Otherwise, use the one from friendly-snippets
Is this possible to achieve today?
- keymap to inspect unsaved changes
Hello, I wanted to share a small keymap I made. It lets you inspect unsaved changes in the current file. It uses diff mode, in a vertical split.
To close the diff mode, just press q in the scratch buffer.
lua vim.keymap.set( 'n', '<M-C-D>', function() local tmpft = vim.bo.filetype vim.cmd.vnew() vim.bo.filetype = tmpft vim.bo.buftype = 'nofile' vim.keymap.set( 'n', 'q', '<cmd>bw<cr>', { noremap = true, silent = true, buffer = true } ) vim.cmd('silent r#|0d_') vim.bo.modifiable = false vim.cmd('diffthis|wincmd p|diffthis') end, { noremap = true } )
edit: I discovered that this functionality is actually documented in the help pages (:h :DiffOrig). It’s basically the same action but bound to a command
- Using and setting up Neovim in Windows 11 (not WSL)
What issues or frustrations have you encountered in trying to use and set up Neovim in Windows 11?
I'm currently writing up my experience with installing, setting up, and using Neovim in Windows and would like to hear from others that have tried the same. What was annoying, difficult, or impossible in your experience?
- Need more approachable way to use and learn in-situ
Is there some intuitive menu mode that is simple to initiate? The packaged setup with dnf on F40 only has the colon help menu enabled. I don't care about mouse Luddites or the remarkableness of people with total recall. I need something like gedit level tools to just work without Planck scale resolution help, or learning career to make a useful hobby tool that is free from stalkerware nonsense like an electron based IDE.
- NVIM 0.10.1github.com Release NVIM 0.10.1 · neovim/neovim
NVIM v0.10.1 Build type: Release LuaJIT 2.1.1713484068 Changes since 0.10.0: Features lsp: Update LSP healthcheck format (#28988) Build System deps: Bump tree-sitter-query to v0.4.0 deps: Bump ...
- People that use Neovim really like Neovim | More than any other code editor, people using it want to keep using it | 2024 Stacked Overflow Developer Survey
Based on answers to the following question:
> Which development environments did you use regularly over the past year, and which do you want to work with over the next year? Please check all that apply.
Neovim is the most admired code editor in the 2024 Stacked Overflow Developer Survey
Source: https://survey.stackoverflow.co/2024/technology#admired-and-desired-new-collab-tools-desire-admire
- Which key mapping(s) have you made that you think other Neovim users might like?
It's broader than a Neovim specific mapping, I've changed the system keyboard mapping of
<Caps Lock>
to<Esc>
and<F9>
to<Caps Lock>
.I think mapping
<Caps Lock>
to<Esc>
isn't uncommon for Neovim users. But I like having<Caps Lock>
available for non Neovim purposes. - This Week in Neovim - lazy.nvim v11 supports luarocks and pkg.json, VimConf 2024 speaker applications open, tiny-inline-diagnostic.nvim, nvim-rip-substitute, nvim-lsp-endhintsdotfyle.com lazy.nvim v11 supports luarocks and pkg.json, VimConf 2024 speaker applications open, tiny-inline-diagnostic.nvim, nvim-rip-substitute, nvim-lsp-endhints
This Week in Neovim 75 with news and updates from the Neovim plugin ecosystem and Neovim core.
- Anyone using difftastic with fugitive.vim?
Difftastic is a diff tool that uses treesitter parsing to compare code AST nodes instead of comparing lines. After following the instructions for use with git I'm seeing some very nice diffs when I run
git diff
or rungit show --ext-diff
. I thought it would be nice to get the same output for hunk diffs in the fugitive status window, and in fugitive buffers in general (which use thegit
filetype). But I haven't seen any easy way to do it. Has anyone got a setup like this?I can run a command in neovim like
:Git show --ext-diff
to get difftastic output in a buffer. I'm thinking maybe I can set up fugitive to use the--ext-diff
flag by default, or set up some aliases. But there is no syntax highlighting for the difftastic outputs since the ANSI color codes that difftastic uses in interactive terminal output don't work in neovim, and the syntax highlighting for thegit
filetype assumes standard diff output which is not compatible with difftastic output. For me losing colors is not a worthwhile trade for the otherwise more readable diff output.My best idea right now is to set up a new filetype called
difftastic
, and write a new treesitter grammar or syntax plugin for it. Then set up some kind of neovim configuration to feed output from difftastic into buffers with the new filetype.There is an open neovim issue discussing adding syntax-aware diffs directly to neovim, but that doesn't seem to have gone anywhere.
- echasnovski/mini.icons: Icon provider alternative to nvim-web-deviconsgithub.com GitHub - echasnovski/mini.icons: Icon provider. Part of 'mini.nvim' library.
Icon provider. Part of 'mini.nvim' library. . Contribute to echasnovski/mini.icons development by creating an account on GitHub.
setting it up like this implements the nvim-web-devicons API, so many plugins that depend on that work with mini.icons too!
require('mini.icons').setup() MiniIcons.mock_nvim_web_devicons()
- GitHub - felpafel/inlay-hint.nvim: Neovim Lua plugin that overrides vim.lsp.inlay_hint just to fill my desire to edit inlay hints.github.com GitHub - felpafel/inlay-hint.nvim: Neovim Lua plugin that overrides vim.lsp.inlay_hint just to fill my desire to edit inlay hints.
Neovim Lua plugin that overrides vim.lsp.inlay_hint just to fill my desire to edit inlay hints. - GitHub - felpafel/inlay-hint.nvim: Neovim Lua plugin that overrides vim.lsp.inlay_hint just to fil...
Not mine but this is a great plugin for customising the native LSP inlay hints. Hope some of you also find it helpful.
This is related to an earlier post I made, asking if there was a way to move the native LSP hints to the end of a line rather than appearing within the line. Found exactly what I was looking for with this plugin!
- Showing off my new alien spaceship themed tabby.nvim setup :D (feat. neovide, fzf, airline, markview)
My new design direction for neovim is "you just sat down in a homie's spaceship and have no idea what any of the buttons do" -- you can see how I did it here with tabby.nvim: https://github.com/Garoth/Configs/blob/da354cd98241dc7582718a9082226fab99403e4a/nvim/init.vim#L752
I'm an oldschool vim guy, so a lot of my plugin tastes lean towards the ancient. Telescope?? Nah I had that figured out with fzf.vim many years ago, and it's stupid fast. Harpoon? Nah, I have marks, permanent undo and location memory, alternate files, fast search. Plus I love using fzf in my terminal so it all blends together so well. I still use vim-plug, it's pretty much perfect, and have no interest in lazy or whatever the new flavor-of-the-year package manager is
Neovide continues to be what I believe is the future of neovim. The performance is best in class, probably theoretically better than even terminals can achieve (since rendering can be done much more selectively, understanding vim concepts like floating windows and such, which have compositing in neovide). The idea of "progressive improvements" in a GUI rather than trying to make something totally different is a great call. In the future, they are likely to implement a new age of image rendering too, which would be aware of z-index layering (so you could have a floating window on top of an image -- current image-in-terminal approaches just put the image on top)
Airline -- well, this is in the category of "if it aint broke dont fix" -- Airline has been in development for like 11 years and has 2700+ commits, 17k+ stars on github. I mean, this is a ridiculous history, that's more work than most projects on github, just for a statusline. I don't tend to chase trends or replace vim code with lua - who cares - vimscript is stable and reliable
Shoutout to the Maple Mono font -- with a lot of amazing ligatures that I didn't have before, super cozy. Demo recorded on an 7 year old samsung chromebook running Wayland/Pipewire Arch with a dualcore cpu, 4gb of ram, 14nm intel integrated graphics, and a 32gb harddrive. Linux is so cool, being able to do that. The ending was... not on purpose lmao
- [solved]help - tmux paints vim
idk im having this issue for a long time. itd be nice to have this fixed.
thanks
Edit: I that doesnt help:
term=xterm-...
in shell configset-option -ga terminal-overrides ",xterm-256color:Tc"
in tmux config
solution:
thanks to mazadin for the solution.
im using foo terminal, so setting
set-option -ga terminal-overrides ",foot:Tc"
in tmux.config fixed it. (yeah im dumb) - Anyone using a Neovim distribution? Which one?
Been using LunarVim which seems discontinued and started to break recently. Probably moving to SpaceVim soon. Other distro's being used here?
- suedit.nvim — A plugin to easily edit root filesgithub.com GitHub - Grafcube/suedit.nvim: A neovim plugin to seamlessly edit files that require superuser access
A neovim plugin to seamlessly edit files that require superuser access - Grafcube/suedit.nvim
I made a small plugin that other people might find handy. It checks if the file open in the current buffer has write access and if not, prompts for sudo (or any other command at your choice) and copies the file.
No longer do you need to care about forgetting to use sudoedit or anything else, just edit the files you want to edit! This could change the world!!1!
But in all seriousness, this is my first neovim plugin and I barely spent an hour on it but it's simple and it gets the job done. It scratches a minor itch and maybe you'll also find it useful.
- parrot.nvim: use Claude Opus, ollama, perplexity.ai and OpenAI from neovimgithub.com GitHub - frankroeder/parrot.nvim: parrot.nvim 🦜 - the plugin that brings stochastic parrots to Neovim.
parrot.nvim 🦜 - the plugin that brings stochastic parrots to Neovim. - frankroeder/parrot.nvim
This is parrot.nvim, the ultimate stochastic parrot to support your text editing inside Neovim.
Frank Röder started this repository because a perplexity subscription provides $5 of API credits every month for free. Instead of letting them go to waste, he modified his favorite GPT plugin, gp.nvim, to meet his needs - a new Neovim plugin was born! 🔥
Unlike gp.nvim, parrot.nvim prioritizes a seamless out-of-the-box experience by simplifying functionality and focusing solely on text generation, excluding the integration of DALLE and Whisper.
Features
- Persistent conversations as markdown files stored within the Neovim standard path or a user-defined location
- Custom hooks for inline text editing with predefined prompts
- Support for multiple providers:
- Anthropic API
- perplexity.ai API
- OpenAI API
- Local and offline serving via ollama
- Custom agent definitions to determine specific prompt and API parameter combinations, similar to GPTs
- Flexible support for providing API credentials from various sources, such as environment variables, bash commands, and your favorite password manager CLI
- How to disable automatic identation
I'm normally a straight vim user (just out of habit, no particular preference) and I'm giving neovim a spin. So far I like it but...
For the love of all that's holy, how do I disable automatic indentation?
I have noautoindent set, nosmartindent set, filetype indent off, but neovim keeps inserting indentations. The only thing that works is setting paste on, but that's not the right solution to this problem.
Please help. This is driving me nuts!
- How lazy loading works in Neovimash.fail How lazy loading works in Neovim
Implementing and explaining lazy loading in Neovim with around 30 lines of code.
- Why might my treesitter symbols be empty?
I'm on NixOS and slowly working through neovim config.
I have treesitter installed with all grammars and it's set up in lua. When I run :TSymbols, it pops open a window showing -----treesitter-----, but no symbols are shown from the (python) code I have open.
All of the setup is put in place by the config flake I'm using, but I don't think there's any additional stuff to add for symbols to work. The treesitter section in the resulting init.lua from nix looks like this:
require('nvim-treesitter.configs').setup({ ["context_commentstring"] = { ["enable"] = false }, ["highlight"] = { ["enable"] = true }, ["incremental_selection"] = { ["enable"] = false, ["keymaps"] = { ["init_selection"] = "gnn", ["node_decremental"] = "grm", ["node_incremental"] = "grn", ["scope_incremental"] = "grc" } }, ["indent"] = { ["enable"] = false }, ["refactor"] = { ["highlight_current_scope"] = { ["enable"] = false }, ["highlight_definitions"] = { ["clear_on_cursor_move"] = true, ["enable"] = false }, ["navigation"] = { ["enable"] = false, ["keymaps"] = { ["goto_definition"] = "gnd", ["goto_next_usage"] = "<a-*>", ["goto_previous_usage"] = "<a-#>", ["list_definitions"] = "gnD", ["list_definitions_toc"] = "gO" } }, ["smart_rename"] = { ["enable"] = false, ["keymaps"] = { ["smart_rename"] = "grr" } } } })
- Configuring Neovim for Swift Developmentwww.swift.org Swift.org
Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
- A Powerful Way To Make Editing Code In Neovim Even Better (Treesitter & Text Objects) | Josean Martinez | October 4, 2023www.josean.com A Powerful Way To Make Editing Code In Neovim Even Better (Treesitter & Text Objects)
How to setup treesitter & treesitter text objects to take code editing in Neovim to the next level.
- My workflow for writing SQL(ite) queries (2024 edition)www.jvt.me My workflow for writing SQL(ite) queries (2024 edition) · Jamie Tanna | Software Engineer
Writing about my recent workflow for writing, executing, and sharing SQL queries with others.
- Help disabling "Possible spelling mistake found" in vimtex
Hi everyone, could someone help a desperate student to turn off the 'Possible spelling mistake found' in LaTeX files with the vimtex plugin. It's been 3h now and I still dont have any idea on how to turn this off (or at least change the language, but knowing how to do both would be really cool). I tried everything I could, still don't kow where this is from. Help would be really appreciated. Thanks in advance.
- Neovim on Fedorafedoramagazine.org Neovim on Fedora - Fedora Magazine
This article will guide you through installing Neovim on Fedora for efficient and effective coding in languages like Rust, Python, Go, and TypeScript. Note: It is not a tutorial on Neovim.
- 😽 kitty-scrollback.nvim v5.0.0 drop support for Kitty version < 0.32.2 + use Kitty's builtin bracketed paste + experimental tmux support
kitty-scrollback.nvim v5.0.0 is officially released! Check out the announcement here
What is kitty-scrollback.nvim?
A Neovim plugin (and Kitty Kitten) that allows you to navigate your Kitty scrollback buffer to quickly search, copy, and execute commands in Neovim.
!demo
Check out the README for detailed information, the Wiki for additional configurations, and Advanced Configuration Examples for more demos!
What changed?
See Migrating to v5.0.0 for the detailed migration guide.
- kitty-scrollback.nvim v5.0.0 uses Kitty's builtin
--bracketed-paste
option when sending commands to Kitty. The--bracketed-paste
option was added in Kitty 0.32.2. If you are using an older version of Kitty, then upgrade to the latest version or at least 0.32.2. - Alternatively, if you are unable to upgrade Kitty, then you can still use tag v4.3.6 of kitty-scrollback.nvim.
- See kitten-send-text for more information on the
--bracketed-paste
option.
Other minor version updates
- Added experimental tmux support in v4.0.3! See tmux (🧪 experimental ) for setup instructions.
- A handful of bug fixes and smaller features, see the CHANGELOG for more information.
What's next?
The next feature I plan to work on is adding command-line editing support (see #253). I also plan to complete the work necessary to move tmux support from experimental to stable.
If you have any questions, comments, or feedback feel free to create an issue or open a discussion.
- kitty-scrollback.nvim v5.0.0 uses Kitty's builtin
- Personal simple statusline
Personal simple statusbar script. https://gitlab.com/-/snippets/3715695
Works best with Humanoid colors.
- Trouble v3 has been releasedgithub.com GitHub - folke/trouble.nvim: 🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing. - folke/trouble.nvim
- Neovim Configuration for SystemVeriloggithub.com GitHub - thecooldaniel/nvim-config-systemverilog: A minimum configuration for Neovim targeting SystemVerilog that provides configuration for plugin management, a language server, tree-sitter, and linting
A minimum configuration for Neovim targeting SystemVerilog that provides configuration for plugin management, a language server, tree-sitter, and linting - thecooldaniel/nvim-config-systemverilog
Hey everyone,
I wanted to use Neovim for writing SystemVerilog, but found that there were very few examples or discussions around how to get common plugins like lspconfig, nvim-lint, and nvim-treesitter working together. After building a configuration that works for me, I thought I would share it as an example for others in the future.
You can find it here: https://github.com/thecooldaniel/nvim-config-systemverilog
Hope it helps someone and feedback/contribution is very welcome.
- A nice video demonstration of Flash.nvim | Navigate your code with search labels, enhanced character motions and Treesitter integration
YouTube Video
Click to view this content.
The presenter compares some of the functionality to Leap.nvim
- [solved] How to get rid of those stupid background and font color?
Update: Based on the discussion here and in other places I added the following (well, technically I did something different in my colorscheme, but in the end it translates to that)
lua vim.api.nvim_set_hl(0, 'Normal', {})
This reverts the weird text and background colors to the previous behavior of ... not setting them. ________
With update 0.10 Neovim behavior changed regarding text color and background color.
I use a color theme that does not set those and previously this worked perfectly fine. Neovim simply used the font color defined in the terminal and had a transparent background.
Now the background is
#14161b
and the font color is#e0e2ea
. Neither of the colors is configured ANYWHERE in my whole setup. Neither in the colorscheme, nor in my terminal configuration, nor in my Neovim configuration.Is there a sane way to revert this to the old behavior? (i.e. use the font color configured in the terminal’s configuration and use transparent background.)