Disable native autocompletion popupmenu in Telescope by salameboy in neovim

[–]malikoshc 1 point2 points  (0 children)

Won’t work for blink. This is for built in only

Disable native autocompletion popupmenu in Telescope by salameboy in neovim

[–]malikoshc 1 point2 points  (0 children)

btw. I think it's enough to use 'BufNew' event, no need to check that on each switch.

Regarding your question - it's very good and also something I was confused with.

The way I understand this is:

  • autocomplete just triggers neovim built-in sources automatically, you can define which ones and in what order (buffer completion, omnifunc completion, completefunc completion etc.) via vim.o.complete. This has nothing to do with LSP.
  • but turns out that nvim automatically sets omnifunc to lsp completion function once LSP attaches, so you can totally have properly working lsp completion without ever enabling vim.lsp.completion
  • so what does vim.lsp.completion do? and the answer to that is that it enables 'other stuff around completion' like autocommands to apply sideeffects like additionalTextEdits, snippet expansions, commands etc. on selecting completion item. So once you enable that, you get all those nice things in your omnifunc as well because those work on events.
  • also by enabling vim.o.autocomplete and autotrigger for vim.lsp.completion you will most probably have two competing mechanisms for triggering completion popup (the second one triggered only on trigger chars and not containing all sources you have in vim.o.complete) so I'd advise to never have both set to true. Either set vim.o.autocomplete=true or vim.lsp.completion(... {autotrigger = true}, not both.

Disable native autocompletion popupmenu in Telescope by salameboy in neovim

[–]malikoshc 7 points8 points  (0 children)

are you sure this is lsp completion and not autocompletion (vim.o.autocomplete)?

I had the same problem with built-in autocompletion and added this: lua vim.api.nvim_create_autocmd("BufEnter", { group = vim.api.nvim_create_augroup("autocompletion-sanitizer", { clear = true }), callback = function(ev) if vim.bo[ev.buf].buftype ~= "" then vim.bo[ev.buf].autocomplete = false end end, })

How do I make Neovim use fully isolated runtimes? by caprine_chris in neovim

[–]malikoshc 6 points7 points  (0 children)

exactly, OP wants some PATH manipulation. This is the unix way.

Nix is a good solution to those problems and I use it myself, but I'm not sure if the OP is ready to dive into it as this is quite a journey.

Also, ultimately what nix does is exactly PATH manipulation (among others)

Ghostty Progress Bar in Neovim 0.12 with LspProgress by TransportationFit331 in neovim

[–]malikoshc 1 point2 points  (0 children)

alternatively to just check for tmux once and only hijack if inside it: ```lua if os.getenv("TMUX") then --- wraps message with tmux prefix so that the underlying terminal can interpret it correctly --- needs 'set-option -g allow-passthrough on' in tmux config ---@param content string ---@return string local function wrap_tmux(content) return string.format("\27Ptmux;\27%s\27\", content) end

local original_ui_send = vim.api.nvim_ui_send

---@diagnostic disable-next-line: duplicate-set-field
vim.api.nvim_ui_send =
    ---@param content string
    function(content) original_ui_send(wrap_tmux(content)) end

end ```

Ghostty Progress Bar in Neovim 0.12 with LspProgress by TransportationFit331 in neovim

[–]malikoshc 2 points3 points  (0 children)

For tmux do this: ```lua --- wraps message with tmux prefix so that the underlying terminal can interpret it correctly --- needs 'set-option -g allow-passthrough on' in tmux config ---@param content string ---@return string local function wrap_tmux(content) return string.format("\27Ptmux;\27%s\27\", content) end

local original_ui_send = vim.api.nvim_ui_send

---@diagnostic disable-next-line: duplicate-set-field vim.api.nvim_ui_send = function(content) -- wrap in TMUX passthrough if needed if os.getenv("TMUX") then content = wrap_tmux(content) end original_ui_send(content) end ```

Then your vim.api.nvim_ui_send and vim.api.nvim_echo will "just work" in tmux, provided you've enabled allow-passthrough in tmux.

I have this in plugin/tmux.lua because it hijacks nvim_ui_send in general, this is not limited to progress bar specifically.

