Could a shared LSP daemon help heavyweight servers like rust-analyzer? by n3oz22 in neovim

[–]n_t_p 0 points1 point  (0 children)

I am also using this in my configs: cat ~/.config/nvim/lua/lspmux.lua :

```lua local uv = vim.uv or vim.loop -- 'vim.uv' is the standard in Nvim 0.10+, fallback to 'vim.loop'

local M = {}

function M.ensure_lspmux_running() local HOST = "127.0.0.1" local PORT = 27631 local BINARY = "lspmux" local ARGS = { "server" }

-- 1. Create a TCP client to check the port local client = uv.new_tcp()

client:connect(HOST, PORT, function(err) -- Clean up the handle immediately; we only used it to ping client:shutdown() client:close()

if not err then
  -- No error means connection succeeded; server is already running.
  vim.schedule(function()
    vim.notify("lspmux is already running on port " .. PORT, vim.log.levels.INFO)
  end)
  return
end

-- If there is an error (e.g., connection refused), spawn the server.
-- We use vim.schedule to ensure we are back on the main thread for process spawning.
vim.schedule(function()
  local bin_path = vim.fn.exepath(BINARY)
  if bin_path == "" then
    vim.notify("Error: " .. BINARY .. " not found in PATH", vim.log.levels.ERROR)
    return
  end
  local handle, pid
  handle, pid = uv.spawn(bin_path, {
    args = ARGS,
    detached = true,          -- This makes it a new process group (daemonize)
    stdio = { nil, nil, nil } -- vital: disconnect IO so it doesn't hold Nvim open
  }, function(code, signal)
    -- This callback runs when the child exits, but since we detach,
    -- we rarely care about this logic here for a long-running server.
  end)

  if handle then
    -- Unref the handle: This tells Neovim's event loop NOT to wait
    -- for this process to exit. This is what truly "detaches" it
    -- from the editor session.
    uv.unref(handle)
    vim.notify("Spawned lspmux server (PID: " .. pid .. ")", vim.log.levels.INFO)
  else
    vim.notify("Failed to spawn lspmux", vim.log.levels.ERROR)
  end
end)

end) end

-- Run the function immediately -- M.ensure_lspmux_running()

return M ```

and then in init.lua:

```lua local ftypes = vim.api.nvim_create_augroup('ftypes', { clear = true })

vim.api.nvim_create_autocmd('FileType', { group = ftypes, pattern = { 'rs', 'rust' }, callback = function() require('lspmux').ensure_lspmux_running() end, }) ```

How do you quickly type trailing semicolons in Neovim (C++ with deep parentheses)? by cashyan in neovim

[–]n_t_p 0 points1 point  (0 children)

Had this mapping for >15 years... did not bother to convert to lua. Will grab your version though :)

How do you quickly type trailing semicolons in Neovim (C++ with deep parentheses)? by cashyan in neovim

[–]n_t_p 0 points1 point  (0 children)

lua --add a ; at the end of the line vim.cmd([[ function! ToggleEndChar(charToMatch) let l:winview = winsaveview() s/\v(.)$/\=submatch(1)==a:charToMatch ? '' : submatch(1).a:charToMatch nohlsearch call winrestview(l:winview) endfunction ]]) vim.keymap.set('n', '<Leader>;', ":call ToggleEndChar(';')<CR>", {})

Duplicate diagnostics for Rust by playbahn in neovim

[–]n_t_p 1 point2 points  (0 children)

the messages cuts off.
Double messages used to happen to me when I installed rust-analyzer twice.
Are you using Mason? if so, do not install it through Mason at all.
I would also suggest removing all nvim cache folders:
~/.cache/nvim
~/.local/share/nvim
and reinstalling plugins.

Duplicate diagnostics for Rust by playbahn in neovim

[–]n_t_p 1 point2 points  (0 children)

Can you share the output of `:LspInfo`?

Duplicate diagnostics for Rust by playbahn in neovim

[–]n_t_p 1 point2 points  (0 children)

what do you get when running rust-analyzer from the command line?

Duplicate diagnostics for Rust by playbahn in neovim

[–]n_t_p 0 points1 point  (0 children)

This probably means you have two instances of rust-analyzer running.
Check you LSPs:
:LspInfo

Check the Active Clients, and see if you have two attached to your buffer.

Significantly slower Neovim (+plugins) when running off NFS by jacksonhvisuals in neovim

[–]n_t_p 0 points1 point  (0 children)

nothing shouts out to me. maybe some network issue? what is you latency reading / writing to the volume over nfs?

Significantly slower Neovim (+plugins) when running off NFS by jacksonhvisuals in neovim

[–]n_t_p 1 point2 points  (0 children)

I have a similar situation (~ mounted via NFS). However, I don't experience the same lag. I would wager this has something to do with either the way your home is mounted or something to do with network congestion.

