neovim: add paste function

This commit is contained in:
Oystein Kristoffer Tveit 2024-06-02 16:38:31 +02:00
parent 8f73eaf1b4
commit 4cb72a22c5
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146

View File

@ -99,6 +99,20 @@
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
'';
extraLuaConfig = ''
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
vim.keymap.set('n', ';', paste_buf)
'';
};
home.sessionVariables = { EDITOR = "nvim"; };