docs: add distro bootstrap guide
This commit is contained in:
parent
d84d890a1e
commit
912846b235
3 changed files with 95 additions and 38 deletions
86
README.md
86
README.md
|
|
@ -1,49 +1,73 @@
|
|||
# Neovim config
|
||||
|
||||
This repo contains my Neovim configuration only.
|
||||
You still need Neovim installed on the machine.
|
||||
This repo contains my Neovim config only.
|
||||
You still need Neovim and a few system tools installed.
|
||||
|
||||
## Quick start
|
||||
## Fastest setup
|
||||
|
||||
```bash
|
||||
git clone https://git.sailorpunisher.com/sailor/nvim-config.git ~/nvim-config
|
||||
sh ~/nvim-config/install.sh
|
||||
sh ~/nvim-config/bootstrap.sh
|
||||
nvim
|
||||
```
|
||||
|
||||
If `~/.config/nvim` already exists, `install.sh` will back it up and replace it.
|
||||
If it is already this repo, it will just update it with `git pull --ff-only`.
|
||||
`bootstrap.sh` installs the dependencies for your distro, then installs the config.
|
||||
|
||||
## Install Neovim
|
||||
|
||||
### Debian / Ubuntu
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y git neovim
|
||||
```
|
||||
|
||||
### Arch Linux
|
||||
|
||||
```bash
|
||||
sudo pacman -S --needed git neovim
|
||||
```
|
||||
|
||||
### Gentoo
|
||||
|
||||
```bash
|
||||
sudo emerge --ask dev-vcs/git app-editors/neovim
|
||||
```
|
||||
|
||||
## Update later
|
||||
|
||||
Run this from the installed config directory:
|
||||
If you already have the repo cloned and only want to refresh the config:
|
||||
|
||||
```bash
|
||||
sh ~/.config/nvim/install.sh
|
||||
```
|
||||
|
||||
## What gets installed
|
||||
|
||||
- `git`
|
||||
- `neovim`
|
||||
- `nodejs` + `npm` (for Mason / `bashls`)
|
||||
- `ripgrep`
|
||||
- `fd`
|
||||
|
||||
## Debian / Ubuntu
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y git neovim nodejs npm ripgrep fd-find
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
sh ~/nvim-config/bootstrap.sh
|
||||
```
|
||||
|
||||
## Arch Linux
|
||||
|
||||
```bash
|
||||
sudo pacman -S --needed git neovim nodejs npm ripgrep fd
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
sh ~/nvim-config/bootstrap.sh
|
||||
```
|
||||
|
||||
## Gentoo
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/portage/package.use
|
||||
printf '%s\n' 'net-libs/nodejs npm' | sudo tee /etc/portage/package.use/nvim-config-nodejs
|
||||
sudo emerge --ask dev-vcs/git app-editors/neovim net-libs/nodejs sys-apps/ripgrep sys-apps/fd
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
sh ~/nvim-config/bootstrap.sh
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- First run will download plugins through `lazy.nvim`.
|
||||
- First run downloads plugins through `lazy.nvim`.
|
||||
- The config lives in `~/.config/nvim`.
|
||||
- `bashls` is included and should work once `nodejs`/`npm` are installed.
|
||||
|
|
|
|||
31
bootstrap.sh
Executable file
31
bootstrap.sh
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# Install the system packages this config expects, then install the config.
|
||||
set -eu
|
||||
|
||||
repo_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
|
||||
install_deps() {
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y git neovim nodejs npm ripgrep fd-find
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
sudo pacman -S --needed git neovim nodejs npm ripgrep fd
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v emerge >/dev/null 2>&1; then
|
||||
sudo mkdir -p /etc/portage/package.use
|
||||
printf '%s\n' 'net-libs/nodejs npm' | sudo tee /etc/portage/package.use/nvim-config-nodejs >/dev/null
|
||||
sudo emerge --ask dev-vcs/git app-editors/neovim net-libs/nodejs sys-apps/ripgrep sys-apps/fd
|
||||
return
|
||||
fi
|
||||
|
||||
echo 'Unsupported distro: install git, neovim, nodejs/npm, ripgrep, and fd manually.' >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
install_deps
|
||||
sh "$repo_dir/install.sh"
|
||||
|
|
@ -1,3 +1,11 @@
|
|||
local ensure_installed = {
|
||||
"pyright",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"bashls",
|
||||
"lua_ls",
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
|
|
@ -10,13 +18,7 @@ return {
|
|||
dependencies = { "williamboman/mason.nvim" },
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"pyright",
|
||||
"clangd",
|
||||
"rust_analyzer",
|
||||
"bashls",
|
||||
"lua_ls",
|
||||
},
|
||||
ensure_installed = ensure_installed,
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
Loading…
Reference in a new issue