mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-06 13:06:35 +05:30
update nvim config
This commit is contained in:
@ -16,6 +16,12 @@ local options = {
|
||||
markdown = { prettier },
|
||||
nix = { "alejandra" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
|
@ -1,32 +1,36 @@
|
||||
local configs = require "plugins.configs.lspconfig"
|
||||
local configs = require("plugins.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
-- local util = require "lspconfig/util"
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
title = "",
|
||||
}
|
||||
vim.lsp.buf.execute_command(params)
|
||||
end
|
||||
|
||||
-- lspconfig.gopls.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { "gopls" },
|
||||
-- filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
-- root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- completeUnimported = true,
|
||||
-- usePlaceholders = true,
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
for _, lsp in ipairs(servers) do
|
||||
if lsp == "tsserver" then
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
commands = {
|
||||
OrganizeImports = {
|
||||
organize_imports,
|
||||
description = "Organize Imports",
|
||||
},
|
||||
},
|
||||
})
|
||||
else
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
21
pkgs/nvchad/custom/configs/nvim-lint.lua
Normal file
21
pkgs/nvchad/custom/configs/nvim-lint.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- Doesn't work
|
||||
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
lua = { "luacheck" },
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { { "eslint_d" } },
|
||||
nix = { "statix" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
@ -23,12 +23,14 @@ M.mason = {
|
||||
-- defaults
|
||||
"lua-language-server",
|
||||
"stylua",
|
||||
"luacheck",
|
||||
|
||||
-- web dev
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"prettierd",
|
||||
"eslint-lsp",
|
||||
"eslint_d",
|
||||
"typescript-language-server",
|
||||
"tailwindcss-language-server",
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
local overrides = require "custom.configs.overrides"
|
||||
local overrides = require("custom.configs.overrides")
|
||||
|
||||
local plugins = {
|
||||
{
|
||||
@ -13,6 +13,22 @@ local plugins = {
|
||||
"NvChad/nvterm",
|
||||
opts = overrides.nvterm,
|
||||
},
|
||||
-- Need to setup properly
|
||||
-- {
|
||||
-- "stevearc/conform.nvim",
|
||||
-- event = "BufWritePre",
|
||||
-- config = function()
|
||||
-- require("custom.configs.conform")
|
||||
-- end,
|
||||
-- },
|
||||
-- {
|
||||
-- "mfussenegger/nvim-lint",
|
||||
-- lazy = true,
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- config = function()
|
||||
-- require("custom.configs.nvim-lint")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"Shatur/neovim-session-manager",
|
||||
dependencies = {
|
||||
@ -30,21 +46,21 @@ local plugins = {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
opts = function()
|
||||
return require "custom.configs.noice"
|
||||
return require("custom.configs.noice")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
require("plugins.configs.lspconfig")
|
||||
require("custom.configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return require "custom.configs.null-ls"
|
||||
return require("custom.configs.null-ls")
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user