Skip to content

Commit 830fe56

Browse files
authored
Merge branch 'nvim-lua:master' into master
2 parents 585446c + 5bdde24 commit 830fe56

File tree

6 files changed

+131
-53
lines changed

6 files changed

+131
-53
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ assignees: ''
99

1010
<!-- Any bug report not following this template will be immediately closed. Thanks -->
1111

12+
## Before Reporting an Issue
13+
- I have read the kickstart.nvim README.md.
14+
- I have read the appropriate plugin's documentation.
15+
- I have searched that this issue has not been reported before.
16+
17+
- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**
18+
1219
## Describe the bug
1320
<!-- A clear and concise description of what the bug is. -->
1421

@@ -18,8 +25,8 @@ assignees: ''
1825

1926
## Desktop
2027
<!-- please complete the following information. -->
21-
- OS:
22-
- Terminal:
28+
- OS:
29+
- Terminal:
2330

2431
## Neovim Version
2532
<!-- Output of running `:version` from inside of neovim. -->

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you are experiencing issues, please make sure you have the latest versions.
2424
External Requirements:
2525
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
2626
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
27-
- Clipboard tool (xclip/xsel/win32yank or other depending on platform)
27+
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
2828
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
2929
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
3030
- Language Setup:
@@ -56,12 +56,12 @@ so that you have your own copy that you can modify, then install by cloning the
5656
fork to your machine using one of the commands below, depending on your OS.
5757

5858
> **NOTE**
59-
> Your fork's url will be something like this:
59+
> Your fork's URL will be something like this:
6060
> `https://github.com/<your_github_username>/kickstart.nvim.git`
6161
6262
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
6363
too - it's ignored in the kickstart repo to make maintenance easier, but it's
64-
[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile).
64+
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
6565

6666
#### Clone kickstart.nvim
6767
> **NOTE**
@@ -101,22 +101,27 @@ nvim
101101
```
102102

103103
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
104-
current plugin status. Hit `q` to close the window.
104+
the current plugin status. Hit `q` to close the window.
105+
106+
#### Read The Friendly Documentation
105107

106108
Read through the `init.lua` file in your configuration folder for more
107109
information about extending and exploring Neovim. That also includes
108110
examples of adding popularly requested plugins.
109111

112+
> [!NOTE]
113+
> For more information about a particular plugin check its repository's documentation.
114+
110115

111116
### Getting Started
112117

113118
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
114119

115120
### FAQ
116121

117-
* What should I do if I already have a pre-existing neovim configuration?
122+
* What should I do if I already have a pre-existing Neovim configuration?
118123
* You should back it up and then delete all associated files.
119-
* This includes your existing init.lua and the neovim files in `~/.local`
124+
* This includes your existing init.lua and the Neovim files in `~/.local`
120125
which can be deleted with `rm -rf ~/.local/share/nvim/`
121126
* Can I keep my existing configuration in parallel to kickstart?
122127
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME`
@@ -135,7 +140,7 @@ examples of adding popularly requested plugins.
135140
* The main purpose of kickstart is to serve as a teaching tool and a reference
136141
configuration that someone can easily use to `git clone` as a basis for their own.
137142
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
138-
into smaller parts. A fork of kickstart that does this while maintaining the
143+
into smaller parts. A fork of kickstart that does this while maintaining the
139144
same functionality is available here:
140145
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
141146
* Discussions on this topic can be found here:
@@ -174,7 +179,7 @@ run in cmd as **admin**:
174179
winget install --accept-source-agreements chocolatey.chocolatey
175180
```
176181

177-
2. install all requirements using choco, exit previous cmd and
182+
2. install all requirements using choco, exit the previous cmd and
178183
open a new one so that choco path is set, and run in cmd as **admin**:
179184
```
180185
choco install -y neovim git ripgrep wget fd unzip gzip mingw make

init.lua

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ vim.opt.signcolumn = 'yes'
135135
vim.opt.updatetime = 250
136136

