1
0
Fork 0
dotfiles/home/config/nvim/plugins/osc52.fnl

26 lines
802 B
Text
Raw Normal View History

(let [osc52 (require :osc52)
uname (vim.loop.os_uname)
clip-name :nifocClipboard]
2022-09-26 13:54:38 +00:00
(osc52.setup {:silent true})
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
2023-01-01 23:30:54 +00:00
:copy {:+ :pbcopy :* :pbcopy}
: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))