From 43af656a9e1325e76c69e6f5e694214156c278f1 Mon Sep 17 00:00:00 2001 From: Marcelo Date: Sun, 30 Mar 2025 04:26:45 -0300 Subject: Replace nvim-lspconfig and blink completion with NVIM 0.11 native options. --- init.lua | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 43b2eb7..c939de3 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ require("config.lazy") require("config.terminal") +require("config.lsp") vim.g.have_nerd_font = true vim.g.loaded_node_provider = 0 @@ -52,7 +53,6 @@ vim.opt.shiftwidth = 2 vim.keymap.set("n", "", "nohlsearch") -vim.keymap.set("n", "s", "wall", { desc = "Save all changed buffers" }) vim.keymap.set("n", "s", function() vim.cmd[[wall]] vim.notify("Changed buffers saved.") @@ -74,18 +74,15 @@ vim.keymap.set("n", "q", "bprevious | bdelete #", { desc = "Clo vim.keymap.set("n", "", "bprevious", { desc = "Previous buffer" }) vim.keymap.set("n", "", "bnext", { desc = "Next buffer" }) -vim.keymap.set("n", "", "silent! update | redraw", { desc = "Save" }) -vim.keymap.set({ "i", "x" }, "", "silent! update | redraw", { desc = "Save and go to Normal mode" }) - vim.keymap.set("n", "-", "Oil", { desc = "Open Oil" }) -- Quickfix and location list navigation. vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") -vim.keymap.set("n", "j", "lprevzz") +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "j", "lnextzz", { desc = "Next location list item" }) +vim.keymap.set("n", "k", "lprevzz", { desc = "Previous location list item" }) vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking text", group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }), @@ -94,9 +91,9 @@ vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking tex end, }) -vim.api.nvim_create_user_command("CopyPath", function() - local path = vim.fn.expand("%:p") - vim.fn.setreg("+", path) - vim.notify("Copied '" .. path .. "' to the clipboard.") -end, { desc = "Copy current buffer file path to the clipboard." }) -vim.keymap.set("n", "", "CopyPath") +vim.keymap.set("n", "", function() + local path = vim.fn.expand("%:~:.") + local line = vim.fn.line(".") + vim.fn.setreg("+", path .. ":" .. line) + vim.notify("Copied '" .. path .. "' line " .. line .. " to the clipboard.") +end, { desc = 'Copy relative file path with current line number to clipboard.' }) -- cgit v1.2.3