Skip to content

Latest commit

 

History

History
117 lines (77 loc) · 5.31 KB

install-and-init.md

File metadata and controls

117 lines (77 loc) · 5.31 KB

Installation

English | 中文

You can use git clone to install. Or run nvim in container.

Dependencies

  • Neovim 0.9.2 or later
  • python3、pip3
  • nvim python provider
    • pip3 install --upgrade --user pynvim
    • pip2 install --upgrade --user pynvim (it is optional)
  • Git and curl
  • A C compiler in your path and libstdc++ installed. (Required by treesitter)
  • Nerd Font. Recommend DejaVuSansMonoForPowerline Nerd Font. Remember to change your terminal font setting. (The icons may look small. It is a bug of nerd-fonts)
  • ripgrep(rg)
  • Linux and MacOS are supported. Windows not.

Versions

It's recommended to use master branch which should be always stable. You can try develop branch for latest update but may be unstable.

Read tags for verions. The versions follow the rules of Semantic Versioning 2.0.0.

git clone

PLUGIN_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/nvim/plugins
mkdir -p "$PLUGIN_DIR"
git clone --single-branch https://github.com/adoyle-h/one.nvim.git "$PLUGIN_DIR"/one.nvim

Do initialization and then press nvim to get started.

Initialization

  1. Create neovim init.lua file.

    • For minimal config, just run

      NVIM_HOME=$HOME/.config/nvim
      mkdir -p "$NVIM_HOME"
      echo "require('one').setup {}" > "$NVIM_HOME/init.lua"
    • One.nvim uses lazy.nvim as default plugin manager. You can change by config.pluginManager.use. Read Plugin Manager for details.

    • One.nvim will install plugin manager on start up. So user should not install one.nvim via plugin manager.

    • It maybe be slow to download plugins. Modify config.proxy.github option to use proxy. Read Proxy for details.

    • You can refer to my init.lua for more complex config.

  2. Call nvim to open neovim. It will auto download dependent packages, including plugin manager (lazy.nvim/vim-plug/packer.nvim). And then auto download plugins.

  3. When plugins installed failed. See FAQ - Plugins Installed Failed.

  4. It will auto download treesitter parsers, which defined in config.treesitter.ensure_installed and config.treesitter.ignore_install. If install failed, restart nvim or run :TSInstall all to install them.

  5. It will auto download LSP/DAP/Formatter/Linter, which defined in config['mason-installer'].ensureInstalled.

    • If failed, restart nvim or run :MasonToolsInstall to install them.
    • Or press <M-m> to open Mason window to choose LSP/DAP/Formatter/Linter.

Container

You can also use it in container. It requires docker installed on your machine.

Use container

# Create docker volume for caching the nvim data in host
docker volume create nvim-data
# It's recommended to add this line to ~/.bashrc. And replace
alias nvim='docker run --rm -it --platform linux/amd64 -v "$HOME/.config/nvim:/root/.config/nvim" -v "nvim-data:/root/.local/share/nvim" -v "$PWD:/app" adoyle/one.nvim:vX.Y.Z'

The tags of one.nvim image refer to here.

Create your configuration file /root/.config/nvim/init.lua in host machine. See Initialisation for details.

Then run nvim from any directory to start the container. The initial start it automatically downloads the required dependency packages based on your configuration.

You may encounter errors during this process. Restart nvim to reinstall it until it's done.

Run nvim again to get started in current directory.

Note for Mac users with Apple chip. Current nvim not provide releases building for arm64 arch. So the container builds and runs with --platform=linux/amd64 option.

Build image

If you prefer to build the image of container from source code, read below.

Git clone this project, and invoke ./scripts/build-container -v 0.9.5 to build image that includes nvim and basic config for one.nvim.

-v is the nvim version.

For users in China Mainland, it's recommended to add -p option to enable proxy for fasten building. If enabled, then image tag will be vX.Y.Z-china.

Note for Mac users with Apple chip. Current nvim not provide releases building for arm64 arch. So the container builds and runs with --platform=linux/amd64 option.