Skip to content

Commit

Permalink
rewrite: slimmer, trimmer and more lazy kickstart.nvim (nvim-lua#635)
Browse files Browse the repository at this point in the history
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
-------------------------------------------------------------------------------
```
  • Loading branch information
tjdevries authored and smCloudInTheSky committed May 26, 2024
1 parent 3ecaf22 commit e700fcd
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 510 deletions.
172 changes: 100 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ External Requirements:
> **NOTE**
> [Backup](#FAQ) your previous configuration (if any exists)
<<<<<<< HEAD
=======
External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
- Language Setup:
- If want to write Typescript, you need `npm`
- If want to write Golang, you will need `go`
- etc.

> **NOTE**
> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes
>>>>>>> afa29b0 (rewrite: slimmer, trimmer and more lazy kickstart.nvim (#635))
Neovim's configurations are located under the following paths, depending on your OS:

| OS | PATH |
Expand All @@ -66,6 +80,11 @@ fork to your machine using one of the commands below, depending on your OS.
<details><summary> Linux and Mac </summary>

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

>>>>>>> afa29b0 (rewrite: slimmer, trimmer and more lazy kickstart.nvim (#635))
```sh
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```
Expand Down Expand Up @@ -97,6 +116,7 @@ nvim
```

That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
<<<<<<< HEAD
current plugin status. Hit `q` to close the window.

Read through the `init.lua` file in your configuration folder for more
Expand All @@ -107,13 +127,90 @@ examples of adding popularly requested plugins.
### Getting Started

[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
=======
current plugin status.

Read through the `init.lua` file in your configuration folder for more
information about extending and exploring Neovim.

### Getting Started

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.

### Recommended Steps

[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.

> **NOTE**
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
#### Examples of adding popularly requested plugins

<details>
<summary>Adding autopairs</summary>

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).

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

```lua
-- File: lua/custom/plugins/autopairs.lua

return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}
```

</details>
<details>
<summary>Adding a file tree plugin</summary>

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.

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

```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])

return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function ()
require('neo-tree').setup {}
end,
}
```

</details>
>>>>>>> afa29b0 (rewrite: slimmer, trimmer and more lazy kickstart.nvim (#635))
### FAQ

* 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/`
* 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/`
* 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
Expand Down Expand Up @@ -158,72 +255,3 @@ This requires:
```lua
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
```
</details>
<details><summary>Windows with gcc/make using chocolatey</summary>
Alternatively, one can install gcc and make which don't require changing the config,
the easiest way is to use choco:

1. install [chocolatey](https://chocolatey.org/install)
either follow the instructions on the page or use winget,
run in cmd as **admin**:
```
winget install --accept-source-agreements chocolatey.chocolatey
```

2. install all requirements using choco, exit 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
```
</details>
<details><summary>WSL (Windows Subsystem for Linux)</summary>

```
wsl --install
wsl
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep unzip git xclip neovim
```
</details>

#### Linux Install
<details><summary>Ubuntu Install Steps</summary>

```
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep unzip git xclip neovim
```
</details>
<details><summary>Debian Install Steps</summary>

```
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
# make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
```
</details>
<details><summary>Fedora Install Steps</summary>

```
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
```
</details>

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

```
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
```
</details>

Loading

0 comments on commit e700fcd

Please sign in to comment.