Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e84e187
Fix README.md grammar and typos (#1291)
feketegy Dec 29, 2024
7ddaab3
chore: add pre-issue requirements (#1288)
iton0 Dec 29, 2024
a8f5395
Fix which-key delay settings (#1276)
jensenr30 Dec 29, 2024
db4867a
fix: prevent mason setup from being run twice (#1298)
tomasgareau Jan 7, 2025
f6abf68
chore: remove redundant comment (#1307)
nhld Jan 15, 2025
ff89769
chore: fix typo in bug report issue template (#1306)
nhld Jan 15, 2025
5bdde24
Use luals 3rd library for luv (#1303)
diorman Jan 15, 2025
abdbfce
chore(docs): Update README.md (#1344)
rnevius Feb 15, 2025
71ad926
docs: clarify using opts = {} vs config = function() ... require('plu…
bleacheda Feb 15, 2025
94f551b
fix (#1319): gitsigns deprecated functions (#1321)
ErlanRG Feb 15, 2025
d2c0068
Add a blurb about installing missing emoji on Ubuntu
feoh Feb 17, 2025
db78c0b
fix: arguments for the `vim.lsp.Client.supports_method` method (#1356)
jrentlez Feb 17, 2025
76e06fe
feat(diagnostic): add diagnostic config (#1335)
gelocraft Feb 17, 2025
ebca680
perf: load tokyonight.nvim in the intended way (#1360)
warbacon Feb 18, 2025
282cbb9
feat: add basic function signature help (#1358)
rfletchr Feb 18, 2025
7c49ba1
Fix: fix the cmp-nvim-lsp-signature-help link (#1363)
aryan-rajoria Feb 18, 2025
e64aa51
fix: regression introduced in db78c0b217fd9525e2cbcbffd18abbbbddc75b2…
jrentlez Feb 18, 2025
ea60b2b
Remove duplicate cmp-path (#1369)
aripollak Feb 19, 2025
34e7d29
Propsed fix for init.lua warnings as per https://github.com/nvim-lua/…
feoh Feb 19, 2025
7ed7500
Merge remote-tracking branch 'upstream/master' into master-merge
andreiblt1304 Feb 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ assignees: ''

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

## Before Reporting an Issue
- I have read the kickstart.nvim README.md.
- I have read the appropriate plugin's documentation.
- I have searched that this issue has not been reported before.

- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**

## Describe the bug
<!-- A clear and concise description of what the bug is. -->

Expand All @@ -18,8 +25,8 @@ assignees: ''

## Desktop
<!-- please complete the following information. -->
- OS:
- Terminal:
- OS:
- Terminal:

## Neovim Version
<!-- Output of running `:version` from inside of neovim. -->
Expand Down
56 changes: 39 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,26 @@ Neovim's configurations are located under the following paths, depending on your
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |

Clone kickstart.nvim:
#### Recommended Step

[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
so that you have your own copy that you can modify, then install by cloning the
fork to your machine using one of the commands below, depending on your OS.

> **NOTE**
> Your fork's URL will be something like this:
> `https://github.com/<your_github_username>/kickstart.nvim.git`

You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
too - it's ignored in the kickstart repo to make maintenance easier, but it's
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).

#### Clone kickstart.nvim
> **NOTE**
> If following the recommended step above (i.e., forking the repo), replace
> `nvim-lua` with `<your_github_username>` in the commands below

<details><summary> Linux and Mac </summary>

- on Linux and Mac
```sh
Expand All @@ -63,15 +82,18 @@ Start Neovim
nvim
```

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.
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
the current plugin status. Hit `q` to close the window.

#### Read The Friendly Documentation

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

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


### Getting Started

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

### FAQ

* What should I do if I already have a pre-existing neovim configuration?
* You should back it up, then delete all files associated with it.
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
* What should I do if I already have a pre-existing Neovim configuration?
* You should back it up and then delete all associated files.
* This includes your existing init.lua and the Neovim files in `~/.local`
which can be deleted with `rm -rf ~/.local/share/nvim/`
* Can I keep my existing configuration in parallel to kickstart?
* 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:
```
Expand All @@ -100,7 +122,7 @@ Each PR, especially those which increase the line count, should have a descripti
* The main purpose of kickstart is to serve as a teaching tool and a reference
configuration that someone can easily `git clone` as a basis for their own.
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
into smaller parts. A fork of kickstart that does this while maintaining the exact
into smaller parts. A fork of kickstart that does this while maintaining the
same functionality is available here:
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
* Discussions on this topic can be found here:
Expand Down Expand Up @@ -132,7 +154,7 @@ run in cmd as **admin**:
winget install --accept-source-agreements chocolatey.chocolatey
```

2. install all requirements using choco, exit previous cmd and
2. install all requirements using choco, exit the previous cmd and
open a new one so that choco path is set, and run in cmd as **admin**:
```
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
Expand Down Expand Up @@ -165,14 +187,14 @@ sudo apt update
sudo apt install make gcc ripgrep unzip git xclip curl

# Now we install nvim
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim-linux64
sudo mkdir -p /opt/nvim-linux64
sudo chmod a+rX /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux64.tar.gz
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim-linux-x86_64
sudo mkdir -p /opt/nvim-linux-x86_64
sudo chmod a+rX /opt/nvim-linux-x86_64
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz

# make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
```
</details>
<details><summary>Fedora Install Steps</summary>
Expand Down
93 changes: 87 additions & 6 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ vim.opt.signcolumn = 'yes'
vim.opt.updatetime = 250

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

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

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

-- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })
-- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc.
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')

-- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')

-- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')

-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })

-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')

-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
---@param client vim.lsp.Client
---@param method vim.lsp.protocol.Method
---@param bufnr? integer some lsp support methods only in specific files
---@return boolean
local function client_supports_method(client, method, bufnr)
if vim.fn.has 'nvim-0.11' == 1 then
return client:supports_method(method, bufnr)
else
return client.supports_method(method, { bufnr = bufnr })
end
end

-- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while.
-- See `:help CursorHold` for information about when this is executed
--
-- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})

vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
end,
})
end

-- The following code creates a keymap to toggle inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints')
end
end,
},
},
Expand Down
4 changes: 2 additions & 2 deletions lua/kickstart/plugins/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ return {
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
Expand All @@ -54,7 +54,7 @@ return {
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
end,
},
},
Expand Down
Loading