copy nvim config from work dotfiles

This commit is contained in:
Benjamin Palko 2024-04-15 00:53:01 +00:00
parent ce36d27f1c
commit 7f38ef3f32
33 changed files with 389 additions and 1879 deletions

View file

@ -0,0 +1,20 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
javascript = { "prettier" },
typescript = { "prettier" },
sh = { "shfmt" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
require("conform").setup(options)

47
nvim/lua/configs/lazy.lua Normal file
View file

@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View file

@ -0,0 +1,79 @@
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = {
-- bash
"bashls",
-- webdev
"html",
"cssls",
"cssmodules_ls",
"tailwindcss",
"eslint",
"graphql",
-- go
"gopls",
-- python
"pylsp",
-- config
"jsonls",
"yamlls",
-- docker
"dockerls",
"docker_compose_language_service",
-- markdown
"marksman",
-- sql
"sqls",
}
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
-- lspconfig.tsserver.setup {
-- on_attach = on_attach,
-- on_init = on_init,
-- capabilities = capabilities,
-- }
lspconfig.jsonls.setup {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
validate = { enable = true },
},
},
}
lspconfig.yamlls.setup {
settings = {
yaml = {
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.
enable = false,
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
url = "",
},
schemas = require('schemastore').yaml.schemas(),
},
},
}