From d8f42809ea51ff14a6c6a714df2da2023a788626 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Mon, 3 Nov 2025 23:25:40 +0100 Subject: [PATCH 1/3] feat: disable lsp format command. --- lua/config/keybindings.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/config/keybindings.lua b/lua/config/keybindings.lua index 69cf573..fffaa86 100644 --- a/lua/config/keybindings.lua +++ b/lua/config/keybindings.lua @@ -5,8 +5,8 @@ vim.g.maplocalleader = ";" -- source current file vim.keymap.set("n", " ", ":update :source", { desc = "Source current lua file" }) --- format -vim.keymap.set("n", "lf", vim.lsp.buf.format, { desc = "Format buffer with available lsp" }) +-- -- format +-- vim.keymap.set("n", "lf", vim.lsp.buf.format, { desc = "Format buffer with available lsp" }) -- easy copy/cut/paste from system clipboard vim.keymap.set({ "n", "v", "x" }, "y", '"+y', { desc = "Yank to system clipboard" }) From 3cc82f09dde170656fadb5219f0a5b86c5d96110 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Mon, 3 Nov 2025 23:31:54 +0100 Subject: [PATCH 2/3] feat: conform.nvim for better formatting. --- lua/plugins/conform.lua | 17 +++++++++++++++++ lua/plugins/init.lua | 1 + nvim-pack-lock.json | 4 ++++ 3 files changed, 22 insertions(+) create mode 100644 lua/plugins/conform.lua diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..be4fe0d --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,17 @@ +vim.pack.add({ + {src = "https://github.com/stevearc/conform.nvim"}, +}) + +vim.api.nvim_create_user_command("Format", function(args) + local range = nil + if args.count ~= -1 then + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] + range = { + start = { args.line1, 0 }, + ["end"] = { args.line2, end_line:len() }, + } + end + require("conform").format({ async = true, lsp_format = "fallback", range = range }) +end, { range = true }) + +vim.keymap.set("n", "lf", ":Format", { desc = "Format buffer with available lsp" }) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 22ace95..c9dd8b6 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -3,3 +3,4 @@ require("plugins.treesitter") require("plugins.lsp") require("plugins.mini") require("plugins.markdown") +require("plugins.conform") diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index fbddbc6..f78e0bc 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -1,5 +1,9 @@ { "plugins": { + "conform.nvim": { + "rev": "26c02e1", + "src": "https://github.com/stevearc/conform.nvim" + }, "gruvbox.nvim": { "rev": "5e0a460", "src": "https://github.com/ellisonleao/gruvbox.nvim" From aa8ac561c5bb22828d060541f0450a96e6ead243 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Mon, 3 Nov 2025 23:32:05 +0100 Subject: [PATCH 3/3] feat: some more lsp's. --- lua/plugins/lsp.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index d485b2d..562856b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -21,8 +21,12 @@ vim.lsp.enable({ "nixd", "lua_ls", "jsonls", + "html", "marksman", "gopls", + "ruff", + "basedpyright", + "yamlls", }) -- diagnostic settings