summaryrefslogtreecommitdiff
path: root/nvim/README.md
blob: e48c283888dfb308444eace4092c9512294c6c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Neovim configuration

This folder contains a Neovim editor configuration.

## Structure

The configuration consists of a main Lua configuration file `init.lua`, this
`README.md` and a `pack` folder with Neovim packages from third parties.

```
.
├── init.lua
├── pack
│   ├── <vendor>           // <vendor> can be selected arbitrarily
│   │   └── start
│   │       └── <package>  // Git submodule, could be one of many in this folder
└── README.md
```

All packages are Git submodules and contain third party code to extend the
editor.

## Installation

This configuration requires the following software to be installed:

- Neovim in a recent version
- Ripgrep
- Language Server Protocol Servers
    - clangd
    - pyright
    - gopls

### Neovim

This configuration requires a recent version of Neovim and was tested with
version `v0.9.5`. If only older versions are provided by the distribution a
newer version can be installed as AppImage.

```
mkdir -p ~/.local/bin
curl https://github.com/neovim/neovim/releases/download/v0.9.5/nvim.appimage \
    > ~/.local/bin/nvim
chmod 755 ~/.local/bin/nvim
PATH=~/.local/bin:$PATH  # add this line to shell config (e.g. .bashrc)
                         # to be permanent
```

`which` can be used to validate that the current shell uses the just downloaded
AppImage.

```
$ which nvim
/home/<user>/.local/bin/nvim
```

The Neovim version can be checked with `nvim` itself.

```
$ nvim --version
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

          System-vimrc-Datei: "$VIM/sysinit.vim"
     Voreinstellung für $VIM: "/usr/share/nvim"

Run :checkhealth for more info
```

### Ripgrep

The program Ripgrep or `rg` is required for this configuration to work. It can
be installed on most Linux distributions using the package manager:

- Arch Linux: `pacman -S ripgrep`
- Debian Linux: `apt install ripgrep`

Ripgrep is used for the package `telescope` to search for keywords with good
performance even in huge file trees.

### LSP Servers

The LSP servers can be installed with the package manager too:

- Arch Linux: `pacman -S clang pyright gopls`
- Debian Linux: `apt install clangd gopls`

**Note for Debian**: `pyright` is not available. But the Debian package
`python3-pylsp` works too. `pyright` has to be replaced by `pylsp` in
`init.lua`.