diff options
| author | Marcelo <setanta@gmail.com> | 2025-03-30 04:26:45 -0300 |
|---|---|---|
| committer | Marcelo <setanta@gmail.com> | 2025-04-04 00:10:23 -0300 |
| commit | 43af656a9e1325e76c69e6f5e694214156c278f1 (patch) | |
| tree | 9c44dbd5842107b662bd5795d238ace98677e648 /init.lua | |
| parent | 7eec86e74ffb085d48da574b02af12bce3f73d93 (diff) | |
Replace nvim-lspconfig and blink completion with NVIM 0.11 native options.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -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", "<ESC>", "<CMD>nohlsearch<CR>") -vim.keymap.set("n", "<Leader>s", "<CMD>wall<CR>", { desc = "Save all changed buffers" }) vim.keymap.set("n", "<Leader>s", function() vim.cmd[[wall]] vim.notify("Changed buffers saved.") @@ -74,18 +74,15 @@ vim.keymap.set("n", "<Leader>q", "<CMD>bprevious | bdelete #<CR>", { desc = "Clo vim.keymap.set("n", "<A-p>", "<CMD>bprevious<CR>", { desc = "Previous buffer" }) vim.keymap.set("n", "<A-n>", "<CMD>bnext<CR>", { desc = "Next buffer" }) -vim.keymap.set("n", "<C-s>", "<CMD>silent! update | redraw<CR>", { desc = "Save" }) -vim.keymap.set({ "i", "x" }, "<C-s>", "<ESC><CMD>silent! update | redraw<CR>", { desc = "Save and go to Normal mode" }) - vim.keymap.set("n", "<Leader>-", "<CMD>Oil<CR>", { desc = "Open Oil" }) -- Quickfix and location list navigation. vim.keymap.set("n", "<C-d>", "<C-d>zz") vim.keymap.set("n", "<C-u>", "<C-u>zz") -vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") -vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") -vim.keymap.set("n", "<Leader>k", "<CMD>lnext<CR>zz") -vim.keymap.set("n", "<Leader>j", "<CMD>lprev<CR>zz") +vim.keymap.set("n", "<C-j>", "<cmd>cnext<CR>zz") +vim.keymap.set("n", "<C-k>", "<cmd>cprev<CR>zz") +vim.keymap.set("n", "<Leader>j", "<CMD>lnext<CR>zz", { desc = "Next location list item" }) +vim.keymap.set("n", "<Leader>k", "<CMD>lprev<CR>zz", { 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", "<C-c>", "<CMD>CopyPath<CR>") +vim.keymap.set("n", "<C-c>", 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.' }) |
