kickstart.nvim README

The project's README from github.com/nvim-lua/kickstart.nvim. As one markdown file: README.md.

kickstart.nvim

Introduction

A starting point for Neovim that is:

NOT a Neovim distribution, but instead a starting point for your configuration.

Installation

Install Neovim

Kickstart.nvim targets only the latest 'stable' and latest 'nightly' of Neovim. If you are experiencing issues, please make sure you have at least the latest stable version. Most likely, you want to install neovim via a package manager. To check your neovim version, run nvim --version and make sure it is not below the latest 'stable' version. If your chosen install method only gives you an outdated version of neovim, find alternative installation methods below.

Install External Dependencies

External Requirements:

[!NOTE] See Install Recipes for additional Windows and Linux specific notes and quick install snippets

Install Kickstart

[!NOTE] Backup your previous configuration (if any exists)

Neovim's configurations are located under the following paths, depending on your OS:

OS PATH
Linux, MacOS $XDG_CONFIG_HOME/nvim, ~/.config/nvim
Windows (cmd) %localappdata%\nvim\
Windows (powershell) $env:LOCALAPPDATA\nvim\

Create your own copy of this repo using GitHub's "Use this template" button so that you have your own copy that you can modify, then install by cloning your new repo to your machine using one of the commands below, depending on your OS.

Alternatively, you can fork this repo if you prefer an easy upstream sync path (e.g., keeping your config on a separate branch and fast-forwarding master from upstream). See the discussion in #1740 for the tradeoffs between the two approaches.

[!NOTE] Your repo's URL will be something like this: https://github.com/<your_github_username>/kickstart.nvim.git

You likely want to remove nvim-pack-lock.json from your repo's .gitignore file too - it's ignored in the kickstart repo to make maintenance easier, but it's recommended to track it in version control (see :help vim.pack-lockfile).

Clone kickstart.nvim

[!NOTE] If following the recommended step above (i.e., creating your own repo from the template or fork), replace nvim-lua with <your_github_username> in the commands below

Linux and Mac
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
Windows

If you're using cmd.exe:

git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim"

If you're using powershell.exe

git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"

Post Installation

Start Neovim

nvim

That's it! vim.pack will install all the plugins from your config. Use :lua vim.pack.update(nil, { offline = true }) to inspect plugin state and :lua vim.pack.update() to fetch updates (:write applies updates, :quit cancels them).

Read The Friendly Documentation

Read through the init.lua file in your configuration folder for more information about extending and exploring Neovim. That also includes examples of adding popularly requested plugins.

[!NOTE] For more information about a particular plugin check its repository's documentation.

Getting Started

The Only Video You Need to Get Started with Neovim

FAQ

Install Recipes

Below you can find OS specific install instructions for Neovim and dependencies.

After installing all the dependencies continue with the Install Kickstart step.

Windows Installation

Windows with Microsoft C++ Build Tools and CMake Kickstart's default config is make-only for `telescope-fzf-native.nvim`. If `make` is unavailable, the plugin is skipped.

Recommended: install make (see the chocolatey section below).

If you want a CMake-only setup, customize init.lua in two places:

  1. Include telescope-fzf-native.nvim when cmake is available:
if vim.fn.executable 'make' == 1 or vim.fn.executable 'cmake' == 1 then
  table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim')
end
  1. In the PackChanged hook, use CMake when make is unavailable:
if name == 'telescope-fzf-native.nvim' then
  if vim.fn.executable 'make' == 1 then
    run_build(name, { 'make' }, ev.data.path)
  elseif vim.fn.executable 'cmake' == 1 then
    run_build(name, { 'cmake', '-S.', '-Bbuild', '-DCMAKE_BUILD_TYPE=Release' }, ev.data.path)
    run_build(name, { 'cmake', '--build', 'build', '--config', 'Release', '--target', 'install' }, ev.data.path)
  end
  return
end

See telescope-fzf-native documentation for build details.

Windows with gcc/make using chocolatey Alternatively, one can install gcc and make which don't require changing the config, the easiest way is to use choco:
  1. install chocolatey either follow the instructions on the page or use winget, run in cmd as admin:
winget install --accept-source-agreements chocolatey.chocolatey
  1. install all requirements using choco, exit the 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 tree-sitter
WSL (Windows Subsystem for Linux)
wsl --install
wsl
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim

Linux Install

Ubuntu Install Steps
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
Debian Install Steps
sudo apt update
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip curl

# Now we install nvim
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim-linux-x86_64
sudo mkdir -p /opt/nvim-linux-x86_64
sudo chmod a+rX /opt/nvim-linux-x86_64
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz

# make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
Fedora Install Steps
sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim
Arch Install Steps
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd tree-sitter-cli unzip neovim
Alpine Install Steps

