dotfiles/home/config/nvim/plugins/osc52.fnl

24 lines
764 B
Text
Raw Normal View History

(let [osc52 (require :osc52)
uname (vim.loop.os_uname)
clip-name :nifocClipboard]
2022-08-02 20:50:56 +00:00
(fn copy [lines _]
(-> lines
(table.concat "\n")
(osc52.copy)))
(fn paste []
[(vim.fn.split (vim.fn.getreg "") "\n") (vim.fn.getregtype "")])
(if (= uname.sysname :Darwin)
(set vim.g.clipboard {:name clip-name
:copy {:+ copy :* copy}
:paste {:+ :pbpaste :* :pbpaste}
:cache_enabled 0})
;; Other OS
(set vim.g.clipboard {:name clip-name
:copy {:+ copy :* copy}
:paste {:+ paste :* paste}
:cache_enabled 0}))
2022-08-02 20:50:56 +00:00
(vim.opt.clipboard:prepend :unnamedplus))