Skip to content

Commit 80e3540

Browse files
authored
Merge branch 'master' into first-config-attempt
2 parents dc1cbe8 + de44f49 commit 80e3540

File tree

5 files changed

+95
-34
lines changed

5 files changed

+95
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ examples of adding popularly requested plugins.
130130
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
131131
distribution that you would like to try out.
132132
* What if I want to "uninstall" this configuration:
133-
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
133+
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
134134
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
135135
* The main purpose of kickstart is to serve as a teaching tool and a reference
136136
configuration that someone can easily use to `git clone` as a basis for their own.

init.lua

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ require('lazy').setup({
302302
-- which loads which-key before all the UI elements are loaded. Events can be
303303
-- normal autocommands events (`:help autocmd-events`).
304304
--
305-
-- Then, because we use the `config` key, the configuration only runs
306-
-- after the plugin has been loaded:
307-
-- config = function() ... end
305+
-- Then, because we use the `opts` key (recommended), the configuration runs
306+
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
308307

309308
{ -- Useful plugin to show you pending keybinds.
310309
'folke/which-key.nvim',
@@ -314,7 +313,7 @@ require('lazy').setup({
314313
-- set icon mappings to true if you have a Nerd Font
315314
mappings = vim.g.have_nerd_font,
316315
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
317-
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
316+
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
318317
keys = vim.g.have_nerd_font and {} or {
319318
Up = '<Up> ',
320319
Down = '<Down> ',
@@ -660,6 +659,16 @@ require('lazy').setup({
660659
end,
661660
})
662661

662+
-- Change diagnostic symbols in the sign column (gutter)
663+
-- if vim.g.have_nerd_font then
664+
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
665+
-- local diagnostic_signs = {}
666+
-- for type, icon in pairs(signs) do
667+
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
668+
-- end
669+
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
670+
-- end
671+
663672
-- LSP servers and clients are able to communicate to each other what features they support.
664673
-- By default, Neovim doesn't support everything that is in the LSP specification.
665674
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
@@ -691,8 +700,8 @@ require('lazy').setup({
691700
--
692701

693702
lua_ls = {
694-
-- cmd = {...},
695-
-- filetypes = { ...},
703+
-- cmd = { ... },
704+
-- filetypes = { ... },
696705
-- capabilities = {},
697706
settings = {
698707
Lua = {
@@ -992,7 +1001,7 @@ require('lazy').setup({
9921001
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
9931002
},
9941003

995-
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
1004+
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
9961005
-- init.lua. If you want these files, they are in the repository, so you can just download them and
9971006
-- place them in the correct locations.
9981007

@@ -1012,8 +1021,12 @@ require('lazy').setup({
10121021
-- This is the easiest way to modularize your config.
10131022
--
10141023
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
1015-
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
10161024
{ import = 'custom.plugins' },
1025+
--
1026+
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
1027+
-- Or use telescope!
1028+
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
1029+
-- you can continue same window with `<space>sr` which resumes last telescope search
10171030
}, {
10181031
ui = {
10191032
-- If you are using a Nerd Font: set icons to an empty table which will use the

lua/kickstart/plugins/debug.lua

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,59 @@ return {
2424
-- Add your own debuggers here
2525
'leoluz/nvim-dap-go',
2626
},
27-
keys = function(_, keys)
28-
local dap = require 'dap'
29-
local dapui = require 'dapui'
30-
return {
31-
-- Basic debugging keymaps, feel free to change to your liking!
32-
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
33-
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
34-
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
35-
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
36-
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
37-
{
38-
'<leader>B',
39-
function()
40-
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
41-
end,
42-
desc = 'Debug: Set Breakpoint',
43-
},
44-
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
45-
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
46-
unpack(keys),
47-
}
48-
end,
27+
keys = {
28+
-- Basic debugging keymaps, feel free to change to your liking!
29+
{
30+
'<F5>',
31+
function()
32+
require('dap').continue()
33+
end,
34+
desc = 'Debug: Start/Continue',
35+
},
36+
{
37+
'<F1>',
38+
function()
39+
require('dap').step_into()
40+
end,
41+
desc = 'Debug: Step Into',
42+
},
43+
{
44+
'<F2>',
45+
function()
46+
require('dap').step_over()
47+
end,
48+
desc = 'Debug: Step Over',
49+
},
50+
{
51+
'<F3>',
52+
function()
53+
require('dap').step_out()
54+
end,
55+
desc = 'Debug: Step Out',
56+
},
57+
{
58+
'<leader>b',
59+
function()
60+
require('dap').toggle_breakpoint()
61+
end,
62+
desc = 'Debug: Toggle Breakpoint',
63+
},
64+
{
65+
'<leader>B',
66+
function()
67+
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
68+
end,
69+
desc = 'Debug: Set Breakpoint',
70+
},
71+
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
72+
{
73+
'<F7>',
74+
function()
75+
require('dapui').toggle()
76+
end,
77+
desc = 'Debug: See last session result.',
78+
},
79+
},
4980
config = function()
5081
local dap = require 'dap'
5182
local dapui = require 'dapui'
@@ -89,6 +120,18 @@ return {
89120
},
90121
}
91122

123+
-- Change breakpoint icons
124+
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
125+
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
126+
-- local breakpoint_icons = vim.g.have_nerd_font
127+
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
128+
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
129+
-- for type, icon in pairs(breakpoint_icons) do
130+
-- local tp = 'Dap' .. type
131+
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
132+
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
133+
-- end
134+
92135
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
93136
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
94137
dap.listeners.before.event_exited['dapui_config'] = dapui.close

lua/kickstart/plugins/gitsigns.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ return {
3636
-- visual mode
3737
map('v', '<leader>hs', function()
3838
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
39-
end, { desc = 'stage git hunk' })
39+
end, { desc = 'git [s]tage hunk' })
4040
map('v', '<leader>hr', function()
4141
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
42-
end, { desc = 'reset git hunk' })
42+
end, { desc = 'git [r]eset hunk' })
4343
-- normal mode
4444
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
4545
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })

lua/kickstart/plugins/lint.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ return {
4747
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
4848
group = lint_augroup,
4949
callback = function()
50-
lint.try_lint()
50+
-- Only run the linter in buffers that you can modify in order to
51+
-- avoid superfluous noise, notably within the handy LSP pop-ups that
52+
-- describe the hovered symbol using Markdown.
53+
if vim.opt_local.modifiable:get() then
54+
lint.try_lint()
55+
end
5156
end,
5257
})
5358
end,

0 commit comments

Comments
 (0)