137137
-- Decrease mapped sequence wait time
138-
-- Displays which-key popup sooner
139138
vim.opt.timeoutlen = 300
140139

141140
-- Configure how new splits should be opened
@@ -267,19 +266,21 @@ require('lazy').setup({
267266
-- which loads which-key before all the UI elements are loaded. Events can be
268267
-- normal autocommands events (`:help autocmd-events`).
269268
--
270-
-- Then, because we use the `config` key, the configuration only runs
271-
-- after the plugin has been loaded:
272-
-- config = function() ... end
269+
-- Then, because we use the `opts` key (recommended), the configuration runs
270+
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
273271

274272
{ -- Useful plugin to show you pending keybinds.
275273
'folke/which-key.nvim',
276274
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
277275
opts = {
276+
-- delay between pressing a key and opening which-key (milliseconds)
277+
-- this setting is independent of vim.opt.timeoutlen
278+
delay = 0,
278279
icons = {
279280
-- set icon mappings to true if you have a Nerd Font
280281
mappings = vim.g.have_nerd_font,
281282
-- 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
283+
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
283284
keys = vim.g.have_nerd_font and {} or {
284285
Up = '<Up> ',
285286
Down = '<Down> ',
@@ -446,22 +447,22 @@ require('lazy').setup({
446447
opts = {
447448
library = {
448449
-- Load luvit types when the `vim.uv` word is found
449-
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
450+
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
450451
},
451452
},
452453
},
453-
{ 'Bilal2453/luvit-meta', lazy = true },
454454
{
455455
-- Main LSP Configuration
456456
'neovim/nvim-lspconfig',
457457
dependencies = {
458458
-- Automatically install LSPs and related tools to stdpath for Neovim
459-
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
459+
-- Mason must be loaded before its dependents so we need to set it up here.
460+
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
461+
{ 'williamboman/mason.nvim', opts = {} },
460462
'williamboman/mason-lspconfig.nvim',
461463
'WhoIsSethDaniel/mason-tool-installer.nvim',
462464

463465
-- Useful status updates for LSP.
464-
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
465466
{ 'j-hui/fidget.nvim', opts = {} },
466467

467468
-- Allows extra capabilities provided by nvim-cmp
@@ -588,6 +589,16 @@ require('lazy').setup({
588589
end,
589590
})
590591

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

621632
lua_ls = {
622-
-- cmd = {...},
623-
-- filetypes = { ...},
633+
-- cmd = { ... },
634+
-- filetypes = { ... },
624635
-- capabilities = {},
625636
settings = {
626637
Lua = {
@@ -635,13 +646,16 @@ require('lazy').setup({
635646
}
636647

637648
-- Ensure the servers and tools above are installed
638-
-- To check the current status of installed tools and/or manually install
639-
-- other tools, you can run
649+
--
650+
-- To check the current status of installed tools and/or manually install
651+
-- other tools, you can run
640652
-- :Mason
641653
--
642-
-- You can press `g?` for help in this menu.
643-
require('mason').setup()
644-
654+
-- You can press `g?` for help in this menu.
655+
--
656+
-- `mason` had to be setup earlier: to configure its options see the
657+
-- `dependencies` table for `nvim-lspconfig` above.
658+
--
645659
-- You can add other tools here that you want Mason to install
646660
-- for you, so that they are available from within Neovim.
647661
local ensure_installed = vim.tbl_keys(servers or {})
@@ -908,7 +922,7 @@ require('lazy').setup({
908922
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
909923
},
910924

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

@@ -928,8 +942,12 @@ require('lazy').setup({
928942
-- This is the easiest way to modularize your config.
929943
--
930944
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
931-
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
932945
-- { import = 'custom.plugins' },
946+
--
947+
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
948+
-- Or use telescope!
949+
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
950+
-- you can continue same window with `<space>sr` which resumes last telescope search
933951
}, {
934952
ui = {
935953
-- 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)