[!CAUTION] Neovim works fine on Alpine, but some tooling appears incompatible with musl (lua-language-server, etc., check :Mason or :MasonLog). Quickfix Lua-LSP-Support: :%s/lua_ls/emmylua_ls

sudo apk add gcc make git fd ripgrep tree-sitter-cli unzip bash gzip curl musl-dev neovim-doc neovim

Alternative neovim installation methods

For some systems it is not unexpected that the package manager installation method recommended by neovim is significantly behind. If that is the case for you, pick one of the following methods that are known to deliver fresh neovim versions very quickly. They have been picked for their popularity and because they make installing and updating neovim to the latest versions easy. You can also find more detail about the available methods being discussed here.

Bob

Bob is a Neovim version manager for all platforms. Simply install rustup, and run the following commands:

rustup default stable
rustup update stable
cargo install bob-nvim
bob use stable
Homebrew

Homebrew is a package manager popular on Mac and Linux. Simply install using brew install.

Flatpak

Flatpak is a package manager for applications that allows developers to package their applications just once to make it available on all Linux systems. Simply install flatpak and setup flathub to install neovim.

asdf and mise-en-place

asdf and mise are tool version managers, mostly aimed towards project-specific tool versioning. However both support managing tools globally in the user-space as well:

mise

Install mise, then run:

mise plugins install neovim
mise use neovim@stable
asdf

Install asdf, then run:

asdf plugin add neovim
asdf install neovim stable
asdf set neovim stable --home
asdf reshim neovim

kickstart.nvim (nvim-lua/kickstart.nvim)

Searching Database…

这是什么?一个个人 Neovim 配置的起点:一个小巧的单文件、注释齐全的 init.lua,克隆下来后改成你自己的配置。它明确表示自己不是一个 Neovim 发行版。
那它是现成可用的配置,还是需要我自己动手改的配置?是一份由你拥有并自己编辑的配置。推荐的做法是通过 GitHub 上的“Use this template”按钮复制仓库,再克隆你自己的副本,这样 init.lua 的每一行都归你随意修改。
怎么让它跑起来?先安装最新稳定版 Neovim,把仓库克隆到 ~/.config/nvim(Linux/macOS)或 %localappdata%\nvim(Windows),然后运行 nvim——首次启动时 vim.pack 会根据配置自动安装所有插件。
除了 Neovim 本身,我还需要装什么?git、make、unzip、一个 C 编译器、ripgrep、fd-find、tree-sitter CLI,以及一个剪贴板工具(xclip/xsel/win32yank)。如果想显示图标,可以选装 Nerd Font;此外还需要各语言自己的工具链:TypeScript 要 npm,Go 要 go,等等。
在 Windows 上用起来和 Linux、macOS 一样顺畅吗?不完全一样:默认配置只支持 make,没有 make 的话 telescope-fzf-native 插件会被跳过。最简单的解决办法是通过 chocolatey 安装 gcc 和 make;其他方案是装 MS C++ Build Tools 并对 init.lua 做两处小改动以支持 CMake,或者干脆用 WSL。
这个是用来学习 Neovim 的,还是当作日常使用的配置?两者都是——它既是教学材料,也是一份参考配置,可以克隆下来作为你自己配置的基础。上手之后,可以把 init.lua 拆分成多个模块;kickstart-modular.nvim 这个分支已经这样做了,功能完全一样。
为什么所有内容都放在一个 init.lua 文件里?这是有意为之:一个带注释的单文件可以从头到尾轻松读完,在学习 Neovim 和 Lua 时也方便当作参考。如果你觉得单文件不够用了,README 里指向了 kickstart-modular.nvim 分支,它把同样的功能拆分到了多个文件里。
我已经有一套 Neovim 配置了,能不能不覆盖它就先试试 kickstart?可以。FAQ 建议先备份旧配置,另外借助 NVIM_APPNAME 可以让多套配置并存——比如克隆到 ~/.config/nvim-kickstart,再用一个 nvim-kickstart 别名来启动它。
装好之后插件怎么更新?由 vim.pack 来处理:运行 :lua vim.pack.update() 拉取更新,然后用 :write 应用,或者用 :quit 取消。:lua vim.pack.update(nil, { offline = true }) 则只查看插件状态,不实际拉取。
我需要哪个版本的 Neovim?只要最新的 stable 或 nightly 版本即可——运行 nvim --version 可以查看版本。如果你用的包管理器提供的版本偏旧,README 里列出了 Bob、Homebrew、Flatpak、asdf 和 mise 这些能快速装到新版本的渠道。
Creator
nvim-lua
Size
1 MB
Stars
31.6K
Updated
CommitOct 03
Age
4y
Commits · 90 Days