From 6d19eed7f009045731d161bdd9eb83e40852c36f Mon Sep 17 00:00:00 2001 From: SL1900 Date: Mon, 22 Dec 2025 16:26:17 +0900 Subject: [PATCH] Cleanup: remap.lua --- remap.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/remap.lua b/remap.lua index e0eb20a..e090ed4 100644 --- a/remap.lua +++ b/remap.lua @@ -10,8 +10,6 @@ if package.config:sub(1, 1) == "\\" then vim.keymap.set("n", "oce", function() local path = vim.api.nvim_buf_get_name(0) local dir = path:sub(1, path:find('\\[^\\]*$')) - -- vim.cmd(":!echo " .. "(path:sub(1, path:find('\\[^\\]*$')))" .. "") - -- print("Check "..dir) os.execute("explorer " .. dir) end, { desc = "[O]pen [C]urrent buffer [Explorer]" }) end @@ -78,17 +76,9 @@ vim.api.nvim_create_autocmd("TextYankPost", { end }) ---ToggleTerm --- vim.keymap.set("n", "", ":execute v:count1 . \"ToggleTerm\"") +-- Esc to exit to normal mode in terminal vim.keymap.set("t", "", "") ---Trouble --- local trouble = require("trouble") --- vim.keymap.set("n", "xx", function() trouble.toggle("workspace_diagnostics") end, { desc = "Toggle Trouble" }) --- vim.keymap.set("n", "xq", function() trouble.toggle("quickfix") end, { desc = "Toggle [Q]uickfix list" }) --- vim.keymap.set("n", "xl", function() trouble.toggle("loclist") end, { desc = "Toggle [L]oc list" }) --- - vim.keymap.set("n", "to", ":tabnew", { desc = "[T]ab [O]pen" }) vim.keymap.set("n", "tc", ":tabclose", { desc = "[T]ab [C]lose" }) @@ -104,7 +94,7 @@ vim.api.nvim_create_autocmd("FileType", { group = qf_group }) -function IsLocListOpen() +function IsLocationListOpen() for _, wininfo in ipairs(vim.fn.getwininfo()) do if wininfo.loclist == true and wininfo.tabnr == vim.fn.tabpagenr() then return true @@ -113,7 +103,7 @@ function IsLocListOpen() return false end -function AddLocListEntry() +function AddLocationListEntry() local new_entry = { filename = vim.fn.expand("%:p"), lnum = vim.fn.line("."), @@ -122,10 +112,10 @@ function AddLocListEntry() type = "I", } vim.fn.setloclist(0, { new_entry }, "a") - if not IsLocListOpen() then + if not IsLocationListOpen() then vim.cmd("lopen") vim.cmd.wincmd("p") end end -vim.keymap.set("n", "la", AddLocListEntry, { desc = "[L]ocation list [a]ppend current line" }) +vim.keymap.set("n", "la", AddLocationListEntry, { desc = "[L]ocation list [a]ppend current line" })