@@ -245,12 +245,22 @@ require('lazy').setup({
245245 -- with the first argument being the link and the following
246246 -- keys can be used to configure plugin behavior/loading/etc.
247247 --
248- -- Use `opts = {}` to force a plugin to be loaded.
248+ -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
249249 --
250250
251+ -- Alternatively, use `config = function() ... end` for full control over the configuration.
252+ -- If you prefer to call `setup` explicitly, use:
253+ -- {
254+ -- 'lewis6991/gitsigns.nvim',
255+ -- config = function()
256+ -- require('gitsigns').setup({
257+ -- -- Your gitsigns configuration here
258+ -- })
259+ -- end,
260+ -- }
261+ --
251262 -- Here is a more advanced example where we pass configuration
252- -- options to `gitsigns.nvim`. This is equivalent to the following Lua:
253- -- require('gitsigns').setup({ ... })
263+ -- options to `gitsigns.nvim`.
254264 --
255265 -- See `:help gitsigns` to understand what the configuration keys do
256266 { -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -570,7 +580,7 @@ require('lazy').setup({
570580 --
571581 -- When you move your cursor, the highlights will be cleared (the second autocommand).
572582 local client = vim .lsp .get_client_by_id (event .data .client_id )
573- if client and client . supports_method (vim .lsp .protocol .Methods .textDocument_documentHighlight ) then
583+ if client and client : supports_method (vim .lsp .protocol .Methods .textDocument_documentHighlight ) then
574584 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
575585 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
576586 buffer = event .buf ,
@@ -597,23 +607,42 @@ require('lazy').setup({
597607 -- code, if the language server you are using supports them
598608 --
599609 -- This may be unwanted, since they displace some of your code
600- if client and client . supports_method (vim .lsp .protocol .Methods .textDocument_inlayHint ) then
610+ if client and client : supports_method (vim .lsp .protocol .Methods .textDocument_inlayHint ) then
601611 map (' <leader>th' , function ()
602612 vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event .buf })
603613 end , ' [T]oggle Inlay [H]ints' )
604614 end
605615 end ,
606616 })
607617
608- -- Change diagnostic symbols in the sign column (gutter)
609- -- if vim.g.have_nerd_font then
610- -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
611- -- local diagnostic_signs = {}
612- -- for type, icon in pairs(signs) do
613- -- diagnostic_signs[vim.diagnostic.severity[type]] = icon
614- -- end
615- -- vim.diagnostic.config { signs = { text = diagnostic_signs } }
616- -- end
618+ -- Diagnostic Config
619+ -- See :help vim.diagnostic.Opts
620+ vim .diagnostic .config {
621+ severity_sort = true ,
622+ float = { border = ' rounded' , source = ' if_many' },
623+ underline = { severity = vim .diagnostic .severity .ERROR },
624+ signs = vim .g .have_nerd_font and {
625+ text = {
626+ [vim .diagnostic .severity .ERROR ] = ' ' ,
627+ [vim .diagnostic .severity .WARN ] = ' ' ,
628+ [vim .diagnostic .severity .INFO ] = ' ' ,
629+ [vim .diagnostic .severity .HINT ] = ' ' ,
630+ },
631+ } or {},
632+ virtual_text = {
633+ source = ' if_many' ,
634+ spacing = 2 ,
635+ format = function (diagnostic )
636+ local diagnostic_message = {
637+ [vim .diagnostic .severity .ERROR ] = diagnostic .message ,
638+ [vim .diagnostic .severity .WARN ] = diagnostic .message ,
639+ [vim .diagnostic .severity .INFO ] = diagnostic .message ,
640+ [vim .diagnostic .severity .HINT ] = diagnostic .message ,
641+ }
642+ return diagnostic_message [diagnostic .severity ]
643+ end ,
644+ },
645+ }
617646
618647 -- LSP servers and clients are able to communicate to each other what features they support.
619648 -- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -788,6 +817,8 @@ require('lazy').setup({
788817 -- into multiple repos for maintenance purposes.
789818 ' hrsh7th/cmp-nvim-lsp' ,
790819 ' hrsh7th/cmp-path' ,
820+ ' hrsh7th/cmp-path' ,
821+ ' htsh7th/cmp-nvim-lsp-signature-help' ,
791822 },
792823 config = function ()
793824 -- See `:help cmp`
@@ -886,6 +917,7 @@ require('lazy').setup({
886917 { name = ' nvim_lsp' },
887918 { name = ' luasnip' },
888919 { name = ' path' },
920+ { name = ' nvim_lsp_signature_help' },
889921 },
890922 }
891923 end ,
@@ -898,14 +930,18 @@ require('lazy').setup({
898930 -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
899931 ' folke/tokyonight.nvim' ,
900932 priority = 1000 , -- Make sure to load this before all the other start plugins.
901- init = function ()
933+ config = function ()
934+ --- @diagnostic disable-next-line : missing-fields
935+ require (' tokyonight' ).setup {
936+ styles = {
937+ comments = { italic = false }, -- Disable italics in comments
938+ },
939+ }
940+
902941 -- Load the colorscheme here.
903942 -- Like many other themes, this one has different styles, and you could load
904943 -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
905944 vim .cmd .colorscheme ' tokyonight-night'
906-
907- -- You can configure highlights by doing something like:
908- vim .cmd .hi ' Comment gui=none'
909945 end ,
910946 },
911947
0 commit comments