Neovim

14 readers
1 users here now

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

founded 1 year ago
MODERATORS
1
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/lukas-reineke on 2024-04-10 05:08:06.


There was a discussion about search and replace in Neovim yesterday, and some people seemed to not know about :help grep. I'll use that as an excuse to write about it.

First of all, :grep will search for a regex pattern in the files specified, and populate the quickfix list with the result. From there, you can do a lot of things, one of which is search and replace. The quickfix list is extremely powerful. To get familiar with it, I recommend reading :help quickfix.txt.

Now, grep is not very fast. We can do a lot better today by using ripgrep. And it is super easy to use it from within Neovim by changing :help 'grepprg' and :help 'grepformat'.

vim.opt.grepprg = "rg --vimgrep"
vim.opt.grepformat = "%f:%l:%c:%m"

With this in your init.lua, :grep will use ripgrep instead. ripgrep works slightly different from normal grep in that it does not take a second file parameter, but instead just searches in the current directory. So to use it, all you have to do is run :grep foo.

Some other tips.

  1. To get rid of the annoying message output, run it with :help :silent, :sil grep foo
  2. ripgrep has a lot of useful options. I personally use --hidden to include hidden files, and --smart-case, which works the same as :help 'smartcase'
2
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/po2gdHaeKaYk on 2024-04-09 23:58:42.


Despite using neovim for a while, I still struggle to develop a good paste workflow. I currently use a few things:

The stock lazyvim.org configuration uses

opt.clipboard = "unnamedplus" -- Sync with system clipboard

I also use cutlass.nvim which makes it so 'd' and similar do not overwrite the register and 'x' is devoted to a 'cut' operation.

Here is a typical thing. I have some text I want to paste.

I have this.

abcd|efg
123455

I want to paste where there is |

Let's say I might be either in normal mode or insert mode.

If I'm in normal mode, I might need to

  • get to the location |. I might do this via searching and then tapping 'j' or 'k' to put myself into position.
  • I then have to either hit 'p' or 'P'.
  • Then I usually have to go into insert mode, then clean up before the pasted entry (inserting spaces, , etc.)
  • Then I have to Esc, go to the end of the pasted entry (somehow!), then again into insert mode then clean up the end bit.

The above might take many keypresses just to navigate backwards and forwards. The format of the pasted item might not be as simple as a single word (it rarely is). It might be multi-line or having lots of symbols.

Now let's say that I'm already at | in insert mode.

  • I either need to Esc and then use the route above
  • Or I need to type the clunky * to get the paste within the insert mode.

Overall, the whole process above is messy, and takes an inordinate number of keys because of the constant switching in-and-out of insert mode.

Do any of you have any suggestions on how to paste quickly and reformat without so many keypresses?

I know that we don't like to think this way, but using a mouse-one-handed keyboard workflow in a non-modal editor you essentially do this:

  • Mouse-click where you want
  • to paste
  • Mouse click start, reformat
  • Mouse click end, reformat

A keyboard workflow would be great, but I cringe not having a more efficient workflow.

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

The original was posted on /r/neovim by /u/Silver_Bee on 2024-04-09 10:34:23.


I would like to announce that nvim-highlight-colors now supports LSP for any language server that supports the textDocument/documentColor method.

If you have tailwindcss LSP installed for example, the plugin will fetch your tailwind.config.js and highlight your custom themes accordingly ๐Ÿ˜

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

The original was posted on /r/neovim by /u/Jealous-Salary-3348 on 2024-04-09 08:35:09.


Why bother with mini.starter, vim-startify, dashboard-nvim, or any of those distractions? I know you, my friend. Forget about all that noise โ€“ all you truly need is I use Neovim (BTW).

Embrace it proudly, and let your ego shine!

Check it out and leave me a fucking star Btw.nvim

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

The original was posted on /r/neovim by /u/db443 on 2024-04-07 08:05:46.


Hello folks,

I maintain moonfly and nightfly themes.

On thing I really dislike is when a Language Server (LSP) supports Semantic Token highlighting AND that highlighting is very different to Tree-sitter. As in, you open up a file, Tree-sitter highlighting kicks in (and it looks nice) then LSP Semantic Token highlighting takes over and colors change.