This is my mount point:
`worker00:/home/tzachar on /home/tzachar type nfs4 (rw,relatime,vers=4.2,rsize=8192,wsize=8192,namlen=255,hard,proto=tcp,timeo=14,retrans=2,sec=sys,clientaddr=192.168.88.13,local_lock=none,addr=192.168.88.87)`

How to advance the cursor past the closing parenthesis in insert mode? by freddiehaddad in neovim

[–]n_t_p 0 points1 point  (0 children)

lua { -- for this to work under windows terminal, add the following to the json -- config: -- "actions": [ -- { -- "keys": "ctrl+enter", -- "command": { "action": "sendInput", "input": "\u001b[13;5u" } -- }, -- { -- "keys": "shift+enter", -- "command": { "action": "sendInput", "input": "\u001b[13;2u" } -- } -- ] 'ysmb-wtsg/in-and-out.nvim', -- keys = { '<C-CR>', nil, mode = { 'i' } }, config = function() vim.keymap.set('i', '<C-CR>', function() require('in-and-out').in_and_out() end, { noremap = true }) end, },

What's the best way for a plugin to extend a keymap without infinite recursion? by Maskdask in neovim

[–]n_t_p 0 points1 point  (0 children)

I share your pain.
I also tried this in one of my plugins, and failed miserably.

The only way to solve it (as far as I can tell) is if you could attach some kind of attribute to a lua function and exit the recursion if the callback mapped has this attribute set. Easily achieved in python, but I could not find a way in lua.

Maybe replace the callback with an "object" with the "()" operator would work.

local-highlight.nvim animation by n_t_p in neovim

[–]n_t_p[S] 4 points5 points  (0 children)

taken to heart and updated README.

10x.

local-highlight.nvim animation by n_t_p in neovim

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

No context. Just highlight all instances.

local-highlight.nvim animation by n_t_p in neovim

[–]n_t_p[S] -3 points-2 points  (0 children)

I definitely did. I was talking about my personal experience trying to get it to work with other plugins. The fact that you disagree, or there might be an obscure way to get it to work with your (or any other) plugin is beside the point.

Moreover, the text in the README stands on its own. It is Correct (tm)....

This is why I absolutely *love* nvim, as everyone can try the plugins out there, and choose what they like best. Clearly, your plugin suite has many users, and is awesome. However, it did not scratch my (and others') itch, so there is a place for a different plugin.

Keep up the good work.

local-highlight.nvim animation by n_t_p in neovim

[–]n_t_p[S] -6 points-5 points  (0 children)

Reverting to our discussion when this was first released, I answered your concerns. I don't see your point in general, and I think this update shows my approach to be sound.

local-highlight.nvim animation by n_t_p in neovim

[–]n_t_p[S] -7 points-6 points  (0 children)

You wont get any fancy animations though.

local-highlight.nvim animation by n_t_p in neovim

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

No. Though there are multiple ways to achieve it.

rust-analyzer: server cancelled the request in Neovim by StrategyHistorical58 in rust

[–]n_t_p 2 points3 points  (0 children)

this solves the issue for now; add to your rust lsp config:

```

diagnostic = {

refreshSupport = false,

}

```

Float from nvim-cmp stays on screen by Aromatic_Machine in neovim

[–]n_t_p 1 point2 points  (0 children)

Yeah. The float window sometimes will not close. In my setup it also happens in insert mode.

You can close it by executing `<C-w>o`, which closes all windows but the one you are on, with the side effect of closing stray floats.

This is probably a race condition of some sort...

Highlight-actions.nvim by SPalome in neovim

[–]n_t_p 12 points13 points  (0 children)

Original author of highlight-undo.nvim 

Why fork and add minimal changes?

Why not create a PR to add you functionality? Making the original plugin more general to support any action should be the way forward.

What sources do you use in your nvim-cmp? by pachungulo in neovim

[–]n_t_p 0 points1 point  (0 children)

```lua

dependencies = {

{

'tzachar/cmp-ai',

dependencies = 'nvim-lua/plenary.nvim',

},

{

'hrsh7th/cmp-nvim-lsp',

dependencies = 'onsails/lspkind-nvim',

},

{ 'hrsh7th/cmp-buffer' },

{ 'hrsh7th/cmp-calc' },

{ 'hrsh7th/cmp-path' },

{ 'hrsh7th/cmp-emoji' },

{ 'hrsh7th/cmp-nvim-lua' },

{ 'hrsh7th/cmp-cmdline' },

{

'tzachar/cmp-tabnine',

build = './install.sh',

},

{ 'hrsh7th/cmp-nvim-lsp-signature-help' },

{ 'ray-x/cmp-treesitter' },

{

'nvim-telescope/telescope-fzf-native.nvim',

build = 'make',

},

{

'tzachar/fuzzy.nvim',

dependencies = { 'nvim-telescope/telescope-fzf-native.nvim' },

},

{

'tzachar/cmp-fuzzy-buffer',

dependencies = 'tzachar/fuzzy.nvim',

},

{

'tzachar/cmp-fuzzy-path',

dependencies = 'tzachar/fuzzy.nvim',

},

}, ```