Fixed MacOS shortcut

pull/128/head
flin16 2025-05-25 17:39:08 -05:00
parent a08d4386fc
commit daac5007d3
3 changed files with 23 additions and 21 deletions

View File

@ -21,6 +21,7 @@
"mini.ai": { "branch": "main", "commit": "b91997d220086e92edc1fec5ce82094dcc234291" },
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
"mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" },
"molokai": { "branch": "master", "commit": "c67bdfcdb31415aa0ade7f8c003261700a885476" },
"neotest": { "branch": "master", "commit": "ef492755730e59e1d8122c461abbd086bee4c76b" },
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },

View File

@ -1,6 +1,7 @@
{
"extras": [
"lazyvim.plugins.extras.ai.copilot",
"lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.coding.yanky",
"lazyvim.plugins.extras.editor.refactoring",
"lazyvim.plugins.extras.lang.markdown",

View File

@ -10,8 +10,10 @@ end
local function map_all_mode(lhs, rhs, opts)
map_nv(lhs, rhs, opts)
vim.keymap.set("i", lhs, rhs, opts)
vim.keymap.set("t", lhs, rhs, opts)
end
map_nv("<BS>", '"_d', { desc = "Delete selection with Del" })
-- TODO: make this work
vim.keymap.set("v", "<BS>", '"_d', { noremap = true, desc = "Delete selection with Backspace" })
map_all_mode("<F5>", function()
require("dap").continue()
end, { desc = "DAP: Continue" })
@ -31,23 +33,21 @@ vim.keymap.set("n", "\\b", function()
require("dap").toggle_breakpoint()
end, { desc = "DAP: Toggle Breakpoint" })
--Git settings
-- vim.keymap.set("n", "<leader>ga", function()
-- require("Snacks").
-- end, { desc = "Git: Find files" })
if vim.g.neovide then
vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
vim.keymap.set("i", "<D-s>", "<C-O>:w<CR>")
vim.keymap.set("n", "<D-w>", ":CloseBuffer<CR>") -- Close
vim.keymap.set("i", "<D-w>", "<C-o>:CloseBuffer<CR>") -- Close
vim.keymap.set("i", "<D-z", function()
vim.cmd("undo")
end)
map_nv("<D-v>", '"+gP', { desc = "Paste from clipboard" })
vim.keymap.set("c", "<D-v>", "<C-r>+") -- Paste command mode
vim.keymap.set("i", "<D-v>", "<C-r>+", { noremap = true, silent = true })
vim.keymap.set("v", "<D-c>", '"+y', { desc = "Copy to clipboard in visual mode" })
vim.keymap.set("v", "<D-x>", '"+d', { desc = "Cut to clipboard" })
map_nv("<D-a>", "gg<S-v>G", { desc = "Select all" })
end
-- Now configure shortcuts for MacOS
-- if vim.g.neovide then
vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
vim.keymap.set("i", "<D-s>", "<C-O>:w<CR>")
map_all_mode("<D-w>", function()
local success, _ = pcall(function() vim.cmd('tabclose') end)
if not success then
vim.notify("Cannot close the last tab page", vim.log.levels.WARN)
end
end, { desc = "Close current tab" })
map_all_mode("<D-z>", function() vim.cmd("undo") end)
vim.keymap.set("i", "<D-v>", '<C-O>"+gP')
vim.keymap.set("n", "<D-v>", '"+p', { desc = "Paste from clipboard" })
vim.keymap.set("v", "<D-v>", '"_d"+p', { desc = "Remove the selected part and paste from system clipboard." })
vim.keymap.set("v", "<D-c>", '"+y', { desc = "Copy to clipboard in visual mode" })
vim.keymap.set("v", "<D-x>", '"+d', { desc = "Cut to clipboard" })
map_nv("<D-a>", "gg<S-v>G", { desc = "Select all" })
-- end