From 7c0f9e6cca21433bdb0980c9eccb8364c5d944a7 Mon Sep 17 00:00:00 2001 From: Zam Kokott Date: Wed, 12 Nov 2025 11:15:38 +0000 Subject: [PATCH] Add autoclose, tabout nvim autocomplete and Format on save --- lazy-lock.json | 29 +++++++++++++++++++++++++++++ lua/plugins/autoclose.lua | 6 ++++++ lua/plugins/lsp-config.lua | 29 +++++++++++++++++++++++++++-- lua/plugins/tabout.lua | 11 +++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/plugins/autoclose.lua create mode 100644 lua/plugins/tabout.lua diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..7e03cb5 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,29 @@ +{ + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" }, + "catppuccin": { "branch": "main", "commit": "234fc048de931a0e42ebcad675bf6559d75e23df" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, + "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, + "none-ls.nvim": { "branch": "main", "commit": "550197530c12b4838d685cf4e0d5eb4cca8d52c7" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, + "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "tabout.nvim": { "branch": "master", "commit": "9a3499480a8e53dcaa665e2836f287e3b7764009" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "08e65d82d48416ab140b3dea26eea4fb9739bc47" } +} diff --git a/lua/plugins/autoclose.lua b/lua/plugins/autoclose.lua new file mode 100644 index 0000000..cd9e6ce --- /dev/null +++ b/lua/plugins/autoclose.lua @@ -0,0 +1,6 @@ +return { + 'm4xshen/autoclose.nvim', + config = function() + require('autoclose').setup() + end +} diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua index 9b7b019..7404665 100644 --- a/lua/plugins/lsp-config.lua +++ b/lua/plugins/lsp-config.lua @@ -1,8 +1,19 @@ return { "neovim/nvim-lspconfig", dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", + "mason-org/mason.nvim", + "mason-org/mason-lspconfig.nvim", + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, }, config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() @@ -42,5 +53,19 @@ return { } }) + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp", { clear = true }), + callback = function(args) + -- 2 + vim.api.nvim_create_autocmd("BufWritePre", { + -- 3 + buffer = args.buf, + callback = function() + -- 4 + 5 + vim.lsp.buf.format { async = false, id = args.data.client_id } + end, + }) + end + }) end, } diff --git a/lua/plugins/tabout.lua b/lua/plugins/tabout.lua new file mode 100644 index 0000000..7a1c6d2 --- /dev/null +++ b/lua/plugins/tabout.lua @@ -0,0 +1,11 @@ +return { + { + 'abecodes/tabout.nvim', + lazy = false, + config = function() + require('tabout').setup { + tabkey = '' + } + end + } +}