Initial config

This commit is contained in:
Max Känner 2023-02-23 23:25:59 +01:00
parent 67d296e0eb
commit d97c6f1c2c
7 changed files with 87 additions and 0 deletions

9
lsp/on_attach.lua Normal file
View File

@ -0,0 +1,9 @@
return function(client, bufnr)
if client.server_capabilities.inlayHintProvider then
local inlayhints_avail, inlayhints = pcall(require, "lsp-inlayhints")
if inlayhints_avail then
inlayhints.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>uH", function() inlayhints.toggle() end, { desc = "Toggle inlay hints" })
end
end
end

View File

@ -0,0 +1,5 @@
return {
capabilities = {
offsetEncoding = "utf-8",
},
}

View File

@ -0,0 +1,15 @@
return {
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy",
extraArgs = {
"--all-features",
"--",
"-W", "clippy::pedantic",
"-W", "clippy::nursery",
},
},
},
},
}

26
options.lua Normal file
View File

@ -0,0 +1,26 @@
return {
opt = {
relativenumber = true,
number = true,
spell = true,
signcolumn = "auto",
wrap = true,
conceallevel = 2,
foldenable = false,
foldexpr = "nvim_treesitter#foldexpr()",
foldmethod = "expr",
linebreak = true,
list = true,
listchars = { tab = "", extends = "", precedes = "", trail = "·", eol = "󱞥" },
showbreak = "󱞪 ",
},
g = {
mapleader = " ",
autoformat_enabled = true,
cmp_enabled = true,
autopairs_enabled = true,
diagnostics_enabled = true,
status_diagnostics_enabled = true,
icons_enabled = true,
}
}

19
plugins/init.lua Normal file
View File

@ -0,0 +1,19 @@
return {
["simrat39/rust-tools.nvim"] = {
after = {"mason-lspconfig.nvim"},
config = function()
require("rust-tools").setup({
tools = {
inlay_hints = {
auto = false
}
},
server = astronvim.lsp.server_settings "rust_analyzer",
})
end,
},
["lvimuser/lsp-inlayhints.nvim"] = {
module = "lsp-inlayhints",
config = function() require "user.plugins.lsp-inlayhints" end,
},
}

View File

@ -0,0 +1 @@
require("lsp-inlayhints").setup()

12
updater.lua Normal file
View File

@ -0,0 +1,12 @@
return {
remote = "origin",
channel = "stable",
version = "latest",
branch = "main",
commit = nil,
pin_plugins = nil,
skip_prompts = false,
show_changelog = true,
auto_reload = true,
auto_quit = true,
}