Skip to content

Commit 105e689

Browse files
authored
Merge branch 'master' into master
2 parents 15284a0 + 0619d89 commit 105e689

11 files changed

Lines changed: 245 additions & 211 deletions

File tree

.github/workflows/stylua.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout Code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v6
1313
with:
1414
ref: ${{ github.event.pull_request.head.sha }}
1515
- name: Stylua Check
16-
uses: JohnnyMorganz/stylua-action@v3
16+
uses: JohnnyMorganz/stylua-action@v4
1717
with:
1818
token: ${{ secrets.GITHUB_TOKEN }}
1919
version: latest
2020
args: --check .
21-

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ nvim
55

66
spell/
77

8-
# You can uncomment this yourself if you want to lock the lazy-lock.json,
9-
# but for kickstart, it makes sense to leave it ignored.
10-
#lazy-lock.json
8+
# In your personal fork, you likely want to comment this, since it's recommended to track
9+
# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile
10+
# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
11+
# merge conflicts.
12+
lazy-lock.json
1113

1214
.DS_Store

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ External Requirements:
3232
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
3333
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
3434
[fd-find](https://github.com/sharkdp/fd#installation)
35+
- [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md#installation)
3536
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
3637
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
3738
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
@@ -192,7 +193,7 @@ winget install --accept-source-agreements chocolatey.chocolatey
192193
2. install all requirements using choco, exit the previous cmd and
193194
open a new one so that choco path is set, and run in cmd as **admin**:
194195
```
195-
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
196+
choco install -y neovim git ripgrep wget fd unzip gzip mingw make tree-sitter
196197
```
197198
</details>
198199
<details><summary>WSL (Windows Subsystem for Linux)</summary>
@@ -202,7 +203,7 @@ wsl --install
202203
wsl
203204
sudo add-apt-repository ppa:neovim-ppa/unstable -y
204205
sudo apt update
205-
sudo apt install make gcc ripgrep unzip git xclip neovim
206+
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
206207
```
207208
</details>
208209

@@ -212,14 +213,14 @@ sudo apt install make gcc ripgrep unzip git xclip neovim
212213
```
213214
sudo add-apt-repository ppa:neovim-ppa/unstable -y
214215
sudo apt update
215-
sudo apt install make gcc ripgrep unzip git xclip neovim
216+
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
216217
```
217218
</details>
218219
<details><summary>Debian Install Steps</summary>
219220

220221
```
221222
sudo apt update
222-
sudo apt install make gcc ripgrep unzip git xclip curl
223+
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip curl
223224
224225
# Now we install nvim
225226
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
@@ -235,14 +236,14 @@ sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
235236
<details><summary>Fedora Install Steps</summary>
236237

237238
```
238-
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
239+
sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim
239240
```
240241
</details>
241242

242243
<details><summary>Arch Install Steps</summary>
243244

244245
```
245-
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
246+
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd tree-sitter-cli unzip neovim
246247
```
247248
</details>
248249

@@ -261,7 +262,7 @@ available methods being discussed
261262
<details><summary>Bob</summary>
262263

263264
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
264-
all plattforms. Simply install
265+
all platforms. Simply install
265266
[rustup](https://rust-lang.github.io/rustup/installation/other.html),
266267
and run the following commands:
267268

init.lua

Lines changed: 97 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
119119
-- Enable break indent
120120
vim.o.breakindent = true
121121

122-
-- Save undo history
122+
-- Enable undo/redo changes even after closing and reopening a file
123123
vim.o.undofile = true
124124

125125
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
@@ -177,11 +177,11 @@ vim.diagnostic.config {
177177
update_in_insert = false,
178178
severity_sort = true,
179179
float = { border = 'rounded', source = 'if_many' },
180-
underline = { severity = vim.diagnostic.severity.ERROR },
180+
underline = { severity = { min = vim.diagnostic.severity.WARN } },
181181

182182
-- Can switch between these as you prefer
183183
virtual_text = true, -- Text shows up at the end of the line
184-
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
184+
virtual_lines = false, -- Text shows up underneath the line, with virtual lines
185185

186186
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
187187
jump = { float = true },
@@ -275,13 +275,16 @@ require('lazy').setup({
275275
-- See `:help gitsigns` to understand what the configuration keys do
276276
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
277277
'lewis6991/gitsigns.nvim',
278+
---@module 'gitsigns'
279+
---@type Gitsigns.Config
280+
---@diagnostic disable-next-line: missing-fields
278281
opts = {
279282
signs = {
280-
add = { text = '+' },
281-
change = { text = '~' },
282-
delete = { text = '_' },
283-
topdelete = { text = '' },
284-
changedelete = { text = '~' },
283+
add = { text = '+' }, ---@diagnostic disable-line: missing-fields
284+
change = { text = '~' }, ---@diagnostic disable-line: missing-fields
285+
delete = { text = '_' }, ---@diagnostic disable-line: missing-fields
286+
topdelete = { text = '' }, ---@diagnostic disable-line: missing-fields
287+
changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields
285288
},
286289
},
287290
},
@@ -303,6 +306,9 @@ require('lazy').setup({
303306
{ -- Useful plugin to show you pending keybinds.
304307
'folke/which-key.nvim',
305308
event = 'VimEnter',
309+
---@module 'which-key'
310+
---@type wk.Opts
311+
---@diagnostic disable-next-line: missing-fields
306312
opts = {
307313
-- delay between pressing a key and opening which-key (milliseconds)
308314
delay = 0,
@@ -312,7 +318,8 @@ require('lazy').setup({
312318
spec = {
313319
{ '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
314320
{ '<leader>t', group = '[T]oggle' },
315-
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
321+
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first
322+
{ 'gr', group = 'LSP Actions', mode = { 'n' } },
316323
},
317324
},
318325
},
@@ -480,14 +487,19 @@ require('lazy').setup({
480487
-- Automatically install LSPs and related tools to stdpath for Neovim
481488
-- Mason must be loaded before its dependents so we need to set it up here.
482489
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
483-
{ 'mason-org/mason.nvim', opts = {} },
490+
{
491+
'mason-org/mason.nvim',
492+
---@module 'mason.settings'
493+
---@type MasonSettings
494+
---@diagnostic disable-next-line: missing-fields
495+
opts = {},
496+
},
497+
-- Maps LSP server names between nvim-lspconfig and Mason package names.
498+
'mason-org/mason-lspconfig.nvim',
484499
'WhoIsSethDaniel/mason-tool-installer.nvim',
485500

486501
-- Useful status updates for LSP.
487502
{ 'j-hui/fidget.nvim', opts = {} },
488-
489-
-- Allows extra capabilities provided by blink.cmp
490-
'saghen/blink.cmp',
491503
},
492504
config = function()
493505
-- Brief aside: **What is LSP?**
@@ -583,15 +595,10 @@ require('lazy').setup({
583595
end,
584596
})
585597

586-
-- LSP servers and clients are able to communicate to each other what features they support.
587-
-- By default, Neovim doesn't support everything that is in the LSP specification.
588-
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
589-
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
590-
local capabilities = require('blink.cmp').get_lsp_capabilities()
591-
592598
-- Enable the following language servers
593599
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
594600
-- See `:help lsp-config` for information about keys and how to configure
601+
---@type table<string, vim.lsp.Config>
595602
local servers = {
596603
-- clangd = {},
597604
-- gopls = {},
@@ -603,6 +610,37 @@ require('lazy').setup({
603610
--
604611
-- But for many setups, the LSP (`ts_ls`) will work just fine
605612
-- ts_ls = {},
613+
614+
stylua = {}, -- Used to format Lua code
615+
616+
-- Special Lua Config, as recommended by neovim help docs
617+
lua_ls = {
618+
on_init = function(client)
619+
if client.workspace_folders then
620+
local path = client.workspace_folders[1].name
621+
if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end
622+
end
623+
624+
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
625+
runtime = {
626+
version = 'LuaJIT',
627+
path = { 'lua/?.lua', 'lua/?/init.lua' },
628+
},
629+
workspace = {
630+
checkThirdParty = false,
631+
-- NOTE: this is a lot slower and will cause issues when working on your own configuration.
632+
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
633+
library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), {
634+
'${3rd}/luv/library',
635+
'${3rd}/busted/library',
636+
}),
637+
},
638+
})
639+
end,
640+
settings = {
641+
Lua = {},
642+
},
643+
},
606644
}
607645

608646
-- Ensure the servers and tools above are installed
@@ -614,45 +652,15 @@ require('lazy').setup({
614652
-- You can press `g?` for help in this menu.
615653
local ensure_installed = vim.tbl_keys(servers or {})
616654
vim.list_extend(ensure_installed, {
617-
'lua_ls', -- Lua Language server
618-
'stylua', -- Used to format Lua code
619655
-- You can add other tools here that you want Mason to install
620656
})
621657

622658
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
623659

624660
for name, server in pairs(servers) do
625-
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
626661
vim.lsp.config(name, server)
627662
vim.lsp.enable(name)
628663
end
629-
630-
-- Special Lua Config, as recommended by neovim help docs
631-
vim.lsp.config('lua_ls', {
632-
on_init = function(client)
633-
if client.workspace_folders then
634-
local path = client.workspace_folders[1].name
635-
if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end
636-
end
637-
638-
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
639-
runtime = {
640-
version = 'LuaJIT',
641-
path = { 'lua/?.lua', 'lua/?/init.lua' },
642-
},
643-
workspace = {
644-
checkThirdParty = false,
645-
-- NOTE: this is a lot slower and will cause issues when working on your own configuration.
646-
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
647-
library = vim.api.nvim_get_runtime_file('', true),
648-
},
649-
})
650-
end,
651-
settings = {
652-
Lua = {},
653-
},
654-
})
655-
vim.lsp.enable 'lua_ls'
656664
end,
657665
},
658666

@@ -668,6 +676,8 @@ require('lazy').setup({
668676
desc = '[F]ormat buffer',
669677
},
670678
},
679+
---@module 'conform'
680+
---@type conform.setupOpts
671681
opts = {
672682
notify_on_error = false,
673683
format_on_save = function(bufnr)
@@ -725,8 +735,8 @@ require('lazy').setup({
725735
opts = {},
726736
},
727737
},
728-
--- @module 'blink.cmp'
729-
--- @type blink.cmp.Config
738+
---@module 'blink.cmp'
739+
---@type blink.cmp.Config
730740
opts = {
731741
keymap = {
732742
-- 'default' (recommended) for mappings similar to built-in completions
@@ -811,7 +821,15 @@ require('lazy').setup({
811821
},
812822

813823
-- Highlight todo, notes, etc in comments
814-
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
824+
{
825+
'folke/todo-comments.nvim',
826+
event = 'VimEnter',
827+
dependencies = { 'nvim-lua/plenary.nvim' },
828+
---@module 'todo-comments'
829+
---@type TodoOptions
830+
---@diagnostic disable-next-line: missing-fields
831+
opts = { signs = false },
832+
},
815833

816834
{ -- Collection of various small independent plugins/modules
817835
'nvim-mini/mini.nvim',
@@ -851,12 +869,33 @@ require('lazy').setup({
851869

852870
{ -- Highlight, edit, and navigate code
853871
'nvim-treesitter/nvim-treesitter',
872+
lazy = false,
873+
build = ':TSUpdate',
874+
branch = 'main',
875+
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
854876
config = function()
855-
local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
856-
require('nvim-treesitter').install(filetypes)
877+
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
878+
require('nvim-treesitter').install(parsers)
857879
vim.api.nvim_create_autocmd('FileType', {
858-
pattern = filetypes,
859-
callback = function() vim.treesitter.start() end,
880+
callback = function(args)
881+
local buf, filetype = args.buf, args.match
882+
883+
local language = vim.treesitter.language.get_lang(filetype)
884+
if not language then return end
885+
886+
-- check if parser exists and load it
887+
if not vim.treesitter.language.add(language) then return end
888+
-- enables syntax highlighting and other treesitter features
889+
vim.treesitter.start(buf, language)
890+
891+
-- enables treesitter based folds
892+
-- for more info on folds see `:help folds`
893+
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
894+
-- vim.wo.foldmethod = 'expr'
895+
896+
-- enables treesitter based indentation
897+
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
898+
end,
860899
})
861900
end,
862901
},
@@ -875,7 +914,7 @@ require('lazy').setup({
875914
-- require 'kickstart.plugins.lint',
876915
-- require 'kickstart.plugins.autopairs',
877916
-- require 'kickstart.plugins.neo-tree',
878-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
917+
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
879918

880919
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
881920
-- This is the easiest way to modularize your config.
@@ -887,7 +926,7 @@ require('lazy').setup({
887926
-- Or use telescope!
888927
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
889928
-- you can continue same window with `<space>sr` which resumes last telescope search
890-
}, {
929+
}, { ---@diagnostic disable-line: missing-fields
891930
ui = {
892931
-- If you are using a Nerd Font: set icons to an empty table which will use the
893932
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table

lua/custom/plugins/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
-- I promise not to create any merge conflicts in this directory :)
33
--
44
-- See the kickstart.nvim README for more information
5+
6+
---@module 'lazy'
7+
---@type LazySpec
58
return {}

lua/kickstart/plugins/autopairs.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
-- autopairs
22
-- https://github.com/windwp/nvim-autopairs
33

4+
---@module 'lazy'
5+
---@type LazySpec
46
return {
57
'windwp/nvim-autopairs',
68
event = 'InsertEnter',

0 commit comments

Comments
 (0)