浏览代码

performance: defer clipboard because xsel and pbcopy can be slow (#1049)

abeldekat 2 年之前
父节点
当前提交
84cc12354d
共有 1 个文件被更改,包括 4 次插入 和 1 次删除
  1. 4 1
      init.lua

+ 4 - 1
init.lua

@@ -111,9 +111,12 @@ vim.opt.mouse = 'a'
 vim.opt.showmode = false
 
 -- Sync clipboard between OS and Neovim.
+--  Schedule the setting after `UiEnter` because it can increase startup-time.
 --  Remove this option if you want your OS clipboard to remain independent.
 --  See `:help 'clipboard'`
-vim.opt.clipboard = 'unnamedplus'
+vim.schedule(function()
+  vim.opt.clipboard = 'unnamedplus'
+end)
 
 -- Enable break indent
 vim.opt.breakindent = true