Skip to content

Commit 7ed7500

Browse files
committed
Merge remote-tracking branch 'upstream/master' into master-merge
2 parents 6fafa67 + 34e7d29 commit 7ed7500

File tree

4 files changed

+137
-27
lines changed

4 files changed

+137
-27
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: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,26 @@ Neovim's configurations are located under the following paths, depending on your
3737
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
3838
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
3939

40-
Clone kickstart.nvim:
40+
#### Recommended Step
41+
42+
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
43+
so that you have your own copy that you can modify, then install by cloning the
44+
fork to your machine using one of the commands below, depending on your OS.
45+
46+
> **NOTE**
47+
> Your fork's URL will be something like this:
48+
> `https://github.com/<your_github_username>/kickstart.nvim.git`
49+
50+
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
51+
too - it's ignored in the kickstart repo to make maintenance easier, but it's
52+
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
53+
54+
#### Clone kickstart.nvim
55+
> **NOTE**
56+
> If following the recommended step above (i.e., forking the repo), replace
57+
> `nvim-lua` with `<your_github_username>` in the commands below
58+
59+
<details><summary> Linux and Mac </summary>
4160

4261
- on Linux and Mac
4362
```sh
@@ -63,15 +82,18 @@ Start Neovim
6382
nvim
6483
```
6584

66-
The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up.
85+
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
86+
the current plugin status. Hit `q` to close the window.
87+
88+
#### Read The Friendly Documentation
6789

6890
Read through the `init.lua` file in your configuration folder for more
6991
information about extending and exploring Neovim. That also includes
7092
examples of adding popularly requested plugins.
7193

72-
```sh
73-
nvim --headless "+Lazy! sync" +qa
74-
```
94+
> [!NOTE]
95+
> For more information about a particular plugin check its repository's documentation.
96+
7597

7698
### Getting Started
7799

@@ -84,10 +106,10 @@ Each PR, especially those which increase the line count, should have a descripti
84106

85107
### FAQ
86108

87-
* What should I do if I already have a pre-existing neovim configuration?
88-
* You should back it up, then delete all files associated with it.
89-
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
90-
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
109+
* What should I do if I already have a pre-existing Neovim configuration?
110+
* You should back it up and then delete all associated files.
111+
* This includes your existing init.lua and the Neovim files in `~/.local`
112+
which can be deleted with `rm -rf ~/.local/share/nvim/`
91113
* Can I keep my existing configuration in parallel to kickstart?
92114
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias:
93115
```
@@ -100,7 +122,7 @@ Each PR, especially those which increase the line count, should have a descripti
100122
* The main purpose of kickstart is to serve as a teaching tool and a reference
101123
configuration that someone can easily `git clone` as a basis for their own.
102124
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
103-
into smaller parts. A fork of kickstart that does this while maintaining the exact
125+
into smaller parts. A fork of kickstart that does this while maintaining the
104126
same functionality is available here:
105127
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
106128
* Discussions on this topic can be found here:
@@ -132,7 +154,7 @@ run in cmd as **admin**:
132154
winget install --accept-source-agreements chocolatey.chocolatey
133155
```
134156

135-
2. install all requirements using choco, exit previous cmd and
157+
2. install all requirements using choco, exit the previous cmd and
136158
open a new one so that choco path is set, and run in cmd as **admin**:
137159
```
138160
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
@@ -165,14 +187,14 @@ sudo apt update
165187
sudo apt install make gcc ripgrep unzip git xclip curl
166188
167189
# Now we install nvim
168-
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
169-
sudo rm -rf /opt/nvim-linux64
170-
sudo mkdir -p /opt/nvim-linux64
171-
sudo chmod a+rX /opt/nvim-linux64
172-
sudo tar -C /opt -xzf nvim-linux64.tar.gz
190+
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
191+
sudo rm -rf /opt/nvim-linux-x86_64
192+
sudo mkdir -p /opt/nvim-linux-x86_64
193+
sudo chmod a+rX /opt/nvim-linux-x86_64
194+
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
173195
174196
# make it available in /usr/local/bin, distro installs to /usr/bin
175-
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
197+
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
176198
```
177199
</details>
178200
<details><summary>Fedora Install Steps</summary>

init.lua

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ vim.opt.signcolumn = 'yes'
8888
vim.opt.updatetime = 250
8989

