From 778529316ecc5c905361a68ecd6cc828d8d09fda Mon Sep 17 00:00:00 2001 From: voidarclabs Date: Sat, 3 May 2025 12:33:11 +0100 Subject: [PATCH] Minor Tweaks --- init.lua | 1 + lazy-lock.json | 16 ++++++++-------- lua/plugins/correction.lua | 28 ++++++++++++++++++++++------ lua/plugins/treesitter.lua | 12 ++++++++++++ 4 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 lua/plugins/treesitter.lua diff --git a/init.lua b/init.lua index 935a717..65ea03f 100644 --- a/init.lua +++ b/init.lua @@ -22,3 +22,4 @@ vim.keymap.set("n", "", "JABSOpen") vim.keymap.set("n", "", "") vim.keymap.set("n", "", "FloatermNew lazygit") +vim.keymap.set("n", "", "FloatermKill") diff --git a/lazy-lock.json b/lazy-lock.json index a4b5562..d647e77 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,24 +1,24 @@ { "JABS.nvim": { "branch": "main", "commit": "b6dbd1a3e1b8cef3d6ebfafe96c2230ca341b65f" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, + "catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" }, - "fzf-lua": { "branch": "main", "commit": "f3123a4ca3745c05be70bc8b0b1de227f6799fb7" }, + "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, + "fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lint": { "branch": "master", "commit": "3615c26c4922ae5f7366f0c1943a0e7cece04325" }, - "nvim-lspconfig": { "branch": "master", "commit": "1a3a429efec62af632dfd8fa9b52fa226f655ec2" }, - "nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" }, - "simplyfile.nvim": { "branch": "main", "commit": "c4dfc0f3431898c3abbef267b226f6cdd2a67b38" }, + "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, + "nvim-lspconfig": { "branch": "master", "commit": "12506bdaccd94964d4fb40367e36ade1960c8947" }, + "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" }, + "nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "tint.nvim": { "branch": "master", "commit": "586e87f00c8b0f5e857cefe10839e41f3e8c6d01" }, - "vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" } + "vim-floaterm": { "branch": "master", "commit": "204a01a3868cbe4549640dca857fb3880ee92b17" } } diff --git a/lua/plugins/correction.lua b/lua/plugins/correction.lua index 4ddd541..35e43c5 100644 --- a/lua/plugins/correction.lua +++ b/lua/plugins/correction.lua @@ -9,7 +9,7 @@ return { config = function() require("mason").setup() require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "pyright", "rust_analyzer" }, -- Add your desired LSPs + ensure_installed = { "lua_ls", "pyright", "rust_analyzer", "eslint" }, -- Add your desired LSPs automatic_installation = true, }) @@ -17,6 +17,26 @@ return { lspconfig.lua_ls.setup({}) lspconfig.pyright.setup({}) lspconfig.rust_analyzer.setup({}) + lspconfig.eslint.setup({ + capabilities = require("cmp_nvim_lsp").default_capabilities(), + on_attach = function(client, bufnr) + -- Enable ESLint diagnostics on file save + client.resolved_capabilities.document_formatting = true + -- If you're using eslint with filetype handling + vim.cmd([[autocmd BufWritePre EslintFixAll]]) + end, + }) + lspconfig.emmet_ls.setup({ + capabilities = require("cmp_nvim_lsp").default_capabilities(), + filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, -- Add more if needed + init_options = { + html = { + options = { + ["bem.enabled"] = true, + }, + }, + }, + }) end, }, @@ -63,7 +83,7 @@ return { [""] = cmp.mapping.confirm({ select = true }), -- Confirm selection with Enter }), sources = cmp.config.sources({ - { name = "nvim_lsp" }, + { name = "nvim_lsp" }, -- This should provide LSP completions like for ESLint { name = "luasnip" }, { name = "buffer" }, { name = "path" }, @@ -80,15 +100,11 @@ return { -- Explicitly define linters for each file type (without ast_grep) lint.linters_by_ft = { - lua = { "luacheck" }, -- Use "luacheck" instead of "ast_grep" python = { "flake8" }, javascript = { "eslint" }, typescript = { "eslint" }, } - -- Check if ast_grep is accidentally registered and remove it - lint.linters.ast_grep = nil - -- Auto-run the linter only for the configured filetypes vim.api.nvim_create_autocmd("BufWritePost", { pattern = "!*.lua", diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..9bffa3d --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,12 @@ +return { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "javascript", "lua", "python", "html", "css", "typescript", "rust" }, -- Add JavaScript here + highlight = { + enable = true, -- Enable syntax highlighting + }, + }) + end, +}