Skip to content

Commit d6eeb55

Browse files
authored
Merge branch 'master' into nvim_qt_win
2 parents 584c923 + de44f49 commit d6eeb55

File tree

4 files changed

+89
-32
lines changed

4 files changed

+89
-32
lines changed

init.lua

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,8 @@ require('lazy').setup({
267267
-- which loads which-key before all the UI elements are loaded. Events can be
268268
-- normal autocommands events (`:help autocmd-events`).
269269
--
270-
-- Then, because we use the `config` key, the configuration only runs
271-
-- after the plugin has been loaded:
272-
-- config = function() ... end
270+
-- Then, because we use the `opts` key (recommended), the configuration runs
271+
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
273272

274273
{ -- Useful plugin to show you pending keybinds.
275274
'folke/which-key.nvim',
@@ -279,7 +278,7 @@ require('lazy').setup({
279278
-- set icon mappings to true if you have a Nerd Font
280279
mappings = vim.g.have_nerd_font,
281280
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
282-
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
281+
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
283282
keys = vim.g.have_nerd_font and {} or {
284283
Up = '<Up> ',
285284
Down = '<Down> ',
@@ -588,6 +587,16 @@ require('lazy').setup({
588587
end,
589588
})
590589

590+
-- Change diagnostic symbols in the sign column (gutter)
591+
-- if vim.g.have_nerd_font then
592+
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
593+
-- local diagnostic_signs = {}
594+
-- for type, icon in pairs(signs) do
595+
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
596+
-- end
597+
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
598+
-- end
599+
591600
-- LSP servers and clients are able to communicate to each other what features they support.
592601
-- By default, Neovim doesn't support everything that is in the LSP specification.
593602
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
@@ -619,8 +628,8 @@ require('lazy').setup({
619628
--
620629

621630
lua_ls = {
622-
-- cmd = {...},
623-
-- filetypes = { ...},
631+
-- cmd = { ... },
632+
-- filetypes = { ... },
624633
-- capabilities = {},
625634
settings = {
626635
Lua = {
@@ -908,7 +917,7 @@ require('lazy').setup({
908917
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
909918
},
910919

911-
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
920+
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
912921
-- init.lua. If you want these files, they are in the repository, so you can just download them and
913922
-- place them in the correct locations.
914923

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)