Skip to content

Commit 086f43a

Browse files
author
Ted Leahy
committed
performance: defer clipboard because xsel and pbcopy can be slow (nvim-lua#1049)
1 parent 196750d commit 086f43a

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
@@ -111,9 +111,12 @@ vim.opt.mouse = 'a'
111111
vim.opt.showmode = false
112112

113113
-- Sync clipboard between OS and Neovim.
114+
-- Schedule the setting after `UiEnter` because it can increase startup-time.
114115
-- Remove this option if you want your OS clipboard to remain independent.
115116
-- See `:help 'clipboard'`
116-
vim.opt.clipboard = 'unnamedplus'
117+
vim.schedule(function()
118+
vim.opt.clipboard = 'unnamedplus'
119+
end)
117120

118121
-- Enable break indent
119122
vim.opt.breakindent = true

0 commit comments

Comments
 (0)