Skip to content

Commit 1a82f0d

Browse files
committed
Merge branch 'master' into codemedic-customisations
* master: performance: defer clipboard because xsel and pbcopy can be slow (nvim-lua#1049) refactor: remove lazydev and luvit-meta as lsp dependencies (nvim-lua#1047) Modify conform comments to prevent deprecation warning when used (nvim-lua#1057) Remove redundant hlsearch option (nvim-lua#1058)
2 parents 7511bf0 + 84cc123 commit 1a82f0d

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

init.lua

Lines changed: 24 additions & 21 deletions
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
@@ -167,8 +170,8 @@ vim.opt.spelllang = { 'en_gb' }
167170
-- [[ Basic Keymaps ]]
168171
-- See `:help vim.keymap.set()`
169172

170-
-- Set highlight on search, but clear on pressing <Esc> in normal mode
171-
vim.opt.hlsearch = true
173+
-- Clear highlights on search when pressing <Esc> in normal mode
174+
-- See `:help hlsearch`
172175
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
173176

174177
-- Diagnostic keymaps
@@ -414,7 +417,22 @@ require('lazy').setup({
414417
end,
415418
},
416419

417-
{ -- LSP Configuration & Plugins
420+
-- LSP Plugins
421+
{
422+
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
423+
-- used for completion, annotations and signatures of Neovim apis
424+
'folke/lazydev.nvim',
425+
ft = 'lua',
426+
opts = {
427+
library = {
428+
-- Load luvit types when the `vim.uv` word is found
429+
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
430+
},
431+
},
432+
},
433+
{ 'Bilal2453/luvit-meta', lazy = true },
434+
{
435+
-- Main LSP Configuration
418436
'neovim/nvim-lspconfig',
419437
dependencies = {
420438
-- Automatically install LSPs and related tools to stdpath for Neovim
@@ -425,20 +443,6 @@ require('lazy').setup({
425443
-- Useful status updates for LSP.
426444
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
427445
{ 'j-hui/fidget.nvim', opts = {} },
428-
429-
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
430-
-- used for completion, annotations and signatures of Neovim apis
431-
{
432-
'folke/lazydev.nvim',
433-
ft = 'lua',
434-
opts = {
435-
library = {
436-
-- Load luvit types when the `vim.uv` word is found
437-
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
438-
},
439-
},
440-
},
441-
{ 'Bilal2453/luvit-meta', lazy = true },
442446
},
443447
config = function()
444448
-- Brief aside: **What is LSP?**
@@ -681,9 +685,8 @@ require('lazy').setup({
681685
-- Conform can also run multiple formatters sequentially
682686
-- python = { "isort", "black" },
683687
--
684-
-- You can use a sub-list to tell conform to run *until* a formatter
685-
-- is found.
686-
-- javascript = { { "prettierd", "prettier" } },
688+
-- You can use 'stop_after_first' to run the first available formatter from the list
689+
-- javascript = { "prettierd", "prettier", stop_after_first = true },
687690
},
688691
},
689692
},

0 commit comments

Comments
 (0)