aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-07-04 17:51:48 +0800
committerjdhao <jdhao@hotmail.com>2021-07-04 17:54:30 +0800
commitf9484a662366ab235c8fb3a821df9a0a13289441 (patch)
tree897ee2f2e0426337a9772f803961e7621c5fbd3d /docs
parent896e13291c9b1688a7703f05f81cfa7f9122a6f4 (diff)
Update doc and install script
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/Nvim_setup.sh11
-rw-r--r--docs/README.md57
2 files changed, 26 insertions, 42 deletions
diff --git a/docs/Nvim_setup.sh b/docs/Nvim_setup.sh
index 5edb844..cf793d6 100755
--- a/docs/Nvim_setup.sh
+++ b/docs/Nvim_setup.sh
@@ -130,7 +130,7 @@ if [[ ! -f "$CTAGS_DIR/bin/ctags" ]]; then
rm -rf "$CTAGS_SRC_DIR"
fi
- git clone "$CTAGS_LINK" "$CTAGS_SRC_DIR" && cd "$CTAGS_SRC_DIR"
+ git clone --depth=1 "$CTAGS_LINK" "$CTAGS_SRC_DIR" && cd "$CTAGS_SRC_DIR"
./autogen.sh && ./configure --prefix="$CTAGS_DIR"
make -j && make install
@@ -176,12 +176,13 @@ if [[ -d "$NVIM_CONFIG_DIR" ]]; then
mv "$NVIM_CONFIG_DIR" "$NVIM_CONFIG_DIR.backup"
fi
-git clone https://github.com/jdhao/nvim-config.git "$NVIM_CONFIG_DIR"
+git clone --depth=1 https://github.com/jdhao/nvim-config.git "$NVIM_CONFIG_DIR"
-echo "Installing vim-plug"
-curl -fLo "$NVIM_SITE_DIR/autoload/plug.vim" --create-dirs https://cdn.jsdelivr.net/gh/junegunn/vim-plug/plug.vim
+echo "Installing packer.nvim"
+git clone --depth=1 https://github.com/wbthomason/packer.nvim \
+ ~/.local/share/nvim/site/pack/packer/start/packer.nvim
echo "Installing plugins"
-"$NVIM_DIR/bin/nvim" +PlugInstall +qall
+"$NVIM_DIR/bin/nvim" +PackerInstall +qall
echo "Finished installing Neovim and its dependencies!"
diff --git a/docs/README.md b/docs/README.md
index 5bf12ed..432b997 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -7,10 +7,8 @@ and development work.
A lot of Neovim plugins are mainly written in Python. To use auto-completion
and other features, we must install Python 3. The easiest way to install is via
-[Anaconda](https://www.anaconda.com/distribution/#download-section) or
-[Miniconda](https://docs.conda.io/en/latest/miniconda.html). Make sure that the
-output of `python --version` on the command line shows that Python 3.x is
-installed.
+[Anaconda](https://www.anaconda.com/distribution/#download-section) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html). Make sure that the
+output of `python --version` shows that Python 3.x is installed.
## Pynvim
@@ -18,6 +16,10 @@ Neovim relies on [pynvim](https://github.com/neovim/pynvim) to communicate with
plugins that utilize its Python binding. Pynvim is required by plugins such as
[Deoplete](https://github.com/Shougo/deoplete.nvim) and [Semshi](https://github.com/numirias/semshi).
+```
+pip install -U pynvim
+```
+
## pyls
[Pyls](https://github.com/palantir/python-language-server) is a Python Language
@@ -29,8 +31,8 @@ pip install "python-language-server[all]" pyls-isort pyls-mypy
## Git
-Git is used by the plugin manager vim-plug to download plugins from GitHub or
-other Git repositories.
+Git is used by the plugin manager packer.nvim to download plugins from GitHub
+or other Git repositories.
Since Git is usually pre-installed on Linux and macOS, we do not need to worry
if we are on these two platforms. For Windows, install [Git for
@@ -114,16 +116,12 @@ version of nvim.
## Linux
-Follow the official guide and download the appimage from the [release
-page](https://github.com/neovim/neovim/releases/nightly).
-
-For some Linux systems, we may not be able to run the appimage. We can directly
-download the binary release from [here](https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz).
+We can directly download the binary release from [here](https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz).
## Windows
The easiest way to install Neovim on Windows is via chocolatey. First, install
-chocolatey. Then we can install neovim easily following command:
+chocolatey. Then we can install neovim easily using the following command:
```
# install the latest version of neovim
@@ -157,50 +155,35 @@ setups.
# Setting up Nvim
-## Install plugin manager vim-plug
+## Install plugin manager packer.nvim
-I use [vim-plug](https://github.com/junegunn/vim-plug) to manage all my
-plugins. We need to install vim-plug on our system first.
+I use [packer.nvim](https://github.com/wbthomason/packer.nvim) to manage my
+plugins. We need to install packer.nvim on our system first.
-For Windows, if curl is installed, use the following command:
+For Windows, if curl is installed, use the following command (on Powershell):
```
-curl -fLo ~\AppData\Local\nvim-data\site\autoload\plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+git clone --depth=1 https://github.com/wbthomason/packer.nvim "$env:LOCALAPPDATA\nvim-data\site\pack\packer\start\packer.nvim"
```
-Or execute the following command on PowerShell:
-
-```
-md ~\AppData\Local\nvim-data\site\autoload
-$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
-(New-Object Net.WebClient).DownloadFile(
- $uri,
- $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
- "~\AppData\Local\nvim-data\site\autoload\plug.vim"
- )
-)
-```
-
-Or just create the directory `~\AppData\Local\nvim-data\site\autoload\`, and put the vim-plug script there.
-
For macOS and Linux, use the following command:
```bash
-curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+git clone --depth=1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
```
## How to install this configuration
On Windows, the config directory is `$HOME/AppData/Local/nvim`[^1]. On Linux
and macOS, the directory is `~/.config/nvim`. First, we need to remove all the
-files under the config directory (including dot files), then use the following
-command to install this configuration:
+files under the config directory (including dot files), then go to this
+directory, and run the following command to install this configuration:
```
-git clone https://github.com/jdhao/nvim-config.git .
+git clone --depth=1 https://github.com/jdhao/nvim-config.git .
```
-After that, when we first open nvim, use `:PlugInstall` to install all the
+After that, when we first open nvim, use `:PackerInstall` to install all the
plugins. Since I use quite a lot of plugins (more than 60), it may take some
time to install all of them, depending on your network condition.