neovim install and config

vim
Author

dd21

Published

January 7, 2023

Abstract

i want to code with vim but i haven’t configt that for a long time. today i make up mine mind to config vim.

Referance

https://www.youtube.com/watch?v=ctH-a-1eUME&list=PLhoH5vyxr6Qq41NFL4GvhFp-WLd5xzIzZ

https://github.com/LunarVim/Neovim-from-scratch

install nvim & config

sudo pacman -S neovim

git clone https://github.com/LunarVim/Neovim-from-scratch

cd neovim-from-scratch/usr

git checkout 01-options

nvim options.lua

you can read and help from this command

:help options

:help bachup

...

key map

key map is very usefull this will make vim like some ide

git checkout -b 02-keymap

vimPlug

plug will make you vim becom more powerfull

nvim pulg install path is

/.local/share/nvim/site/pack/packer/start

:packerXXXX

install plugs

cd /home/dd21/.config/nvim/lua/user

add pulg link this

install markdownPreview

use "iamcco/markdown-preview.nvim"  -- 这里按照官方的命令发生vim:492错误不知道怎么回事,不添加选项没有任何问题

:w

cd /home/dd21/.local/share/nvim/site/pack/packer/opt/markdown-preview.nvim/app

sudo pacman -S yarn 

yarn install 

nvim README.md
# then input 
:MarkDownPreview

color theme

you can use defualt nvim color theme

open the init.lua

nvim options.lua

# open the line 19 annotation
termguicolors = true

# set the colortheme in terminal
:colorscheme tokyonight

you open nvim per time to setup color theme, if you want to set for ever

nvim ./lua/user/colorscheme.lua

local colorscheme = "tokyonight"

local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then
  vim.notify("colorscheme " .. colorscheme .. " not found!")
  return
end

lsp install

cd plug.lua

# install plug
:w

# show lsp install info window
lspinstall

# add with `i`
# remove with `x`