Minor Tweaks
This commit is contained in:
1
init.lua
1
init.lua
@@ -22,3 +22,4 @@ vim.keymap.set("n", "<C-p>", "<cmd>JABSOpen<CR>")
|
|||||||
|
|
||||||
vim.keymap.set("n", "<M-w>", "<C-w>")
|
vim.keymap.set("n", "<M-w>", "<C-w>")
|
||||||
vim.keymap.set("n", "<C-k>", "<cmd>FloatermNew lazygit<CR>")
|
vim.keymap.set("n", "<C-k>", "<cmd>FloatermNew lazygit<CR>")
|
||||||
|
vim.keymap.set("n", "<C-h>", "<cmd>FloatermKill<CR>")
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"JABS.nvim": { "branch": "main", "commit": "b6dbd1a3e1b8cef3d6ebfafe96c2230ca341b65f" },
|
"JABS.nvim": { "branch": "main", "commit": "b6dbd1a3e1b8cef3d6ebfafe96c2230ca341b65f" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
"catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" },
|
"conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "f3123a4ca3745c05be70bc8b0b1de227f6799fb7" },
|
"fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "3615c26c4922ae5f7366f0c1943a0e7cece04325" },
|
"nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "1a3a429efec62af632dfd8fa9b52fa226f655ec2" },
|
"nvim-lspconfig": { "branch": "master", "commit": "12506bdaccd94964d4fb40367e36ade1960c8947" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" },
|
"nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" },
|
||||||
"simplyfile.nvim": { "branch": "main", "commit": "c4dfc0f3431898c3abbef267b226f6cdd2a67b38" },
|
"nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||||
"tint.nvim": { "branch": "master", "commit": "586e87f00c8b0f5e857cefe10839e41f3e8c6d01" },
|
"tint.nvim": { "branch": "master", "commit": "586e87f00c8b0f5e857cefe10839e41f3e8c6d01" },
|
||||||
"vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" }
|
"vim-floaterm": { "branch": "master", "commit": "204a01a3868cbe4549640dca857fb3880ee92b17" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").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,
|
automatic_installation = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -17,6 +17,26 @@ return {
|
|||||||
lspconfig.lua_ls.setup({})
|
lspconfig.lua_ls.setup({})
|
||||||
lspconfig.pyright.setup({})
|
lspconfig.pyright.setup({})
|
||||||
lspconfig.rust_analyzer.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 <buffer> 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,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -63,7 +83,7 @@ return {
|
|||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Confirm selection with Enter
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Confirm selection with Enter
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" }, -- This should provide LSP completions like for ESLint
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
@@ -80,15 +100,11 @@ return {
|
|||||||
|
|
||||||
-- Explicitly define linters for each file type (without ast_grep)
|
-- Explicitly define linters for each file type (without ast_grep)
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
lua = { "luacheck" }, -- Use "luacheck" instead of "ast_grep"
|
|
||||||
python = { "flake8" },
|
python = { "flake8" },
|
||||||
javascript = { "eslint" },
|
javascript = { "eslint" },
|
||||||
typescript = { "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
|
-- Auto-run the linter only for the configured filetypes
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
pattern = "!*.lua",
|
pattern = "!*.lua",
|
||||||
|
|||||||
12
lua/plugins/treesitter.lua
Normal file
12
lua/plugins/treesitter.lua
Normal file
@@ -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,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user