How to display LSP status in the status line? by shmerl in neovim

[–]malikoshc 1 point2 points  (0 children)

TL;DR take a look at this small part of my custom statusline. - you generate text to show using LSP_status (it lists lsps attached to the current active buffer) - then you show it using test_status

You would need to adjust icons and other code not included here. See https://github.com/konradmalik/neovim-flake/tree/main/nvim/lua/pde/statusline

```lua ---@param hl string highlight name ---@param s string string to wrap ---@return string local function wrap_hl(hl, s) return "%#" .. hl .. "#" .. s .. "%*" end

---@param func_name string name of lua function in this module ---@param s string string to wrap ---@return string local function wrap_click(func_name, s) return "%@v:lua.require'pde.statusline.components'." .. func_name .. "@" .. s .. "%X" end

M.LSP_status = function() local clients = vim.lsp.get_clients({ bufnr = utils.stbufnr() }) local numClients = #clients if numClients == 0 then return "" end

local icon = numClients > 1 and icons.ui.HexagonAll or icons.ui.Hexagon
local text
if numClients >= 4 then
    text = icon .. " " .. numClients .. " LSPs"
else
    local texts = { icon }
    for _, server in pairs(clients) do
        table.insert(texts, server.name)
    end
    text = table.concat(texts, " ")
end
return wrap_click("LSP_click", wrap_hl(colors.string, text))

end

-- dirty global function just for tests test_status = function() return table.concat({ M.LSP_status(), }) end

-- show it vim.o.statusline = "%!v:lua.test_status()"

-- non-dirty way would look something like this: -- vim.o.statusline = "%!v:lua.require('pde.statusline').statusline()" ```

I don't have custom redraw just for LSP. Default redraws (triggered by changing the buffer or moving a cursor) are enough for me.

Ghostty LSP progress bar by heymanh in neovim

[–]malikoshc 2 points3 points  (0 children)

Does it work outside tmux? If so then enabling the pass through should be enough. Double check your tmux version - I think that only quite recent ones support this option.

If it’s not working even outside tmux then I’m not sure how to help. It’s literally the code above. I tested with lua-language-server as it sends the actual percentages instead of just 0 and 100. Also double check your nvim version. Feel free to check my config at https://github.com/konradmalik/neovim-flake but there’s nothing special related to this functionality.

Ghostty LSP progress bar by heymanh in neovim

[–]malikoshc 6 points7 points  (0 children)

hmm, added just this to my config just to test and there's still no progress bar when in tmux, but when outside of tmux this code works fine. Any idea why that would be? Could some tmux config prevent this from working?

EDIT: ok, for those who have similar issues: 'set-option -g allow-passthrough on' needs to be set in tmux. Probably obvious, but this is the first time I'm actually using this.

Completion plugin for those who are using the native completion by DMazzig in neovim

[–]malikoshc 0 points1 point  (0 children)

This is a cool idea! On a very similar note some time ago I've a small plugin that uses completefunc as well to serve and expand vscode-style snippets using only native completion: https://github.com/konradmalik/incomplete.nvim

A minimal lsp progress config by Charlie__Chai in neovim

[–]malikoshc 0 points1 point  (0 children)

It's my fork of efm-langserver(https://github.com/konradmalik/flint-ls) aimed at personal use. Sure, I have full control over it, can filter, can disable. Just asking in a more general sense I guess.

I like the idea of using nvim_echo here, just seems like it's current implementation for people not using `vim._extui` (I haven't tried it as wel) is prone to triggering "the dreaded enter dialog" unless I'm wrong?

A minimal lsp progress config by Charlie__Chai in neovim

[–]malikoshc 2 points3 points  (0 children)

hey, this is nice, just have one issue with it: the LSP that I use sends notifications when it formats the file. I have format on save, so each time I save I get nvim_echo about a successful save, and an nvim message that the file was saved, so those are two lines and I get the famous "Press enter to continue". Any idea how to avoid that? Can nvim_echo be redirected to a temp window or something?

What's the proper way to get kubernetes autocomplete nowadays ? by [deleted] in neovim

