Created
October 15, 2023 23:03
-
-
Save matheusxreis/5848062a65f2a4bb2bde12cf651cec3d to your computer and use it in GitHub Desktop.
config lsp rust in nvim with nvchad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.config/nvim/lua/custom/chadrc.lua | |
---@type ChadrcConfig | |
local M = {} | |
M.ui = { theme = 'jellybeans' } | |
M.plugins = 'custom.plugins' | |
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.config/nvim/lua/custom/configs/lspconfig.lua | |
local on_attach = require("plugins.configs.lspconfig").on_attach | |
local capabilites = require("plugins.configs.lspconfig").capabilities | |
local lspconfig = require("lspconfig") | |
lspconfig.rust_analyzer.setup({ | |
on_attach = on_attach, | |
capabilities = capabilites, | |
filetypes = {"rust"}, | |
root_dir = lspconfig.util.root_pattern("Cargo.toml"), | |
settings = { | |
['rust-analyzer'] = { | |
cargo = { | |
allFeatures = true | |
} | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.config/nvim/lua/custom/plugins.lua | |
local plugins = { | |
{ | |
"neovim/nvim-lspconfig", | |
config = function() | |
require "plugins.configs.lspconfig" | |
require "custom.configs.lspconfig" | |
end, | |
} | |
} | |
return plugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment