Skip to content

Commit 34ff0f9

Browse files
committed
copy/paste
1 parent ebd7da4 commit 34ff0f9

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

init.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ vim.fn.sign_define("DapStopped", { text = "", texthl = "Debug", linehl = "",
3636
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "Debug", linehl = "", numhl = "" })
3737

3838
if vim.g.neovide then
39-
vim.g.neovide_input_macos_option_key_is_meta = 'only_left'
39+
vim.g.neovide_input_macos_option_key_is_meta = "only_left"
4040
vim.g.neovide_cursor_vfx_mode = "railgun"
4141
vim.opt_global.guifont = vim.env["NVIM_GUI_FONT"] or "CaskaydiaMono Nerd Font Mono:h15"
4242
vim.g.neovide_fullscreen = true
@@ -52,6 +52,15 @@ if vim.g.neovide then
5252
vim.g.neovide_padding_bottom = 0
5353
vim.g.neovide_padding_right = 0
5454
vim.g.neovide_padding_left = 0
55+
56+
local function save() vim.cmd.write() end
57+
local function copy() vim.cmd([[normal! "+y]]) end
58+
local function paste() vim.api.nvim_paste(vim.fn.getreg("+"), true, -1) end
59+
60+
-- https://neovide.dev/faq.html
61+
vim.keymap.set({ "n", "i", "v" }, "<D-s>", save, { desc = "Save" })
62+
vim.keymap.set("v", "<D-c>", copy, { silent = true, desc = "Copy" })
63+
vim.keymap.set({ "n", "i", "v", "c", "t" }, "<D-v>", paste, { silent = true, desc = "Paste" })
5564
end
5665
require("global")
5766
require("experimental")

0 commit comments

Comments
 (0)