Skip to content

Latest commit

 

History

History
241 lines (183 loc) · 5.62 KB

neovim.md

File metadata and controls

241 lines (183 loc) · 5.62 KB

Neovim

Prerequisites

  • git, cc
  • python, node
  • unzip, wget, curl, gzip, tar, bash, sh, ripgreg, fd, fzf

Install

# mac
sudo port install neovim

# ubuntu
sudo apt install neovim

# redhat (epel)
sudo dnf install neovim python3-neovim

# freebsd
sudo pkg install neovim

Add an alias to ~/.zshrc:

# alias
alias ll='ls --color=auto -alFh'
alias vi='nvim'
# alias vim='nvim'

Install from source

Build prerequisites

# ubuntu / debian
sudo apt-get install ninja-build gettext cmake unzip curl

# centos / rhel / fedora
sudo dnf -y install ninja-build cmake gcc make unzip gettext curl

# arch
sudo pacman -S base-devel cmake unzip ninja curl

# freebsd
sudo pkg install cmake gmake sha unzip wget gettext curl

# mac
sudo port install ninja cmake gettext

Build Neovim

git clone https://github.com/neovim/neovim
cd neovim

# make CMAKE_BUILD_TYPE=RelWithDebInfo
# or
git checkout stable
make CMAKE_BUILD_TYPE=Release

# ubuntu / debian
cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb

# other linux
sudo make install

Remove Neovim

sudo dpkg -l neovim
sudo dpkg -P neovim

NvChad

my .config/nvim/lua/custom

git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
cd $HOME/.config/nvim/lua/
# rm -rf custom
git clone https://github.com/rurumimic/nvim custom
nvim
  1. :checkhealth
  2. :MasonInstallAll

Package Manager

mkdir -p ~/.config/nvim

lazy.nvim

mkdir -p ~/.config/nvim/lua/plugins

bootstrap lazy.nvim

vi ~/.config/nvim/init.lua
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

setup lazy.nvim

vi ~/.config/nvim/init.lua
require("lazy").setup("plugins")

Check lazy.nvim

:checkhealth lazy

data location

ls ~/.local/share/nvim/lazy

Key

:Lazy home

Plugins

vi ~/.config/nvim/lua/plugins/<name>.lua
return {
  "user/plugin",
  version = "*",
  lazy = false,
  dependencies = {},
  config = function()
    require("plugin").setup {}
  end,
}