nixpkgs-tools/treewideMainProgram/neovim_fill_buffer_plugin.lua

13 lines
295 B
Lua
Raw Normal View History

2023-11-27 02:36:30 +01:00
local function paste_buf()
local content = os.getenv("NVIM_CLIPBOARD")
local line = vim.api.nvim_get_current_line()
local indent = string.match(line, " +")
vim.fn.setreg("a", indent .. content)
vim.cmd("put a")
end
-- Use ';' to insert paste_buf
vim.keymap.set('n', ';', paste_buf)