Skip to content

How to prevent starting two instances of rust-analyzer with mason (LunarVim)? #174

Answered by Logarithmus
Logarithmus asked this question in Q&A
Discussion options

You must be logged in to vote

Finally, after wasting several hours on this, as a person who isn't familiar enough with lua or LunarVim internals, I came up with the solution! My problem was finding out how to apply LunarVim's LSP keymaps to rustaceanvim. Huge thanks to this person's config!

  1. Add this line into ~/.config/lvim/config.lua:
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer" })
  1. Your rustaceanvim entry in lvim.plugins should look like this:
{
  "mrcjkb/rustaceanvim",
  version = "^3",
  ft = { "rust" },
  config = function()
    vim.g.rustaceanvim = {
      server = {
        on_attach = require("lvim.lsp").common_on_attach
      },
    }
  end,
}

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@Logarithmus
Comment options

Answer selected by Logarithmus
@TheBearodactyl
Comment options

@mrcjkb
Comment options

@utensil
Comment options

@mrcjkb
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
5 participants
Converted from issue

This discussion was converted from issue #173 on January 20, 2024 19:29.