As a theme author I want LSP Semantic Token highlights to be additive (only change unhighlighted normal text), in all other respects I want the Semantic Token colors to be the same as existing Tree-sitter colors.

I have experienced this with Rust Analyzer with the small amount of Rust I deal with. Colors for token were different, which I equalized.

The typescript-language-server also supports Semantic Tokens, but is more conservative, it highlights paramaters which Tree-sitter does not. I do not recall having to intervene in my theme like I did with Rust and Rust Analyzer.

So my question is, which other maintream LSPs support Semantic Tokens? I want to install those LSPs and fix my themes to have the same colors for LSP Semantic Tokens and Tree-sitter.

Cheers.

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

The original was posted on /r/neovim by /u/alphabet_american on 2024-04-07 04:16:37.


vue-goto-definition

The Problem

When using vue with autoimports (unplugin-vue-components and unplugin-auto-import or using nuxt) vim.lsp.buf.definition will populate location list with the autoimport definition file and/or the typescript declaration for a symbol. | Another issue with Volar LSP is that since it uses typescript LSP, when vim.lsp.buf.definition is called it requests definitions from both volar and tsserver. Since the two LSP can return different results, the consequences can be unpredictable.

The Solution

vue-goto-definition waits a debounce period (configurable in opts) before processing definitions. This allows Volar and tsserver time to return definitions.

vue-goto-definition overrides vim.lsp.buf.definition to attempt to filter the location list and decide the best source for a symbol's definition.

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

The original was posted on /r/neovim by /u/Fjueic on 2024-04-07 16:25:58.


Markdown editors generally lack robust support for Vim (at least in my experience). Although Neovim offers a conceal level feature, it falls short in terms of image support. Consequently, I've devised a personalized workflow:

  1. Markdown rendering occurs in real-time within a browser.
  2. The line currently under the cursor remains synchronized with the browser.
  3. Any edits made in the Neovim buffer are reflected in the browser, with a debounce time of 1 second.
  4. I utilize Vimwiki for navigation and Telescope for fuzzy finding.
  5. All notes are stored within a single directory, with a designated directory for non-markdown files such as images

Edit:

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

The original was posted on /r/neovim by /u/Anxious_Sample_8338 on 2024-04-07 01:43:04.


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

The original was posted on /r/neovim by /u/speediegq on 2024-04-06 23:08:51.

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

The original was posted on /r/neovim by /u/HalfLife0693 on 2024-04-06 12:30:33.

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

The original was posted on /r/neovim by /u/nostromo on 2024-04-06 08:43:14.


Neovim 0.9 crashes were very rare. Ever since I switched to 0.10 nightly about 2 months ago, I've noticed it crashes once every few days. At first I thought it was because my OS and terminal are super old since 0.10 assumes more modern compilers and computers. But I recently switched to Ubuntu 22.04 and it's still happening. Has this been happening for anyone else?

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

The original was posted on /r/neovim by /u/sushi_ender on 2024-04-05 21:11:43.

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

The original was posted on /r/neovim by /u/echasnovski on 2024-04-05 18:08:33.

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

The original was posted on /r/neovim by /u/sushi_ender on 2024-04-03 18:37:14.

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

The original was posted on /r/neovim by /u/SayantaSingh on 2024-04-03 18:09:44.

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

The original was posted on /r/neovim by /u/Mhalter3378 on 2024-04-03 15:39:42.


Earlier this week the AstroNvim team and community was excited to finally release AstroNvim v4! It has been nearly 10 months in active development, over 2 months of public beta testing, and just an incredible amount of community involvement to get it to where it is today!

This release focuses on modularization of the configuration into several core plugins (AstroCore, AstroUI, AstroLSP) and converts AstroNvim into a plugin that you can use to import plugin specs into the Lazy plugin manager rather than a distributed neovim configuration outright. This has not only allowed us to remove our own configuration engine and rely entirely on normal Neovim configuration standards, but also empower the AstroCommunity plugin marketplace to have more control over configuration! This also means that users now have full control over their ~/.config/nvim directory rather than worrying about having the AstroNvim source code living there.

