neovim: add paste function
This commit is contained in:
parent
8f73eaf1b4
commit
4cb72a22c5
@ -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"; };
|
||||
|
Loading…
Reference in New Issue
Block a user