Skip to content

Commit 87b3522

Browse files
committed
docs(readme): add configuration index with plugin links and line references
1 parent 3338d39 commit 87b3522

File tree

2 files changed

+77
-26
lines changed

2 files changed

+77
-26
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,35 @@ examples of adding popularly requested plugins.
150150
* [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218)
151151
* [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473)
152152
153+
154+
## Configuration
155+
156+
This section provides quick links to the configuration of each plugin.
157+
158+
### Plugins configured in `init.lua`
159+
160+
- [guess-indent.nvim](init.lua#L250)
161+
- [gitsigns.nvim](init.lua#L275)
162+
- [which-key.nvim](init.lua#L302)
163+
- [telescope.nvim](init.lua#L362)
164+
- [lazydev.nvim](init.lua#L469)
165+
- [nvim-lspconfig](init.lua#L480)
166+
- [conform.nvim](init.lua#L762)
167+
- [blink.cmp](init.lua#L803)
168+
- [tokyonight.nvim](init.lua#L906)
169+
- [todo-comments.nvim](init.lua#L924)
170+
- [mini.nvim](init.lua#L927)
171+
- [nvim-treesitter](init.lua#L964)
172+
173+
### Plugins with dedicated configuration files
174+
175+
- [autopairs.lua](lua/kickstart/plugins/autopairs.lua)
176+
- [debug.lua](lua/kickstart/plugins/debug.lua)
177+
- [gitsigns.lua](lua/kickstart/plugins/gitsigns.lua)
178+
- [indent_line.lua](lua/kickstart/plugins/indent_line.lua)
179+
- [lint.lua](lua/kickstart/plugins/lint.lua)
180+
- [neo-tree.lua](lua/kickstart/plugins/neo-tree.lua)
181+
153182
### Install Recipes
154183
155184
Below you can find OS specific install instructions for Neovim and dependencies.

init.lua

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -628,32 +628,54 @@ require('lazy').setup({
628628

629629
-- Diagnostic Config
630630
-- See :help vim.diagnostic.Opts
631-
vim.diagnostic.config {
632-
severity_sort = true,
633-
float = { border = 'rounded', source = 'if_many' },
634-
underline = { severity = vim.diagnostic.severity.ERROR },
635-
signs = vim.g.have_nerd_font and {
636-
text = {
637-
[vim.diagnostic.severity.ERROR] = '󰅚 ',
638-
[vim.diagnostic.severity.WARN] = '󰀪 ',
639-
[vim.diagnostic.severity.INFO] = '󰋽 ',
640-
[vim.diagnostic.severity.HINT] = '󰌶 ',
641-
},
642-
} or {},
643-
virtual_text = {
644-
source = 'if_many',
645-
spacing = 2,
646-
format = function(diagnostic)
647-
local diagnostic_message = {
648-
[vim.diagnostic.severity.ERROR] = diagnostic.message,
649-
[vim.diagnostic.severity.WARN] = diagnostic.message,
650-
[vim.diagnostic.severity.INFO] = diagnostic.message,
651-
[vim.diagnostic.severity.HINT] = diagnostic.message,
652-
}
653-
return diagnostic_message[diagnostic.severity]
654-
end,
655-
},
656-
}
631+
-- Diagnostic configuration similar to VS Code's Error Lens.
632+
-- In insert mode, diagnostics are displayed as inline virtual text.
633+
-- In normal mode, diagnostics are shown as virtual lines below the affected lines.
634+
635+
local function set_virtual_text(enable)
636+
local diagnostic_icons = {
637+
[vim.diagnostic.severity.ERROR] = '󰅚 ',
638+
[vim.diagnostic.severity.WARN] = '󰀪 ',
639+
[vim.diagnostic.severity.INFO] = '󰋽 ',
640+
[vim.diagnostic.severity.HINT] = '󰌶 ',
641+
}
642+
643+
vim.diagnostic.config {
644+
update_in_insert = true, -- error messages in insert mode
645+
severity_sort = true,
646+
float = { border = 'rounded', source = 'if_many' },
647+
underline = { severity = vim.diagnostic.severity.ERROR },
648+
signs = vim.g.have_nerd_font and {
649+
text = diagnostic_icons,
650+
} or {},
651+
652+
virtual_lines = not enable and {
653+
format = function(diagnostic)
654+
return (diagnostic_icons[diagnostic.severity] or '') .. diagnostic.message
655+
end,
656+
} or false,
657+
658+
virtual_text = enable and {
659+
source = 'if_many',
660+
spacing = 2,
661+
format = function(diagnostic)
662+
return (diagnostic_icons[diagnostic.severity] or '') .. diagnostic.message
663+
end,
664+
} or false,
665+
}
666+
end
667+
668+
vim.api.nvim_create_autocmd('InsertEnter', {
669+
callback = function()
670+
set_virtual_text(true)
671+
end,
672+
})
673+
674+
vim.api.nvim_create_autocmd('InsertLeave', {
675+
callback = function()
676+
set_virtual_text(false)
677+
end,
678+
})
657679

658680
-- LSP servers and clients are able to communicate to each other what features they support.
659681
-- By default, Neovim doesn't support everything that is in the LSP specification.

0 commit comments

Comments
 (0)