Skip to content

Commit ff48c3b

Browse files
committed
More section changes
1 parent 506e934 commit ff48c3b

1 file changed

Lines changed: 36 additions & 27 deletions

File tree

init.lua

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,24 @@ do
179179
-- See `:help hlsearch`
180180
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
181181

182+
-- [[ Diagnostic Configuration ]]
183+
-- See `:help vim.diagnostic.Opts`
184+
vim.diagnostic.config {
185+
update_in_insert = false,
186+
severity_sort = true,
187+
float = { border = 'rounded', source = 'if_many' },
188+
underline = { severity = { min = vim.diagnostic.severity.WARN } },
189+
190+
-- Can switch between these as you prefer
191+
virtual_text = true, -- Text shows up at the end of the line
192+
virtual_lines = false, -- Text shows up underneath the line, with virtual lines
193+
194+
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
195+
jump = { float = true },
196+
}
197+
198+
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
199+
182200
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
183201
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
184202
-- is not what someone will guess without a bit more experience.
@@ -539,28 +557,10 @@ do
539557
end
540558

541559
-- ============================================================
542-
-- SECTION 5: LANGUAGE TOOLING
543-
-- Diagnostics, LSP, Mason, formatting, autocompletion
560+
-- SECTION 5: LSP
561+
-- LSP keymaps, server configuration, Mason tools installations
544562
-- ============================================================
545563
do
546-
-- [[ Diagnostic Configuration ]]
547-
-- See `:help vim.diagnostic.Opts`
548-
vim.diagnostic.config {
549-
update_in_insert = false,
550-
severity_sort = true,
551-
float = { border = 'rounded', source = 'if_many' },
552-
underline = { severity = { min = vim.diagnostic.severity.WARN } },
553-
554-
-- Can switch between these as you prefer
555-
virtual_text = true, -- Text shows up at the end of the line
556-
virtual_lines = false, -- Text shows up underneath the line, with virtual lines
557-
558-
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
559-
jump = { float = true },
560-
}
561-
562-
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
563-
564564
-- [[ LSP Configuration ]]
565565
-- Brief aside: **What is LSP?**
566566
--
@@ -732,7 +732,13 @@ do
732732
vim.lsp.config(name, server)
733733
vim.lsp.enable(name)
734734
end
735+
end
735736

737+
-- ============================================================
738+
-- SECTION 6: FORMATTING
739+
-- conform.nvim setup and keymap
740+
-- ============================================================
741+
do
736742
-- [[ Formatting ]]
737743
require('conform').setup {
738744
notify_on_error = false,
@@ -763,10 +769,14 @@ do
763769
}
764770

765771
vim.keymap.set({ 'n', 'v' }, '<leader>f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' })
772+
end
766773

767-
-- [[ Autocompletion Configuration ]]
768-
769-
-- Snippet Engine
774+
-- ============================================================
775+
-- SECTION 7: AUTOCOMPLETE & SNIPPETS
776+
-- blink.cmp and luasnip setup
777+
-- ============================================================
778+
do
779+
-- [[ Snippet Engine ]]
770780
require('luasnip').setup {}
771781

772782
-- `friendly-snippets` contains a variety of premade snippets.
@@ -776,7 +786,7 @@ do
776786
-- vim.pack.add { gh 'rafamadriz/friendly-snippets' }
777787
-- require('luasnip.loaders.from_vscode').lazy_load()
778788

779-
-- The autocomplete engine
789+
-- [[ Autocomplete Engine ]]
780790
require('blink.cmp').setup {
781791
keymap = {
782792
-- 'default' (recommended) for mappings similar to built-in completions
@@ -839,7 +849,7 @@ do
839849
end
840850

841851
-- ============================================================
842-
-- SECTION 6: TREESITTER
852+
-- SECTION 8: TREESITTER
843853
-- Parser installation, syntax highlighting, folds, indentation
844854
-- ============================================================
845855
do
@@ -898,11 +908,10 @@ do
898908
end
899909

900910
-- ============================================================
901-
-- SECTION 7: OPTIONAL EXAMPLES / NEXT STEPS
911+
-- SECTION 9: OPTIONAL EXAMPLES / NEXT STEPS
902912
-- kickstart.plugins.* examples
903913
-- ============================================================
904914
do
905-
906915
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
907916
-- init.lua. If you want these files, they are in the repository, so you can just download them and
908917
-- place them in the correct locations.

0 commit comments

Comments
 (0)