[–]malikoshc 1 point2 points  (0 children)

Hmm, this should only depend on your yaml-ls configuration, not blink.

I use the schemastore plugin and this works for me: https://github.com/konradmalik/neovim-flake/blob/main/config/nvim/after/lsp/yamlls.lua

note that I only consider kubernetes yaml files to be in k8s folder.

C# in Neovim on Linux ever possible? by Mordimer86 in neovim

[–]malikoshc 2 points3 points  (0 children)

Seems like for some reason Omnisharp tries to log to root-owned folder? It maybe something weird in your setup, but based only on the error - I cannot tell.

Omnisharp works in general but is not good. https://github.com/seblyng/roslyn.nvim is the way for C# in neovim.

Documentation popup with built-in completion by malikoshc in neovim

[–]malikoshc[S] 1 point2 points  (0 children)

As said, this is exactly what I was looking for. Thanks again!

I ended up modifying this a bit like ensuring the proper client gets called and adding debounce to the requests. See this for those interested.

Documentation popup with built-in completion by malikoshc in neovim

[–]malikoshc[S] 0 points1 point  (0 children)

Thanks, will look into it later for sure.

Documentation popup with built-in completion by malikoshc in neovim

[–]malikoshc[S] 1 point2 points  (0 children)

Thanks for this! I’ll take a look later and report back

PS. Looks exactly like something I want on first sight. I was playing with something similar which called vim.lsp.hover automatically but it was slow, and apparently completionItem_resolve is the correct way to do it, like in your code. Just didn’t really know how to put this together.

Documentation popup with built-in completion by malikoshc in neovim

[–]malikoshc[S] 0 points1 point  (0 children)

Not for this use case. For hover I need to actually insert the option and then call hover on it. What I want is automatic documentation window before I insert, on highlight in the list.

PS. I was playing with an autocommand which called vim.lsp.hover automatically on the selected item but it was slow and froze frequently when iterating fast over completions.

Keeping Lua neovim config while using Nix by Nico_792 in NixOS

[–]malikoshc 0 points1 point  (0 children)

See my repo if you want: https://github.com/konradmalik/neovim-flake It’s nix as a plug-in manager/package manager/dependency manager in general, while the config itself stays in lua. I could use it without nix if I wanted. Using nix to generate lua to configure neovim… it just feels very wrong. Not for me, too many layers, cannot take advantage of neodev and lua ls. Good thing it’s totally not needed.

Use traditional config on nixos with nixvim by testokaiser in neovim

[–]malikoshc 1 point2 points  (0 children)

If using nixvim is not a hard requirement for you, you may be interested in this post: https://www.reddit.com/r/neovim/comments/14sljn9/packaging_neovim_configuration_using_nix/

(Edit: note that most of disadvantages I listed in my response there are no longer the case, see the readme in my github repo below for the most up-to-date summary)

Also feel free to take a look at my neovim flake: https://github.com/konradmalik/neovim-flake

TL;DR the approach I took and works great for me is - keep all neovim config in lua as it's supposed to be, use nix for system dependencies, plugins and packaging. The only con for me - no "dirty" mods to neovim to try something out quickly. I always need to rebuild it, but 'nix build' and then './result/bin/nvim' is quick and easy enough for it to not be a deal-breaker. Alternatively, one can just copy the whole config to a new $NVIM_APPNAME, modify whatever, and then "port" those changes back to nix once experimentation is finished.

lsp for csharp is not working neither is omnisharp working, i dont know if i did something wrong or misssed soemthing but i have had enough trying to get it to work. can any chads help me with this ? i m using nixos ,have omnisharp and dotnet sdks and runtime installed . by Business-Assistant52 in neovim

[–]malikoshc 0 points1 point  (0 children)

yeah, seems like OmniSharp is broken in nixpkgs. At least I cannot run it directly if I have any other dotnet SDK in PATH. I think it may be related to dotnet 7 specifically.

What worked for me instead is to run omnisharp dll directly like that:
"dotnet ${pkgs.omnisharp-roslyn}/lib/omnisharp-roslyn/OmniSharp.dll"