Neovim

2702 readers
1 users here now

founded 2 years ago
MODERATORS
1
 
 

cross-posted from: https://lemmy.world/post/41297887

I really wanted a HTML live reload plugin that has statusline integration and does not depend on entire chromium to create a simple web server. I couldn't find anything I'd like so I've decided to make my own plugin. I was kinda afraid that implementing websockets in lua would be terrible task but it turns out I didn't need to, because SSE exists. HTTP is simple, watching for file changes as well so I got to work. Result: Very small (Less than 500 lines of code) plugin that launches in 0.1-0.2ms! (It's amazing what you can do when you don't need to load whole V8 from Chromium to serve a simple webpage. I also made support functions for statusline of two popular distors: NvChad and AstroNvim but you can also launch it from cmds if you prefer.

Since I'm kinda new to nvim & lua scripting I'd appreciate any feedback on what could be improved or just done better. For now I plan to add more features inspired vscode's live-server extension although it most likely won't be exact copy of that extension.

Link:

GitHub Repository

2
4
Issue with lsp (piefed.blahaj.zone)
submitted 3 days ago* (last edited 3 days ago) by dragonfeathers@piefed.blahaj.zone to c/neovim@programming.dev
 
 

Hi, Wondering if anyone has had/solved this issue.

I've been fighting with nvim-lspconfig and ruby_lsp. I have a lazyvim setup and used mason to install ruby_lsp. The problem is that every time I open a ruby file the lsp client is loaded twice.

I tried modifying my mason.lua according to a video I found like so:

{
  "mason-org/mason-lspconfig.nvim",
  opts = {
    -- Settings to prevent duplicate clients in buffer
    ensure_installed = {},
    automatic_installation = false,
    automatic_setup = false,
    automatic_enable = false,
    handlers = nil,
  },
},

I tried disabling mason-lspconfig entirely and manually installing the ruby gem for the lsp, hoping that the lspconfig would use that. Rubocop (also installed via mason) stopped loading, but the duplicate clients remained. I'm still not sure if this is a problem with mason, nvim-lspconfig, the lsp itself, or lazyvim. My python and lua lsps have been fine. Right now I've given up and switched to using solargraph, but the issue haunts me and I shall not know peace until I manage to fix it.

3
4
 
 

Great interview, from YT description:

"Echasnovski is the creator of mini.nvim, as per the website: "Library of 40+ independent Lua modules improving overall Neovim (version 0.9 and higher) experience with minimal effort. They all share same configuration approaches and general design principles. Think about this project as “Swiss Army knife” among Neovim plugins: it has many different independent tools (modules) suitable for most common tasks. Each module can be used separately without any startup and usage overhead."

He's also the creator of MiniMax: "MiniMax is a collection of fully working self-contained Neovim configs. All of the them: Use mostly MINI to showcase its capabilities. Provide out of the box a stable, polished, and feature rich Neovim experience. Share minimal structure with potential to build upon. Contain extensively commented config files meant to be read. It can be automatically set up, which uses the best suited config from available ones."

The interview is over 3 hours long, so it is split in 2. Part 2 is going to be released soon"

00:00:00 - Highlights
00:01:36 - How do we pronounce your name
00:04:23 - What do you do in the neovim community?
00:07:53 - Neovim 0.5 and the wild wild west of lua plugins
00:10:23 - We've been planning this interview for over 6 months
00:12:20 - Echasnovski's ban on reddit
00:14:59 - Colorscheme theory (that I didn't understand, not normie friendly)
00:22:10 - Color theory is very complex as everyone is different
00:23:30 - Gruvbox is for old people, highly saturated colors
00:27:15 - Echasnovski created the default Neovim colorscheme
00:27:38 - Justin Keyes also likes boring colors. Old soul trapped in a young body
00:29:17 - Is Justin a dictator?
00:32:18 - Why the reddit ban?
00:38:49 - long reddit posts go through mod's approval
00:40:17 - How does the shadown ban work?
00:42:02 - Shoutout to Lukas Reineke
00:43:37 - Account restored by a misterious reddit employee
00:45:19 - Self hosting git server, codeberg, tangled.org
00:48:02 - Why planning on self hosting?
00:49:17 - Explaining the repo structure of mini.nvim
00:50:44 - You also have a picker? mini.pick
00:52:15 - Sylvan Franklin seems to use mini.pick
00:52:53 - Custom pickers?
00:54:03 - Issues with the matching of some pickers
00:56:18 - mini.pick has a frecency option? mini-visits (sounds like a prison conjugal visit)
00:59:30 - Thoughts on telescope?
01:01:00 - Why did you move from vim to neovim?
01:03:48 - Embarrassing experience with vim at work
01:05:32 - vscode neovim plugin
01:07:21 - Do you remember your first times using vim, was it tough?
01:10:38 - Thoughts on distros? What do you recommend to a beginner?
01:16:58 - What happened to lunarvim?
01:18:23 - Lazyvim distro or kickstart
01:19:38 - MiniMax demo
01:21:24 - Is MiniMax designed for complete beginners?
01:25:59 - mini.clue and why not which-key?
01:26:37 - Folke is always on vacation
01:29:11 - Did you copy Helix?
01:31:01 - The which-key hate continues
01:35:29 - Interview with Folke?
01:36:02 - The 30_mini.lua config file
01:39:21 - What if I want to use my own picker with MiniMax?
01:42:14 - Single config file for all plugins or a file per plugin?
01:44:21 - Echasnovski allegedly created the new neovim plugin manager vim.pack
01:48:10 - Should I wait for Neovim 0.12 before trying MiniMax?
01:52:22 - vim.pack doesn't have a healthcheck because it's perfect
01:52:54 - vim.pack demo
01:54:16 - Do you use any other plugins besides mini.nvim?
5
 
 

Quotes from the video:

On what's lacking with native completions:

""But there there is one thing that is lacking and I will be honest. it is the fact that you can't like view the documentation. So I like viewing the documentation like when I'm looking at I want to know what health does I want to know what gsplit does. I want to be able to see it without having to go into the help document the help docs to view what that function does.""

and

"The current omnicomplete doesn't support adding more than one source. So, the LSP is one source of the completion. You can't add another source, which is then the snippet engine like LuaSnip"

6
 
 

In vscode, I was using live-server extension that reloads website whenever a file changes. What's the equivalent of this for people using nvim? What do you use?

7
 
 

Is there any tutorial for this?

Annoying missing features:

  • there's no auto complete for css

  • sometimes lsp won't get type of things that vscode would get, therefore no auto complete for its properties or methods

8
9
10
 
 

Found this interesting, thought I'd share.

11
12
13
14
15
16
 
 

Hi, This will be my first significant open source contribution. A markdown lsp that works as PKMS. It features an interactive graph like one in obsidian.

Currently in beta stage.

Would love your feedback.

And if you like the project consider starring it. I need at least 100 to be able to add it into mason registry for easy installation.

17
18
19
20
 
 

@neovim@programming.dev @neovim@sopuli.xyz Does anyone use #kotlin in #neovim using kotlin_ls? Each time I accept an autocompletion, it instead deletes the whole token.

21
 
 

Hi, I want to try Neovim and am currently setting it up. I want an easier way to type or <C-[>, so I added these keymaps:

vim.keymap.set("", "<C-Space>", "<C-[>")
vim.keymap.set("!", "<C-Space>", "<C-[>")

But this does weird stuff: In insert, visual and normal mode it seems to work and pressing CTRL+Space brings me back to normal mode or does nothing. But when entering a colon-command, pressing CTRL+Space acts as if I had pressed Enter. When typing "r" (single character replace) and then CTRL+Space, it replaces the character by a space, as without the mapping.

The same applies when mapping other keys than instead (the terminal seems to send correctly), or when mapping to instead of <C-[>.

What's going on here and how can I get the mapping to work? Thanks for any help!

22
23
 
 

Hi,

As one of my machines is a bit more security sensitive I've been looking into securing neovim a bit more and not having Lua code "free running" on my machine. This is mostly an experiment

I've been happy with the (somewhat) sense of security firejail and neovim profile with no network option gives but then this all goes away once I need to run neovim with network access to update packages et al.

So my question is: is it possible to package all that I need to run neovim (Lua code, mason installed binaries, etc) into an app image or some other format to then run under firejail? Which folders would I need besides the usual ones (.config/neovim)

As for package updates I was thinking about doing it in my personal machine where I would then package everything and install it on the sensitive machine

24
25
 
 

Hello guys, my question is basically in the title. I would really like to be able to have the parameter names included when I cursor over a function and open the 'hover' window to show basic info about it. Currently it only shows me the expected types, which while still useful I feel is only a piece of the puzzle when working either with a new library, or a codebase you're not familiar with.

As an example I'm learning ncurses these past couple days, and its significantly flow-breaking to have to switch focus away from the editor to either search on the web what a particular function takes as parameters, or open a separate terminal to read the man page for it. I'm still not familiar with the library so I frequently need to look up what a parameter represents in the context of the code, in addition to what type I should give it. Is there any way to do this while still using clangd as my lsp server?

Ive also included a screenshot of one such hover window for the ncurses function mvprintw.

view more: next ›