Skip to content

Commit 8b5d48a

Browse files
authored
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 7af594f commit 8b5d48a

File tree

6 files changed

+836
-773
lines changed

6 files changed

+836
-773
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ tags
22
test.sh
33
.luarc.json
44
nvim
5+
6+
spell/
7+
lazy-lock.json

README.md

+53-105
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,73 @@
11
# kickstart.nvim
22

3-
https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b
4-
5-
### Introduction
3+
## Introduction
64

75
A starting point for Neovim that is:
86

97
* Small
10-
* Single-file (with examples of moving to multi-file)
11-
* Documented
12-
* Modular
8+
* Single-file
9+
* Completely Documented
10+
11+
**NOT** a Neovim distribution, but instead a starting point for your configuration.
1312

14-
This repo is meant to be used by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.
13+
## Installation
1514

16-
Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions.
15+
### Install Neovim
1716

18-
Distribution Alternatives:
19-
- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here)
17+
Kickstart.nvim targets *only* the latest
18+
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
19+
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
20+
If you are experiencing issues, please make sure you have the latest versions.
2021

21-
### Installation
22+
### Install External Dependencies
2223

2324
> **NOTE**
2425
> [Backup](#FAQ) your previous configuration (if any exists)
2526
26-
Requirements:
27-
* Make sure to review the readmes of the plugins if you are experiencing errors. In particular:
28-
* [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers.
29-
* See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native`
27+
External Requirements:
28+
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
29+
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
30+
- Language Setup:
31+
- If want to write Typescript, you need `npm`
32+
- If want to write Golang, you will need `go`
33+
- etc.
34+
35+
> **NOTE**
36+
> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes
3037
3138
Neovim's configurations are located under the following paths, depending on your OS:
3239

3340
| OS | PATH |
3441
| :- | :--- |
35-
| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
36-
| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
42+
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
3743
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
3844
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
3945

4046
Clone kickstart.nvim:
4147

42-
- on Linux and Mac
48+
<details><summary> Linux and Mac </summary>
49+
4350
```sh
4451
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
4552
```
4653

47-
- on Windows (cmd)
54+
</details>
55+
56+
<details><summary> Windows </summary>
57+
58+
If you're using `cmd.exe`:
59+
4860
```
4961
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
5062
```
5163

52-
- on Windows (powershell)
64+
If you're using `powershell.exe`
65+
5366
```
5467
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
5568
```
5669

70+
</details>
5771

5872
### Post Installation
5973

@@ -63,37 +77,33 @@ Start Neovim
6377
nvim
6478
```
6579

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.
80+
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
81+
current plugin status.
6782

68-
If you would prefer to hide this step and run the plugin sync from the command line, you can use:
69-
70-
```sh
71-
nvim --headless "+Lazy! sync" +qa
72-
```
83+
Read through the `init.lua` file in your configuration folder for more
84+
information about extending and exploring Neovim.
7385

7486
### Getting Started
7587

76-
See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the previous version. Note: The install via init.lua is outdated, please follow the install instructions in this file instead. An updated video is coming soon.
88+
See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the
89+
previous version. Note: The install via init.lua is outdated, please follow the
90+
install instructions in this file instead. An updated video is coming soon.
7791

7892
### Recommended Steps
7993

80-
[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) and then installing you can install to your machine using the methods above.
94+
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
95+
(so that you have your own copy that you can modify) and then installing you
96+
can install to your machine using the methods above.
8197

8298
> **NOTE**
8399
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
84100
85-
### Configuration And Extension
86-
87-
* Inside of your copy, feel free to modify any file you like! It's your copy!
88-
* Feel free to change any of the default options in `init.lua` to better suit your needs.
89-
* For adding plugins, there are 3 primary options:
90-
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this)
91-
* Modify `init.lua` with additional plugins.
92-
* Include the `lua/kickstart/plugins/*` files in your configuration.
101+
#### Examples of adding popularly requested plugins
93102

94-
You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration.
103+
<details>
104+
<summary>Adding autopairs</summary>
95105

96-
#### Example: Adding an autopairs plugin
106+
This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
97107

98108
In the file: `lua/custom/plugins/autopairs.lua`, add:
99109

@@ -117,10 +127,11 @@ return {
117127
}
118128
```
119129

130+
</details>
131+
<details>
132+
<summary>Adding a file tree plugin</summary>
120133

121-
This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
122-
123-
#### Example: Adding a file tree plugin
134+
This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
124135

125136
In the file: `lua/custom/plugins/filetree.lua`, add:
126137

@@ -142,23 +153,13 @@ return {
142153
}
143154
```
144155

145-
This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
146-
147-
### Contribution
148-
149-
Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included:
150-
151-
* Custom language server configuration (null-ls templates)
152-
* Theming beyond a default colorscheme necessary for LSP highlight groups
153-
154-
Each PR, especially those which increase the line count, should have a description as to why the PR is necessary.
156+
</details>
155157

156158
### FAQ
157159

158160
* What should I do if I already have a pre-existing neovim configuration?
159161
* You should back it up, then delete all files associated with it.
160162
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
161-
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
162163
* Can I keep my existing configuration in parallel to kickstart?
163164
* 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:
164165
```
@@ -191,56 +192,3 @@ This requires:
191192
```lua
192193
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
193194
```
194-
195-
### Hints And Tips For New Neovimmers
196-
197-
Neovim is a very rich and powerful environment, but it can also feel a bit
198-
intimidating for new users trying to find their way around, especially if
199-
they're coming from other environments like Visual Studio Code or a traditional
200-
IDE.
201-
202-
There's no way this README can provide you with everything you need to know, but
203-
here are a few tips so you can learn how to learn.
204-
205-
### Use The Help, Luke!
206-
207-
Neovim's help system is incredibly thorough and extensive. You should really
208-
take a moment to get comfortable navigating through help topics, going back and
209-
forth, navigating the menus, etc. This won't just help you read the help, it
210-
will empower you in the rest of your Neovim journey.
211-
212-
You can double click on a topic to drill down, and hit Ctrl-o (Hold down the
213-
Control key and the 'o' key) to go back.
214-
215-
Read the first page you get when you run :help carefully. it will serve you
216-
well.
217-
218-
You can also get help on a particular thing by typing ":help <topic>".
219-
220-
Like, let's say we want to learn more about folding, just type ":help folding".
221-
222-
### To The Telescope!
223-
224-
One of the more powerful features you get by installing this project is the
225-
brilliant Telescope plugin co-written by @tjdevries.
226-
227-
Take a minute to browse through ":help telescope" and get a sense for all the
228-
amazing superpowers you've gained.
229-
230-
In particular, there are two Telescope features that are incredible for helping
231-
you understand how to do a particular thing or how to configure a particular
232-
feature.
233-
234-
If you're not sure what to look for, try ":Telescope help_tags". Let's say we
235-
want to configure Neovim to automatically word wrap. We might type ":Telescope
236-
help_tags" and then type w, r, a, p. Notice how the list of results changes with
237-
each new letter you type? When you're done you've got a screen full of topics
238-
involving word wrap.
239-
240-
Another common question is "What keys do I hit to make a thing happen?". To get
241-
an answer, one way is to use ":Telescope keymaps". You'll get the same list of
242-
results that changes to adapt with each new key you press.
243-
244-
With these hints in mind you should be in good shape to get learning. Remember,
245-
you are on a journey of discovery here, adapting your programming environment to
246-
your needs. It will take effort, but the rewards are worth it! :)

0 commit comments

Comments
 (0)