9090
-- Decrease mapped sequence wait time
91-
-- Displays which-key popup sooner
9291
vim.opt.timeoutlen = 300
9392

9493
-- Configure how new splits should be opened
@@ -180,12 +179,22 @@ require('lazy').setup {
180179
-- with the first argument being the link and the following
181180
-- keys can be used to configure plugin behavior/loading/etc.
182181
--
183-
-- Use `opts = {}` to force a plugin to be loaded.
182+
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
184183
--
185184

185+
-- Alternatively, use `config = function() ... end` for full control over the configuration.
186+
-- If you prefer to call `setup` explicitly, use:
187+
-- {
188+
-- 'lewis6991/gitsigns.nvim',
189+
-- config = function()
190+
-- require('gitsigns').setup({
191+
-- -- Your gitsigns configuration here
192+
-- })
193+
-- end,
194+
-- }
195+
--
186196
-- Here is a more advanced example where we pass configuration
187-
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
188-
-- require('gitsigns').setup({ ... })
197+
-- options to `gitsigns.nvim`.
189198
--
190199
-- See `:help gitsigns` to understand what the configuration keys do
191200
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
@@ -219,6 +228,9 @@ require('lazy').setup {
219228
'folke/which-key.nvim',
220229
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
221230
opts = {
231+
-- delay between pressing a key and opening which-key (milliseconds)
232+
-- this setting is independent of vim.opt.timeoutlen
233+
delay = 0,
222234
icons = {
223235
-- set icon mappings to true if you have a Nerd Font
224236
mappings = vim.g.have_nerd_font,
@@ -516,8 +528,77 @@ require('lazy').setup {
516528
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' })
517529
map('n', '<leader>td', gs.toggle_deleted, { desc = 'toggle git show deleted' })
518530

519-
-- Text object
520-
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })
531+
-- Fuzzy find all the symbols in your current document.
532+
-- Symbols are things like variables, functions, types, etc.
533+
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
534+
535+
-- Fuzzy find all the symbols in your current workspace.
536+
-- Similar to document symbols, except searches over your entire project.
537+
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
538+
539+
-- Rename the variable under your cursor.
540+
-- Most Language Servers support renaming across files, etc.
541+
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
542+
543+
-- Execute a code action, usually your cursor needs to be on top of an error
544+
-- or a suggestion from your LSP for this to activate.
545+
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
546+
547+
-- WARN: This is not Goto Definition, this is Goto Declaration.
548+
-- For example, in C this would take you to the header.
549+
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
550+
551+
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
552+
---@param client vim.lsp.Client
553+
---@param method vim.lsp.protocol.Method
554+
---@param bufnr? integer some lsp support methods only in specific files
555+
---@return boolean
556+
local function client_supports_method(client, method, bufnr)
557+
if vim.fn.has 'nvim-0.11' == 1 then
558+
return client:supports_method(method, bufnr)
559+
else
560+
return client.supports_method(method, { bufnr = bufnr })
561+
end
562+
end
563+
564+
-- The following two autocommands are used to highlight references of the
565+
-- word under your cursor when your cursor rests there for a little while.
566+
-- See `:help CursorHold` for information about when this is executed
567+
--
568+
-- When you move your cursor, the highlights will be cleared (the second autocommand).
569+
local client = vim.lsp.get_client_by_id(event.data.client_id)
570+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
571+
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
572+
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
573+
buffer = event.buf,
574+
group = highlight_augroup,
575+
callback = vim.lsp.buf.document_highlight,
576+
})
577+
578+
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
579+
buffer = event.buf,
580+
group = highlight_augroup,
581+
callback = vim.lsp.buf.clear_references,
582+
})
583+
584+
vim.api.nvim_create_autocmd('LspDetach', {
585+
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
586+
callback = function(event2)
587+
vim.lsp.buf.clear_references()
588+
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
589+
end,
590+
})
591+
end
592+
593+
-- The following code creates a keymap to toggle inlay hints in your
594+
-- code, if the language server you are using supports them
595+
--
596+
-- This may be unwanted, since they displace some of your code
597+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
598+
map('<leader>th', function()
599+
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
600+
end, '[T]oggle Inlay [H]ints')
601+
end
521602
end,
522603
},
523604
},

lua/kickstart/plugins/gitsigns.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ return {
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)