Skip to content

Commit b3cc595

Browse files
committed
Merge upstream/master
* upstream/master: feat: add `vim.opt.confirm = true` (nvim-lua#1384) Propsed fix for init.lua warnings as per nvim-lua#1305 (comment) (nvim-lua#1354) Remove duplicate cmp-path (nvim-lua#1369) fix: regression introduced in db78c0b (nvim-lua#1367) Fix: fix the cmp-nvim-lsp-signature-help link (nvim-lua#1363) feat: add basic function signature help (nvim-lua#1358) perf: load tokyonight.nvim in the intended way (nvim-lua#1360) feat(diagnostic): add diagnostic config (nvim-lua#1335) fix: arguments for the `vim.lsp.Client.supports_method` method (nvim-lua#1356) Add a blurb about installing missing emoji on Ubuntu fix (nvim-lua#1319): gitsigns deprecated functions (nvim-lua#1321) docs: clarify using opts = {} vs config = function() ... require('plu… (nvim-lua#1316) chore(docs): Update README.md (nvim-lua#1344) Use luals 3rd library for luv (nvim-lua#1303) chore: fix typo in bug report issue template (nvim-lua#1306) chore: remove redundant comment (nvim-lua#1307) fix: prevent mason setup from being run twice (nvim-lua#1298) Fix which-key delay settings (nvim-lua#1276) chore: add pre-issue requirements (nvim-lua#1288) Fix README.md grammar and typos (nvim-lua#1291) fix(gitsigns): make visual mode descriptions consistent with normal mode (nvim-lua#1266) Issue 1249 which key comments (nvim-lua#1263) Use consistent syntax style for { ... } "pseudocode" (nvim-lua#1247) Tweak outdated comment about lazy's `config` key usage. (nvim-lua#1250)
2 parents 69cd861 + 38f4744 commit b3cc595

4 files changed

Lines changed: 117 additions & 49 deletions

File tree

.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: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ 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
30+
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji`
3031
- Language Setup:
3132
- If you want to write Typescript, you need `npm`
3233
- If you want to write Golang, you will need `go`
@@ -56,12 +57,12 @@ so that you have your own copy that you can modify, then install by cloning the
5657
fork to your machine using one of the commands below, depending on your OS.
5758

5859
> **NOTE**
59-
> Your fork's url will be something like this:
60+
> Your fork's URL will be something like this:
6061
> `https://github.com/<your_github_username>/kickstart.nvim.git`
6162
6263
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
6364
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).
65+
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
6566

