mirror of
https://github.com/eRgo35/dots.git
synced 2025-12-18 08:26:11 +01:00
nvim dots, plus minor mods
This commit is contained in:
25
nvim/.config/nvim/lua/custom/configs/conform.lua
Normal file
25
nvim/.config/nvim/lua/custom/configs/conform.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
--type conform.options
|
||||
local options = {
|
||||
lsp_fallback = true,
|
||||
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
|
||||
javascript = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
|
||||
sh = { "shfmt" },
|
||||
},
|
||||
|
||||
-- adding same formatter for multiple filetypes can look too much work for some
|
||||
-- instead of the above code you could just use a loop! the config is just a table after all!
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
31
nvim/.config/nvim/lua/custom/configs/lspconfig.lua
Normal file
31
nvim/.config/nvim/lua/custom/configs/lspconfig.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
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"
|
||||
|
||||
-- if you just want default config for the servers then put them in a table
|
||||
local servers = { "html", "cssls", "tsserver", "clangd" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
--
|
||||
-- lspconfig.pyright.setup { blabla}
|
||||
59
nvim/.config/nvim/lua/custom/configs/overrides.lua
Normal file
59
nvim/.config/nvim/lua/custom/configs/overrides.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
local M = {}
|
||||
|
||||
M.treesitter = {
|
||||
ensure_installed = {
|
||||
"vim",
|
||||
"lua",
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"c",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
-- disable = {
|
||||
-- "python"
|
||||
-- },
|
||||
},
|
||||
}
|
||||
|
||||
M.mason = {
|
||||
ensure_installed = {
|
||||
-- lua stuff
|
||||
"lua-language-server",
|
||||
"stylua",
|
||||
|
||||
-- web dev stuff
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"typescript-language-server",
|
||||
"deno",
|
||||
"prettier",
|
||||
|
||||
-- c/cpp stuff
|
||||
"clangd",
|
||||
"clang-format",
|
||||
},
|
||||
}
|
||||
|
||||
-- git support in nvimtree
|
||||
M.nvimtree = {
|
||||
git = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
renderer = {
|
||||
highlight_git = true,
|
||||
icons = {
|
||||
show = {
|
||||
git = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user