I want to give an amazing shout out to the community for the amazing things happening over at AstroCommunity as well. This community driven marketplace for sharing plugin specifications and first class language server support has grown so over the past ~18 months. The repository now boats 200+ individual Neovim plugins and 60+ programming language packs which can all be easily installed into an AstroNvim configuration!

We have also done some huge improvements to our Documentation to make it easier for users to get started and to learn more about building up their Neovim configuration! If you are currently using AstroNvim v3, please check out the v4 Migration Guide which provides great direction to migrating your configuration as well as specific instructions for doing the migration in parallel with your current configuration (using NVIM_APPNAME).

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

The original was posted on /r/neovim by /u/sushi_ender on 2024-04-03 07:32:53.

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

The original was posted on /r/neovim by /u/mopsandhoes on 2024-04-02 19:43:42.


I had my GitHub account suspended for "violating terms of service". This happened while I was getting things setup on a new machine, so maybe some suspicious login behavior, but not like anything that has been told to me is concrete on what policy (if any) was violated.

I also recently released a plugin that got some good traction (), the page for that is down :( Unsure how this impacts users, maybe only when they try to update?

I saw a recent post of another user experiencing the same problem, it's really sad to see but not unexpected given Microsoft.

I have always only used GitHub and while I knew that wasn't the best idea, it was never a problem, I guess as these things go it's not a problem until it is.

Does anyone have any setup they use to not be so tied to GitHub? I guess ideally there would be some way for me to maintain all of my repos across multiple Git hosts (GitLab, etc.). Maybe something like multiple mirrors, but then I would need to choose some main one as the root which doesn't sound ideal. I really don't know what the possibilities are here and would love any input.

Thanks!

Edit: My public GitHub is back now, they did resolve the problem quickly, but still looking for ways to avoid this in the future

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

The original was posted on /r/neovim by /u/Hawkis98 on 2024-04-02 17:45:17.

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

The original was posted on /r/neovim by /u/monkoose on 2024-04-02 12:09:51.


I want to present new AI completion plugin neocodeium which is powered by free codeium toolkit.

It is the same thing as codeium.vim, but have some quality improvements:

  • It doesn't flicker that much (especially annoying with multiline suggestions).
  • Completion on the current line are repeatable with the :h .
  • Can complete only word/line of the suggestion
  • And some other improvements not so noticable by the end user

It needs to be tested on Windows, so if you are windows user and have time to test it, let me know if you have met some issues.

I have been used it as my main autocompletion plugin (only invoke nvim-cmp occasionally with the keymap) for a few weeks. And I like the experience, so I hope you will enjoy it too.

Note: currently, work only on nightly build.

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

The original was posted on /r/neovim by /u/Melodic-Use779 on 2024-04-02 01:22:31.


Hey r/neovim!

I've been working on a plugin that I think could really enhance how we handle yanks and deletions in Neovim. It's called YankBank, and it's designed to make accessing your recent yank history a breeze.

What it Does: YankBank captures the 10 (or N) most recent yanks and deletions, storing them for quick retrieval. It displays these in a popup menu, including the current contents of the unnamedplus (+) register for easy access. Selecting an entry pastes it right at your cursor!

I'd love to hear your thoughts, suggestions, and any feedback on how YankBank can be improved or if it fits into your workflow!

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

The original was posted on /r/neovim by /u/StrayFeral on 2024-04-01 13:58:18.


I believe it's just a matter of time.

I also remember emacs had tetris. Why neovim does not? :(

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

The original was posted on /r/neovim by /u/sushi_ender on 2024-04-01 21:25:21.

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

The original was posted on /r/neovim by /u/anand4k on 2024-04-01 20:47:06.

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

The original was posted on /r/neovim by /u/NeonVoidx on 2024-04-01 06:33:40.


Just wanted to post my theme here I made, its part of a multi port effort (similar to Catppuccin and Dracula) that I plan to port to a lot of apps. Open to collaborators and anyone that wants to file issues. Thanks!

view more: next โ€บ