Skip to content

Commit f944786

Browse files
abeldekatmonk3yd
authored andcommitted
performance: defer clipboard because xsel and pbcopy can be slow (nvim-lua#1049)
1 parent 7b059be commit f944786

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ vim.opt.mouse = 'a'
9191
vim.opt.showmode = false
9292

9393
-- Sync clipboard between OS and Neovim.
94+
-- Schedule the setting after `UiEnter` because it can increase startup-time.
9495
-- Remove this option if you want your OS clipboard to remain independent.
9596
-- See `:help 'clipboard'`
96-
vim.opt.clipboard = 'unnamedplus'
97+
vim.schedule(function()
98+
vim.opt.clipboard = 'unnamedplus'
99+
end)
97100

98101
-- Enable break indent
99102
vim.opt.breakindent = true

0 commit comments

Comments
 (0)