Skip to content

Commit 91e6645

Browse files
tjdevriesmarryton007
authored andcommitted
rewrite: slimmer, trimmer and more lazy kickstart.nvim (nvim-lua#635)
We've removed over 1/3 of the code that was in kickstart previously, and more than doubled the amount of comments explaining every line of code (to the best of my ability). kickstart now properly uses many of the lazy.nvim config and loading idioms, which should be really helpful for people moving both to modular configs, as well as extending the kickstart config in one file. Additional features: - Beautiful ascii art - Added some documentation that explains what is an LSP, what is telescope, etc - There is now a `:checkhealth` for kickstart, which checks some basic information and adds useful information for maintainers (for people cloning the repo). - Improved LSP configuration and tool installation, for easier first time startup - Changed init.lua ordering, so that it moves from simple options to complicated config ``` ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Lua 1 108 404 298 ------------------------------------------------------------------------------- ```
1 parent 4e3e6ed commit 91e6645

File tree

3 files changed

+55
-16
lines changed

3 files changed

+55
-16
lines changed

README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ nvim
9898

9999
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
100100
current plugin status. Hit `q` to close the window.
101-
102101
Read through the `init.lua` file in your configuration folder for more
103102
information about extending and exploring Neovim. That also includes
104103
examples of adding popularly requested plugins.
@@ -107,6 +106,14 @@ examples of adding popularly requested plugins.
107106
### Getting Started
108107

109108
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
109+
previous version. Note: The install via init.lua is outdated, please follow the
110+
install instructions in this file instead. An updated video is coming soon.
111+
(so that you have your own copy that you can modify) and then installing you
112+
can install to your machine using the methods above.
113+
<summary>Adding autopairs</summary>
114+
</details>
115+
<details>
116+
<summary>Adding a file tree plugin</summary>
110117

111118
### FAQ
112119

@@ -162,22 +169,19 @@ This requires:
162169
<details><summary>Windows with gcc/make using chocolatey</summary>
163170
Alternatively, one can install gcc and make which don't require changing the config,
164171
the easiest way is to use choco:
165-
166172
1. install [chocolatey](https://chocolatey.org/install)
167173
either follow the instructions on the page or use winget,
168174
run in cmd as **admin**:
169175
```
170176
winget install --accept-source-agreements chocolatey.chocolatey
171177
```
172-
173178
2. install all requirements using choco, exit previous cmd and
174179
open a new one so that choco path is set, and run in cmd as **admin**:
175180
```
176181
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
177182
```
178183
</details>
179184
<details><summary>WSL (Windows Subsystem for Linux)</summary>
180-
181185
```
182186
wsl --install
183187
wsl
@@ -186,44 +190,35 @@ sudo apt update
186190
sudo apt install make gcc ripgrep unzip git xclip neovim
187191
```
188192
</details>
189-
190193
#### Linux Install
191194
<details><summary>Ubuntu Install Steps</summary>
192-
193195
```
194196
sudo add-apt-repository ppa:neovim-ppa/unstable -y
195197
sudo apt update
196198
sudo apt install make gcc ripgrep unzip git xclip neovim
197199
```
198200
</details>
199201
<details><summary>Debian Install Steps</summary>
200-
201202
```
202203
sudo apt update
203204
sudo apt install make gcc ripgrep unzip git xclip curl
204-
205205
# Now we install nvim
206206
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
207207
sudo rm -rf /opt/nvim-linux64
208208
sudo mkdir -p /opt/nvim-linux64
209209
sudo chmod a+rX /opt/nvim-linux64
210210
sudo tar -C /opt -xzf nvim-linux64.tar.gz
211-
212211
# make it available in /usr/local/bin, distro installs to /usr/bin
213212
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
214213
```
215214
</details>
216215
<details><summary>Fedora Install Steps</summary>
217-
218216
```
219217
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
220218
```
221219
</details>
222-
223220
<details><summary>Arch Install Steps</summary>
224-
225221
```
226222
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
227223
```
228224
</details>
229-

init.lua

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ if not vim.loop.fs_stat(lazypath) then
212212
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
213213
end ---@diagnostic disable-next-line: undefined-field
214214
vim.opt.rtp:prepend(lazypath)
215+
-- :Lazy update
216+
--
217+
-- NOTE: Here is where you install your plugins.
218+
require('lazy').setup({
215219

216220
-- [[ Configure and install plugins ]]
217221
--
@@ -476,11 +480,26 @@ require('lazy').setup({
476480
-- Jump to the implementation of the word under your cursor.
477481
-- Useful when your language has ways of declaring types without an actual implementation.
478482
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
483+
-- the definition of its *type*, not where it was *defined*.
484+
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
485+
486+
-- Fuzzy find all the symbols in your current document.
487+
-- Symbols are things like variables, functions, types, etc.
488+
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
489+
490+
-- Fuzzy find all the symbols in your current workspace
491+
-- Similar to document symbols, except searches over your whole project.
492+
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
493+
494+
-- Rename the variable under your cursor
495+
-- Most Language Servers support renaming across files, etc.
496+
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
479497

480498
-- Jump to the type of the word under your cursor.
481499
-- Useful when you're not sure what type a variable is and you want to see
482500
-- the definition of its *type*, not where it was *defined*.
483501
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
502+
-- Opens a popup that displays documentation about the word under your cursor
484503

485504
-- Fuzzy find all the symbols in your current document.
486505
-- Symbols are things like variables, functions, types, etc.
@@ -586,6 +605,15 @@ require('lazy').setup({
586605
completion = {
587606
callSnippet = 'Replace',
588607
},
608+
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
609+
-- for your neovim configuration.
610+
library = {
611+
'${3rd}/luv/library',
612+
unpack(vim.api.nvim_get_runtime_file('', true)),
613+
},
614+
-- If lua_ls is really slow on your computer, you can try this instead:
615+
-- library = { vim.env.VIMRUNTIME },
616+
},
589617
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
590618
-- diagnostics = { disable = { 'missing-fields' } },
591619
},
@@ -620,6 +648,7 @@ require('lazy').setup({
620648
require('lspconfig')[server_name].setup(server)
621649
end,
622650
},
651+
capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}),
623652
}
624653
end,
625654
},
@@ -697,6 +726,21 @@ require('lazy').setup({
697726
'hrsh7th/cmp-nvim-lsp',
698727
'hrsh7th/cmp-path',
699728
},
729+
config = function()
730+
'saadparwaiz1/cmp_luasnip',
731+
732+
-- Adds other completion capabilities.
733+
-- nvim-cmp does not ship with all sources by default. They are split
734+
-- into multiple repos for maintenance purposes.
735+
'hrsh7th/cmp-nvim-lsp',
736+
'hrsh7th/cmp-path',
737+
738+
-- If you want to add a bunch of pre-configured snippets,
739+
-- you can use this plugin to help you. It even has snippets
740+
-- for various frameworks/libraries/etc. but you will have to
741+
-- set up the ones that are useful for you.
742+
-- 'rafamadriz/friendly-snippets',
743+
},
700744
config = function()
701745
-- See `:help cmp`
702746
local cmp = require 'cmp'

lua/kickstart/health.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
--]]
77

88
local check_version = function()
9-
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
10-
if not vim.version.cmp then
9+
local verstr = tostring(vim.version())
10+
if not vim.version.ge then
1111
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
1212
return
1313
end
1414

15-
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
15+
if vim.version.ge(vim.version(), '0.10-dev') then
1616
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
1717
else
1818
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))

0 commit comments

Comments
 (0)