fix astronvim config

This commit is contained in:
Max Känner 2023-10-19 12:12:15 +02:00
parent 676368ec87
commit 27e75a92ae
8 changed files with 104 additions and 118 deletions

View File

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

View File

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

View File

@ -1,9 +0,0 @@
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

104
lua/user/init.lua Normal file
View File

@ -0,0 +1,104 @@
local config = {
options = {
opt = {
colorcolumn = "80,120",
},
g = {
inlay_hints_enabled = true,
},
},
lsp = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = {
buildScripts = { enable = true },
},
procMacrto = { enable = true },
check = {
command = "clippy",
overrideCommand = "clippy --message-format=json",
},
},
},
},
},
},
-- Add plugins
plugins = {
-- Extended file type support
{ "sheerun/vim-polyglot", lazy = false },
-- Community plugins
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.angular" },
{ import = "astrocommunity.pack.ansible" },
{ import = "astrocommunity.pack.astro" },
{ import = "astrocommunity.pack.bash" },
{ import = "astrocommunity.pack.clojure" },
{ import = "astrocommunity.pack.cmake" },
{ import = "astrocommunity.pack.cpp" },
{ import = "astrocommunity.pack.cs" },
{ import = "astrocommunity.pack.cue" },
{ import = "astrocommunity.pack.dart" },
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.edgedb" },
{ import = "astrocommunity.pack.full-dadbod" },
{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.pack.godot" },
{ import = "astrocommunity.pack.haskell" },
{ import = "astrocommunity.pack.haxe" },
{ import = "astrocommunity.pack.helm" },
{ import = "astrocommunity.pack.html-css" },
{ import = "astrocommunity.pack.java" },
{ import = "astrocommunity.pack.json" },
{ import = "astrocommunity.pack.julia" },
{ import = "astrocommunity.pack.kotlin" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.nix" },
{ import = "astrocommunity.pack.php" },
{ import = "astrocommunity.pack.prisma" },
{ import = "astrocommunity.pack.proto" },
{ import = "astrocommunity.pack.ps1" },
{ import = "astrocommunity.pack.python" },
{ import = "astrocommunity.pack.quarto" },
{ import = "astrocommunity.pack.ruby" },
{ import = "astrocommunity.pack.rust" },
{ import = "astrocommunity.pack.scala" },
{ import = "astrocommunity.pack.svelte" },
{ import = "astrocommunity.pack.tailwindcss" },
{ import = "astrocommunity.pack.terraform" },
{ import = "astrocommunity.pack.toml" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.pack.vue" },
{ import = "astrocommunity.pack.wgsl" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.pack.zig" },
{ import = "astrocommunity.diagnostics.trouble-nvim" },
{ import = "astrocommunity.git.git-blame-nvim" },
-- use moden inlay hints:
{
"p00f/clangd_extensions.nvim",
optional = true,
opts = { extensions = { autoSetHints = true } },
},
{
"simrat39/rust-tools.nvim",
optional = true,
opts = {
tools = {
inlay_hints = { auto = true },
},
},
},
},
}
return config

View File

@ -1,26 +0,0 @@
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,
}
}

View File

@ -1,49 +0,0 @@
require("rust-tools").setup({
tools = {
inlay_hints = {
auto = true
}
},
server = {
checkOnSave = {
command = "clippy",
extraArgs = {
"--",
"-W", "clippy::pedantic",
"-W", "clippy::nursery",
"-W", "clippy::unwrap_used",
"-W", "clippy::expect_used",
},
},
},
})
return {
["simrat39/rust-tools.nvim"] = {
after = { "mason-lspconfig.nvim" },
config = function()
require("rust-tools").setup({
tools = {
inlay_hints = {
auto = true
}
},
server = {
checkOnSave = {
command = "clippy",
extraArgs = {
"--",
"-W", "clippy::pedantic",
"-W", "clippy::nursery",
"-W", "clippy::unwrap_used",
"-W", "clippy::expect_used",
},
},
},
})
end,
},
["lvimuser/lsp-inlayhints.nvim"] = {
module = "lsp-inlayhints",
config = function() require "user.plugins.lsp-inlayhints" end,
},
}

View File

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

View File

@ -1,12 +0,0 @@
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,
}