6667
#### Clone kickstart.nvim
6768
> **NOTE**
@@ -101,22 +102,27 @@ nvim
101102
```
102103

103104
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.
105+
the current plugin status. Hit `q` to close the window.
106+
107+
#### Read The Friendly Documentation
105108

106109
Read through the `init.lua` file in your configuration folder for more
107110
information about extending and exploring Neovim. That also includes
108111
examples of adding popularly requested plugins.
109112

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

111117
### Getting Started
112118

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

115121
### FAQ
116122

117-
* What should I do if I already have a pre-existing neovim configuration?
123+
* What should I do if I already have a pre-existing Neovim configuration?
118124
* You should back it up and then delete all associated files.
119-
* This includes your existing init.lua and the neovim files in `~/.local`
125+
* This includes your existing init.lua and the Neovim files in `~/.local`
120126
which can be deleted with `rm -rf ~/.local/share/nvim/`
121127
* Can I keep my existing configuration in parallel to kickstart?
122128
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME`
@@ -135,7 +141,7 @@ examples of adding popularly requested plugins.
135141
* The main purpose of kickstart is to serve as a teaching tool and a reference
136142
configuration that someone can easily use to `git clone` as a basis for their own.
137143
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
144+
into smaller parts. A fork of kickstart that does this while maintaining the
139145
same functionality is available here:
140146
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
141147
* Discussions on this topic can be found here:
@@ -174,7 +180,7 @@ run in cmd as **admin**:
174180
winget install --accept-source-agreements chocolatey.chocolatey
175181
```
176182

177-
2. install all requirements using choco, exit previous cmd and
183+
2. install all requirements using choco, exit the previous cmd and
178184
open a new one so that choco path is set, and run in cmd as **admin**:
179185
```
180186
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
@@ -207,14 +213,14 @@ sudo apt update
207213
sudo apt install make gcc ripgrep unzip git xclip curl
208214
209215
# Now we install nvim
210-
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
211-
sudo rm -rf /opt/nvim-linux64
212-
sudo mkdir -p /opt/nvim-linux64
213-
sudo chmod a+rX /opt/nvim-linux64
214-
sudo tar -C /opt -xzf nvim-linux64.tar.gz
216+
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
217+
sudo rm -rf /opt/nvim-linux-x86_64
218+
sudo mkdir -p /opt/nvim-linux-x86_64
219+
sudo chmod a+rX /opt/nvim-linux-x86_64
220+
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
215221
216222
# make it available in /usr/local/bin, distro installs to /usr/bin
217-
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
223+
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
218224
```
219225
</details>
220226
<details><summary>Fedora Install Steps</summary>

init.lua

Lines changed: 84 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ vim.opt.signcolumn = 'yes'
136136
vim.opt.updatetime = 250
137137

138138
-- Decrease mapped sequence wait time
139-
-- Displays which-key popup sooner
140139
vim.opt.timeoutlen = 300
141140

142141
-- Configure how new splits should be opened
@@ -158,6 +157,11 @@ vim.opt.cursorline = true
158157
-- Minimal number of screen lines to keep above and below the cursor.
159158
vim.opt.scrolloff = 10
160159

160+
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
161+
-- instead raise a dialog asking if you wish to save the current file(s)
162+
-- See `:help 'confirm'`
163+
vim.opt.confirm = true
164+
161165
-- [[ Basic Keymaps ]]
162166
-- See `:help vim.keymap.set()`
163167

@@ -236,12 +240,22 @@ require('lazy').setup({
236240
-- with the first argument being the link and the following
237241
-- keys can be used to configure plugin behavior/loading/etc.
238242
--
239-
-- Use `opts = {}` to force a plugin to be loaded.
243+
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
240244
--
241245

246+
-- Alternatively, use `config = function() ... end` for full control over the configuration.
247+
-- If you prefer to call `setup` explicitly, use:
248+
-- {
249+
-- 'lewis6991/gitsigns.nvim',
250+
-- config = function()
251+
-- require('gitsigns').setup({
252+
-- -- Your gitsigns configuration here
253+
-- })
254+
-- end,
255+
-- }
256+
--
242257
-- Here is a more advanced example where we pass configuration
243-
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
244-
-- require('gitsigns').setup({ ... })
258+
-- options to `gitsigns.nvim`.
245259
--
246260
-- See `:help gitsigns` to understand what the configuration keys do
247261
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -268,14 +282,16 @@ require('lazy').setup({
268282
-- which loads which-key before all the UI elements are loaded. Events can be
269283
-- normal autocommands events (`:help autocmd-events`).
270284
--
271-
-- Then, because we use the `config` key, the configuration only runs
272-
-- after the plugin has been loaded:
273-
-- config = function() ... end
285+
-- Then, because we use the `opts` key (recommended), the configuration runs
286+
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
274287

275288
{ -- Useful plugin to show you pending keybinds.
276289
'folke/which-key.nvim',
277290
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
278291
opts = {
292+
-- delay between pressing a key and opening which-key (milliseconds)
293+
-- this setting is independent of vim.opt.timeoutlen
294+
delay = 0,
279295
icons = {
280296
-- set icon mappings to true if you have a Nerd Font
281297
mappings = vim.g.have_nerd_font,
@@ -448,22 +464,22 @@ require('lazy').setup({
448464
opts = {
449465
library = {
450466
-- Load luvit types when the `vim.uv` word is found
451-
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
467+
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
452468
},
453469
},
454470
},
455-
{ 'Bilal2453/luvit-meta', lazy = true },
456471
{
457472
-- Main LSP Configuration
458473
'neovim/nvim-lspconfig',
459474
dependencies = {
460475
-- Automatically install LSPs and related tools to stdpath for Neovim
461-
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
476+
-- Mason must be loaded before its dependents so we need to set it up here.
477+
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
478+
{ 'williamboman/mason.nvim', opts = {} },
462479
'williamboman/mason-lspconfig.nvim',
463480
'WhoIsSethDaniel/mason-tool-installer.nvim',
464481

465482
-- Useful status updates for LSP.
466-
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
467483
{ 'j-hui/fidget.nvim', opts = {} },
468484

469485
-- Allows extra capabilities provided by nvim-cmp
@@ -549,13 +565,26 @@ require('lazy').setup({
549565
-- For example, in C this would take you to the header.
550566
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
551567

568+
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
569+
---@param client vim.lsp.Client
570+
---@param method vim.lsp.protocol.Method
571+
---@param bufnr? integer some lsp support methods only in specific files
572+
---@return boolean
573+
local function client_supports_method(client, method, bufnr)
574+
if vim.fn.has 'nvim-0.11' == 1 then
575+
return client:supports_method(method, bufnr)
576+
else
577+
return client.supports_method(method, { bufnr = bufnr })
578+
end
579+
end
580+
552581
-- The following two autocommands are used to highlight references of the
553582
-- word under your cursor when your cursor rests there for a little while.
554583
-- See `:help CursorHold` for information about when this is executed
555584
--
556585
-- When you move your cursor, the highlights will be cleared (the second autocommand).
557586
local client = vim.lsp.get_client_by_id(event.data.client_id)
558-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
587+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
559588
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
560589
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
561590
buffer = event.buf,
@@ -582,23 +611,42 @@ require('lazy').setup({
582611
-- code, if the language server you are using supports them
583612
--
584613
-- This may be unwanted, since they displace some of your code
585-
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
614+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
586615
map('<leader>th', function()
587616
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
588617
end, '[T]oggle Inlay [H]ints')
589618
end
590619
end,
591620
})
592621

593-
-- Change diagnostic symbols in the sign column (gutter)
594-
-- if vim.g.have_nerd_font then
595-
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
596-
-- local diagnostic_signs = {}
597-
-- for type, icon in pairs(signs) do
598-
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
599-
-- end
600-
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
601-
-- end
622+
-- Diagnostic Config
623+
-- See :help vim.diagnostic.Opts
624+
vim.diagnostic.config {
625+
severity_sort = true,
626+
float = { border = 'rounded', source = 'if_many' },
627+
underline = { severity = vim.diagnostic.severity.ERROR },
628+
signs = vim.g.have_nerd_font and {
629+
text = {
630+
[vim.diagnostic.severity.ERROR] = '󰅚 ',
631+
[vim.diagnostic.severity.WARN] = '󰀪 ',
632+
[vim.diagnostic.severity.INFO] = '󰋽 ',
633+
[vim.diagnostic.severity.HINT] = '󰌶 ',
634+
},
635+
} or {},
636+
virtual_text = {
637+
source = 'if_many',
638+
spacing = 2,
639+
format = function(diagnostic)
640+
local diagnostic_message = {
641+
[vim.diagnostic.severity.ERROR] = diagnostic.message,
642+
[vim.diagnostic.severity.WARN] = diagnostic.message,
643+
[vim.diagnostic.severity.INFO] = diagnostic.message,
644+
[vim.diagnostic.severity.HINT] = diagnostic.message,
645+
}
646+
return diagnostic_message[diagnostic.severity]
647+
end,
648+
},
649+
}
602650

603651
-- LSP servers and clients are able to communicate to each other what features they support.
604652
-- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -631,8 +679,8 @@ require('lazy').setup({
631679
--
632680

633681
lua_ls = {
634-
-- cmd = {...},
635-
-- filetypes = { ...},
682+
-- cmd = { ... },
683+
-- filetypes = { ... },
636684
-- capabilities = {},
637685
settings = {
638686
Lua = {
@@ -647,13 +695,16 @@ require('lazy').setup({
647695
}
648696

649697
-- Ensure the servers and tools above are installed
650-
-- To check the current status of installed tools and/or manually install
651-
-- other tools, you can run
698+
--
699+
-- To check the current status of installed tools and/or manually install
700+
-- other tools, you can run
652701
-- :Mason
653702
--
654-
-- You can press `g?` for help in this menu.
655-
require('mason').setup()
656-
703+
-- You can press `g?` for help in this menu.
704+
--
705+
-- `mason` had to be setup earlier: to configure its options see the
706+
-- `dependencies` table for `nvim-lspconfig` above.
707+
--
657708
-- You can add other tools here that you want Mason to install
658709
-- for you, so that they are available from within Neovim.
659710
local ensure_installed = vim.tbl_keys(servers or {})
@@ -663,6 +714,8 @@ require('lazy').setup({
663714
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
664715

665716
require('mason-lspconfig').setup {
717+
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
718+
automatic_installation = false,
666719
handlers = {
667720
function(server_name)
668721
local server = servers[server_name] or {}
@@ -755,6 +808,7 @@ require('lazy').setup({
755808
-- into multiple repos for maintenance purposes.
756809
'hrsh7th/cmp-nvim-lsp',
757810
'hrsh7th/cmp-path',
811+
'hrsh7th/cmp-nvim-lsp-signature-help',
758812
},
759813
config = function()
760814
-- See `:help cmp`
@@ -831,6 +885,7 @@ require('lazy').setup({
831885
{ name = 'nvim_lsp' },
832886
{ name = 'luasnip' },
833887
{ name = 'path' },
888+
{ name = 'nvim_lsp_signature_help' },
834889
},
835890
}
836891
end,

lua/kickstart/plugins/gitsigns.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ 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' })
4646
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
47-
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
47+
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
4848
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
4949
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
5050
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
@@ -54,7 +54,7 @@ return {
5454
end, { desc = 'git [D]iff against last commit' })
5555
-- Toggles
5656
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
57-
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
57+
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
5858
end,
5959
},
6060
},

0 commit comments

Comments
 (0)