@@ -111,9 +111,12 @@ vim.opt.mouse = 'a'
111111vim .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
119122vim .opt .breakindent = true
@@ -157,8 +160,8 @@ vim.opt.scrolloff = 10
157160-- [[ Basic Keymaps ]]
158161-- See `:help vim.keymap.set()`
159162
160- -- Set highlight on search, but clear on pressing <Esc> in normal mode
161- vim . opt . hlsearch = true
163+ -- Clear highlights on search when pressing <Esc> in normal mode
164+ -- See `:help hlsearch`
162165vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
163166
164167-- Diagnostic keymaps
@@ -399,7 +402,22 @@ require('lazy').setup({
399402 end ,
400403 },
401404
402- { -- LSP Configuration & Plugins
405+ -- LSP Plugins
406+ {
407+ -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
408+ -- used for completion, annotations and signatures of Neovim apis
409+ ' folke/lazydev.nvim' ,
410+ ft = ' lua' ,
411+ opts = {
412+ library = {
413+ -- Load luvit types when the `vim.uv` word is found
414+ { path = ' luvit-meta/library' , words = { ' vim%.uv' } },
415+ },
416+ },
417+ },
418+ { ' Bilal2453/luvit-meta' , lazy = true },
419+ {
420+ -- Main LSP Configuration
403421 ' neovim/nvim-lspconfig' ,
404422 dependencies = {
405423 -- Automatically install LSPs and related tools to stdpath for Neovim
@@ -411,19 +429,8 @@ require('lazy').setup({
411429 -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
412430 { ' j-hui/fidget.nvim' , opts = {} },
413431
414- -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
415- -- used for completion, annotations and signatures of Neovim apis
416- {
417- ' folke/lazydev.nvim' ,
418- ft = ' lua' ,
419- opts = {
420- library = {
421- -- Load luvit types when the `vim.uv` word is found
422- { path = ' luvit-meta/library' , words = { ' vim%.uv' } },
423- },
424- },
425- },
426- { ' Bilal2453/luvit-meta' , lazy = true },
432+ -- Allows extra capabilities provided by nvim-cmp
433+ ' hrsh7th/cmp-nvim-lsp' ,
427434 },
428435 config = function ()
429436 -- Brief aside: **What is LSP?**
@@ -653,9 +660,8 @@ require('lazy').setup({
653660 -- Conform can also run multiple formatters sequentially
654661 -- python = { "isort", "black" },
655662 --
656- -- You can use a sub-list to tell conform to run *until* a formatter
657- -- is found.
658- -- javascript = { { "prettierd", "prettier" } },
663+ -- You can use 'stop_after_first' to run the first available formatter from the list
664+ -- javascript = { "prettierd", "prettier", stop_after_first = true },
659665 },
660666 },
661667 },
@@ -853,8 +859,6 @@ require('lazy').setup({
853859 config = function (_ , opts )
854860 -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
855861
856- -- Prefer git instead of curl in order to improve connectivity in some environments
857- require (' nvim-treesitter.install' ).prefer_git = true
858862 --- @diagnostic disable-next-line : missing-fields
859863 require (' nvim-treesitter.configs' ).setup (opts )
860864
0 commit comments