init nvchad, mostly rust
This commit is contained in:
commit
008b353e29
5
chadrc.lua
Normal file
5
chadrc.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
M.ui = {theme = 'catppuccin'}
|
||||||
|
M.plugins = 'custom.plugins'
|
||||||
|
return M
|
20
configs/lspconfig.lua
Normal file
20
configs/lspconfig.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||||
|
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
local util = require "lspconfig/util"
|
||||||
|
|
||||||
|
--[[
|
||||||
|
lspconfig.rust_analyzer.setup({
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = {"rust"},
|
||||||
|
root_dir = util.root_pattern("Cargo.toml"),
|
||||||
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
]]--
|
11
configs/rust-tools.lua
Normal file
11
configs/rust-tools.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
local on_attach = require("plugins.configs.lspconfig").on_attach()
|
||||||
|
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
server = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
14
mappings.lua
Normal file
14
mappings.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.crates = {
|
||||||
|
n = {
|
||||||
|
["<leader>rcu"] = {
|
||||||
|
function ()
|
||||||
|
require('crates').upgrade_all_crates()
|
||||||
|
end,
|
||||||
|
"update crates"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
72
plugins.lua
Normal file
72
plugins.lua
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
local plugins = {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"rust-analyzer",
|
||||||
|
"gopls",
|
||||||
|
"python-lsp-server",
|
||||||
|
"ruby-lsp",
|
||||||
|
"shellcheck",
|
||||||
|
"yaml-language-server",
|
||||||
|
"yamlfix",
|
||||||
|
"yamlfmt",
|
||||||
|
"yamllint",
|
||||||
|
"json-lsp",
|
||||||
|
"json-to-struct",
|
||||||
|
"jsonlint",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require "plugins.configs.lspconfig"
|
||||||
|
require "custom.configs.lspconfig"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rust-lang/rust.vim",
|
||||||
|
ft = "rust",
|
||||||
|
init = function ()
|
||||||
|
vim.g.rustfmt_autosave = 1
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
|
rf = "rust",
|
||||||
|
dependancies = "neovim/nvim-lspconfig",
|
||||||
|
opts = function ()
|
||||||
|
return require "custom.configs.rust-tools"
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
require('rust-tools').setup(opts)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
rf = "rust",
|
||||||
|
config = function()
|
||||||
|
require('nvim-dap').setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"saecki/crates.nvim",
|
||||||
|
ft = {"rust", "toml"},
|
||||||
|
config = function(_, opts)
|
||||||
|
local crates = require("crates")
|
||||||
|
crates.setup(opts)
|
||||||
|
crates.show()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
opts = function()
|
||||||
|
local M = require "plugins.configs.cmp"
|
||||||
|
table.insert(M.sources, {name = "crates"})
|
||||||
|
return M
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return plugins
|
Loading…
x
Reference in New Issue
Block a user