Skip to content

Commit 3a2df17

Browse files
abeldekatottoreimers
authored andcommitted
performance: defer clipboard because xsel and pbcopy can be slow (nvim-lua#1049)
1 parent 944224a commit 3a2df17

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
@@ -25,9 +25,12 @@ vim.opt.mouse = 'a'
2525
vim.opt.showmode = false
2626

2727
-- Sync clipboard between OS and Neovim.
28+
-- Schedule the setting after `UiEnter` because it can increase startup-time.
2829
-- Remove this option if you want your OS clipboard to remain independent.
2930
-- See `:help 'clipboard'`
30-
vim.opt.clipboard = 'unnamedplus'
31+
vim.schedule(function()
32+
vim.opt.clipboard = 'unnamedplus'
33+
end)
3134

3235
-- Enable break indent
3336
vim.opt.breakindent = true

0 commit comments

Comments
 (0)