@@ -237,12 +237,22 @@ require('lazy').setup({
237237 -- with the first argument being the link and the following
238238 -- keys can be used to configure plugin behavior/loading/etc.
239239 --
240- -- Use `opts = {}` to force a plugin to be loaded.
240+ -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
241241 --
242242
243+ -- Alternatively, use `config = function() ... end` for full control over the configuration.
244+ -- If you prefer to call `setup` explicitly, use:
245+ -- {
246+ -- 'lewis6991/gitsigns.nvim',
247+ -- config = function()
248+ -- require('gitsigns').setup({
249+ -- -- Your gitsigns configuration here
250+ -- })
251+ -- end,
252+ -- }
253+ --
243254 -- Here is a more advanced example where we pass configuration
244- -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
245- -- require('gitsigns').setup({ ... })
255+ -- options to `gitsigns.nvim`.
246256 --
247257 -- See `:help gitsigns` to understand what the configuration keys do
248258 { -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -555,13 +565,26 @@ require('lazy').setup({
555565 -- For example, in C this would take you to the header.
556566 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
557567
568+ -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
569+ --- @param client vim.lsp.Client
570+ --- @param method vim.lsp.protocol.Method
571+ --- @param bufnr ? integer some lsp support methods only in specific files
572+ --- @return boolean
573+ local function client_supports_method (client , method , bufnr )
574+ if vim .fn .has ' nvim-0.11' == 1 then
575+ return client :supports_method (method , bufnr )
576+ else
577+ return client .supports_method (method , { bufnr = bufnr })
578+ end
579+ end
580+
558581 -- The following two autocommands are used to highlight references of the
559582 -- word under your cursor when your cursor rests there for a little while.
560583 -- See `:help CursorHold` for information about when this is executed
561584 --
562585 -- When you move your cursor, the highlights will be cleared (the second autocommand).
563586 local client = vim .lsp .get_client_by_id (event .data .client_id )
564- if client and client . supports_method ( vim .lsp .protocol .Methods .textDocument_documentHighlight ) then
587+ if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_documentHighlight , event . buf ) then
565588 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
566589 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
567590 buffer = event .buf ,
@@ -588,23 +611,42 @@ require('lazy').setup({
588611 -- code, if the language server you are using supports them
589612 --
590613 -- This may be unwanted, since they displace some of your code
591- if client and client . supports_method ( vim .lsp .protocol .Methods .textDocument_inlayHint ) then
614+ if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_inlayHint , event . buf ) then
592615 map (' <leader>th' , function ()
593616 vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event .buf })
594617 end , ' [T]oggle Inlay [H]ints' )
595618 end
596619 end ,
597620 })
598621
599- -- Change diagnostic symbols in the sign column (gutter)
600- if vim .g .have_nerd_font then
601- local signs = { ERROR = ' ' , WARN = ' ' , INFO = ' ' , HINT = ' ' }
602- local diagnostic_signs = {}
603- for type , icon in pairs (signs ) do
604- diagnostic_signs [vim .diagnostic .severity [type ]] = icon
605- end
606- vim .diagnostic .config { signs = { text = diagnostic_signs } }
607- end
622+ -- Diagnostic Config
623+ -- See :help vim.diagnostic.Opts
624+ vim .diagnostic .config {
625+ severity_sort = true ,
626+ float = { border = ' rounded' , source = ' if_many' },
627+ underline = { severity = vim .diagnostic .severity .ERROR },
628+ signs = vim .g .have_nerd_font and {
629+ text = {
630+ [vim .diagnostic .severity .ERROR ] = ' ' ,
631+ [vim .diagnostic .severity .WARN ] = ' ' ,
632+ [vim .diagnostic .severity .INFO ] = ' ' ,
633+ [vim .diagnostic .severity .HINT ] = ' ' ,
634+ },
635+ } or {},
636+ virtual_text = {
637+ source = ' if_many' ,
638+ spacing = 2 ,
639+ format = function (diagnostic )
640+ local diagnostic_message = {
641+ [vim .diagnostic .severity .ERROR ] = diagnostic .message ,
642+ [vim .diagnostic .severity .WARN ] = diagnostic .message ,
643+ [vim .diagnostic .severity .INFO ] = diagnostic .message ,
644+ [vim .diagnostic .severity .HINT ] = diagnostic .message ,
645+ }
646+ return diagnostic_message [diagnostic .severity ]
647+ end ,
648+ },
649+ }
608650
609651 -- LSP servers and clients are able to communicate to each other what features they support.
610652 -- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -672,6 +714,8 @@ require('lazy').setup({
672714 require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
673715
674716 require (' mason-lspconfig' ).setup {
717+ ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
718+ automatic_installation = false ,
675719 handlers = {
676720 function (server_name )
677721 local server = servers [server_name ] or {}
@@ -764,6 +808,7 @@ require('lazy').setup({
764808 -- into multiple repos for maintenance purposes.
765809 ' hrsh7th/cmp-nvim-lsp' ,
766810 ' hrsh7th/cmp-path' ,
811+ ' hrsh7th/cmp-nvim-lsp-signature-help' ,
767812 },
768813 config = function ()
769814 -- See `:help cmp`
@@ -840,6 +885,7 @@ require('lazy').setup({
840885 { name = ' nvim_lsp' },
841886 { name = ' luasnip' },
842887 { name = ' path' },
888+ { name = ' nvim_lsp_signature_help' },
843889 },
844890 }
845891 end ,
@@ -860,11 +906,18 @@ require('lazy').setup({
860906 ' telescope' ,
861907 },
862908 priority = 1000 , -- Make sure to load this before all the other start plugins.
863- init = function ()
909+ config = function ()
910+ --- @diagnostic disable-next-line : missing-fields
911+ require (' tokyonight' ).setup {
912+ styles = {
913+ comments = { italic = false }, -- Disable italics in comments
914+ },
915+ }
916+
864917 -- Load the colorscheme here.
865918 -- Like many other themes, this one has different styles, and you could load
866919 -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
867- vim .cmd .colorscheme ' material '
920+ vim .cmd .colorscheme ' tokyonight-night '
868921
869922 -- You can configure highlights by doing something like:
870923 vim .cmd .hi ' Comment gui=none'
0 commit comments