1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Neovim --> Nvim

This commit is contained in:
jdhao 2021-08-08 22:51:01 +08:00
parent de7b35e0de
commit 6205a913b7
6 changed files with 26 additions and 26 deletions

View File

@ -5,8 +5,8 @@
# Introduction # Introduction
This repo hosts my Nvim configuration for all the platforms I am using (Linux, This repo hosts my Nvim configuration for all the platforms I am using (Linux,
Windows and macOS). `init.vim` is the config entry point for terminal Neovim, Windows and macOS). `init.vim` is the config entry point for terminal Nvim,
and `ginit.vim` is the additional config file for GUI client of Neovim (I am and `ginit.vim` is the additional config file for GUI client of Nvim (I am
using [neovim-qt](https://github.com/equalsraf/neovim-qt) for now on Windows). using [neovim-qt](https://github.com/equalsraf/neovim-qt) for now on Windows).
My configurations are heavily documented to make it as clear as possible. While My configurations are heavily documented to make it as clear as possible. While
@ -97,10 +97,10 @@ represents ASCII character `,`.
| `<leader>t` | Normal | Linux/macOS/Win | Fuzzy buffer tag search in a floating window | | `<leader>t` | Normal | Linux/macOS/Win | Fuzzy buffer tag search in a floating window |
| `<leader><Space>` | Normal | Linux/macOS/Win | Remove trailing white spaces | | `<leader><Space>` | Normal | Linux/macOS/Win | Remove trailing white spaces |
| `<leader>v` | Normal | Linux/macOS/Win | Reselect last pasted text | | `<leader>v` | Normal | Linux/macOS/Win | Reselect last pasted text |
| `<leader>ev` | Normal | Linux/macOS/Win | Edit Neovim config in a new tabpage | | `<leader>ev` | Normal | Linux/macOS/Win | Edit Nvim config in a new tabpage |
| `<leader>sv` | Normal | Linux/macOS/Win | Reload Neovim config | | `<leader>sv` | Normal | Linux/macOS/Win | Reload Nvim config |
| `<leader>q` | Normal | Linux/macOS/Win | Quit current window | | `<leader>q` | Normal | Linux/macOS/Win | Quit current window |
| `<leader>Q` | Normal | Linux/macOS/Win | Quit all window and close Neovim | | `<leader>Q` | Normal | Linux/macOS/Win | Quit all window and close Nvim |
| `<leader>w` | Normal | Linux/macOS/Win | Save current buffer content | | `<leader>w` | Normal | Linux/macOS/Win | Save current buffer content |
| `<leader>cd` | Normal | Linux/macOS/Win | Change current directory to where current file is | | `<leader>cd` | Normal | Linux/macOS/Win | Change current directory to where current file is |
| `<leader>y` | Normal | Linux/macOS/Win | Copy the content of entire buffer to default register | | `<leader>y` | Normal | Linux/macOS/Win | Copy the content of entire buffer to default register |

View File

@ -84,7 +84,7 @@ augroup auto_close_win
autocmd BufEnter * call s:quit_current_win() autocmd BufEnter * call s:quit_current_win()
augroup END augroup END
" Quit Neovim if we have only one window, and its filetype match our pattern. " Quit Nvim if we have only one window, and its filetype match our pattern.
function! s:quit_current_win() abort function! s:quit_current_win() abort
let quit_filetypes = ['qf', 'vista'] let quit_filetypes = ['qf', 'vista']
let buftype = getbufvar(bufnr(), '&filetype') let buftype = getbufvar(bufnr(), '&filetype')

View File

@ -4,7 +4,7 @@ scriptencoding utf-8
" change fillchars for folding, vertical split, end of buffer, and message separator " change fillchars for folding, vertical split, end of buffer, and message separator
set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾ set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾
" Paste mode toggle, it seems that Neovim's bracketed paste mode " Paste mode toggle, it seems that Nvim's bracketed paste mode
" does not work very well for nvim-qt, so we use good-old paste mode " does not work very well for nvim-qt, so we use good-old paste mode
set pastetoggle=<F12> set pastetoggle=<F12>

View File

@ -1,18 +1,18 @@
# Pre-requisite # Pre-requisite
There are a few dependencies if we want to use Neovim for efficient editing There are a few dependencies if we want to use Nvim for efficient editing
and development work. and development work.
## Python ## Python
A lot of Neovim plugins are mainly written in Python. To use auto-completion A lot of Nvim 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 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 you [Anaconda](https://www.anaconda.com/distribution/#download-section) or[Miniconda](https://docs.conda.io/en/latest/miniconda.html). Make sure that you
can run `python --version`, and that the output should be Python 3.x. can run `python --version`, and that the output should be Python 3.x.
## Pynvim ## Pynvim
Neovim relies on [pynvim](https://github.com/neovim/pynvim) to communicate with Nvim relies on [pynvim](https://github.com/neovim/pynvim) to communicate with
plugins that utilize its Python binding. Pynvim is required by plugins such as 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). [Deoplete](https://github.com/Shougo/deoplete.nvim) and [Semshi](https://github.com/numirias/semshi).
@ -128,8 +128,8 @@ listed [here](https://github.com/dense-analysis/ale/blob/master/supported-tools.
## Terminal emulators ## Terminal emulators
Which [terminal emulator](https://en.wikipedia.org/wiki/Terminal_emulator) we Which [terminal emulator](https://en.wikipedia.org/wiki/Terminal_emulator) we
choose to use greatly affects the appearance and functionalities of Neovim. choose to use greatly affects the appearance and functionalities of Nvim.
Since Neovim supports true colors, terminals that support true colors are Since Nvim supports true colors, terminals that support true colors are
preferred. For a list of terminals that support true colors, see [here](https://github.com/termstandard/colors). preferred. For a list of terminals that support true colors, see [here](https://github.com/termstandard/colors).
For macOS, we can use [iterm2](https://www.iterm2.com/), [kitty](https://sw.kovidgoyal.net/kitty/) or [Alacritty](https://github.com/jwilm/alacritty). For macOS, we can use [iterm2](https://www.iterm2.com/), [kitty](https://sw.kovidgoyal.net/kitty/) or [Alacritty](https://github.com/jwilm/alacritty).
@ -147,9 +147,9 @@ using [Hack](https://github.com/powerline/fonts/tree/master/Hack), and it looks
great. Another great resource for programming font is the great. Another great resource for programming font is the
[nerd-font](https://github.com/ryanoasis/nerd-fonts) project. [nerd-font](https://github.com/ryanoasis/nerd-fonts) project.
# Install Neovim # Install Nvim
There are various ways to install Neovim based on your system. Note that some There are various ways to install Nvim based on your system. Note that some
of plugins I use require Nvim master. It is recommended to use the nightly of plugins I use require Nvim master. It is recommended to use the nightly
version of nvim. version of nvim.
@ -159,7 +159,7 @@ We can directly download the binary release from [here](https://github.com/neovi
## Windows ## Windows
The easiest way to install Neovim on Windows is via chocolatey. First, install The easiest way to install Nvim on Windows is via chocolatey. First, install
chocolatey. Then we can install neovim easily using the following command: chocolatey. Then we can install neovim easily using the following command:
``` ```
@ -169,8 +169,8 @@ chocolatey. Then we can install neovim easily using the following command:
choco install neovim choco install neovim
``` ```
The Neovim that chocolatey installs may not be up to date. To use the The Nvim that chocolatey installs may not be up to date. To use the
cutting-edge features of Neovim, you may download [the nightly cutting-edge features of Nvim, you may download [the nightly
release](https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip) from GitHub and manually extract it. release](https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip) from GitHub and manually extract it.
## macOS ## macOS
@ -185,7 +185,7 @@ brew install neovim
# brew install --HEAD neovim # brew install --HEAD neovim
``` ```
After installing Neovim, we need to add the directory where the Neovim After installing Nvim, we need to add the directory where the Nvim
executable (`nvim` on Linux and macOS, `nvim.exe` on Windows) resides to the executable (`nvim` on Linux and macOS, `nvim.exe` on Windows) resides to the
system `PATH`. system `PATH`.
@ -228,9 +228,9 @@ time to install all of them, depending on your network condition.
# Automatic Installation for Linux # # Automatic Installation for Linux #
To set up a workable Neovim environment in Linux, I use the bash script To set up a workable Nvim environment in Linux, I use the bash script
[`nvim_setup_linux.sh`](nvim_setup_linux.sh) to automatically install necessary [`nvim_setup_linux.sh`](nvim_setup_linux.sh) to automatically install necessary
dependencies, Neovim itself and Nvim configs in this repo. dependencies, Nvim itself and Nvim configs in this repo.
Note that the variable `PYTHON_INSTALLED`, `SYSTEM_PYTHON` and Note that the variable `PYTHON_INSTALLED`, `SYSTEM_PYTHON` and
`ADD_TO_SYSTEM_PATH` in the script should be set properly based on your `ADD_TO_SYSTEM_PATH` in the script should be set properly based on your

View File

@ -66,7 +66,7 @@ else
echo "Python is already installed. Skip installing it." echo "Python is already installed. Skip installing it."
fi fi
# Install some Python packages used by Neovim plugins. # Install some Python packages used by Nvim plugins.
echo "Installing Python packages" echo "Installing Python packages"
declare -a py_packages=("pynvim" 'python-lsp-server[all]' "black" "vim-vint" "pyls-isort" "pylsp-mypy") declare -a py_packages=("pynvim" 'python-lsp-server[all]' "black" "vim-vint" "pyls-isort" "pylsp-mypy")
@ -179,7 +179,7 @@ NVIM_SRC_NAME=$HOME/packages/nvim-linux64.tar.gz
NVIM_CONFIG_DIR=$HOME/.config/nvim NVIM_CONFIG_DIR=$HOME/.config/nvim
NVIM_LINK="https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz" NVIM_LINK="https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz"
if [[ ! -f "$NVIM_DIR/bin/nvim" ]]; then if [[ ! -f "$NVIM_DIR/bin/nvim" ]]; then
echo "Installing Neovim" echo "Installing Nvim"
echo "Creating nvim directory under tools directory" echo "Creating nvim directory under tools directory"
if [[ ! -d "$NVIM_DIR" ]]; then if [[ ! -d "$NVIM_DIR" ]]; then
@ -187,7 +187,7 @@ if [[ ! -f "$NVIM_DIR/bin/nvim" ]]; then
fi fi
if [[ ! -f $NVIM_SRC_NAME ]]; then if [[ ! -f $NVIM_SRC_NAME ]]; then
echo "Downloading Neovim" echo "Downloading Nvim"
wget "$NVIM_LINK" -O "$NVIM_SRC_NAME" wget "$NVIM_LINK" -O "$NVIM_SRC_NAME"
fi fi
echo "Extracting neovim" echo "Extracting neovim"
@ -197,7 +197,7 @@ if [[ ! -f "$NVIM_DIR/bin/nvim" ]]; then
echo "export PATH=\"$NVIM_DIR/bin:\$PATH\"" >> "$HOME/.bash_profile" echo "export PATH=\"$NVIM_DIR/bin:\$PATH\"" >> "$HOME/.bash_profile"
fi fi
else else
echo "Neovim is already installed. Skip installing it." echo "Nvim is already installed. Skip installing it."
fi fi
echo "Setting up config and installing plugins" echo "Setting up config and installing plugins"
@ -214,4 +214,4 @@ git clone --depth=1 https://github.com/wbthomason/packer.nvim \
echo "Installing plugins" echo "Installing plugins"
"$NVIM_DIR/bin/nvim" +PackerInstall +qall "$NVIM_DIR/bin/nvim" +PackerInstall +qall
echo "Finished installing Neovim and its dependencies!" echo "Finished installing Nvim and its dependencies!"

View File

@ -14,7 +14,7 @@
"{ Header and Licence "{ Header and Licence
"{{ header info "{{ header info
" Description: This is my personal Neovim configuration supporting Mac, Linux " Description: This is my personal Nvim configuration supporting Mac, Linux
" and Windows, with various plugins configured. This configuration evolves as " and Windows, with various plugins configured. This configuration evolves as
" I learn more about Nvim and becomes more proficient in using Nvim. Since it " I learn more about Nvim and becomes more proficient in using Nvim. Since it
" is very long (more than 1000 lines!), you should read it carefully and take " is very long (more than 1000 lines!), you should read it carefully and take