This repo hosts my Neovim and NvChad configuration for Linux, macOS, and Windows.
This configuration is written as clearly as possible. You can clone the entire repository and use it, but this is not recommended. The best configuration is personal, so everyone should have their own unique configuration. You are encouraged to clone from this repo the part you want and add it to your config.
To reduce the possibility of damage, this configuration is only maintained for the latest Neovim stable release and the latest NvChad. No effort is required to maintain backward compatibility.
- Plugins management with Lazy.nvim
- File explorer with nvim-tree
- Fuzzy finding with Telescope
- Syntax highlighting with Treesitter
- Git integration with Gitsigns
- Code completion with nvim-cmp
- Language Server Protocol with Native LSP
- Debug Adapter Protocol with nvim-dap
- Linting and formatting with none-ls
- LSP servers, DAP servers, linters and formatters management with mason
- UI with dressing and nui
- Zen mode with zen-mode.nvim
- Diff view with diffview.nvim
- Indent guide with indent-blankline
- Comment with Comment.nvim
- Key mapping with which-key
- Variable highlight with vim-illuminate
- Surround with nvim-surround
- Folding with nvim-ufo
- Status column with statuscol.nvim
- Symbols outline with symbols-outline.nvim
- Winbar code context with nvim-navic
- Trouble with Trouble
- Notification with noice and notify
- Easy motion with hop
- Smooth scroll with neoscroll.nvim
- Guess indent with indent-o-matic
- Markdown preview with markdown-preview.nvim
- AI chat with Chat GPT
- AI code generator with Codeium
- Make sure you have installed the latest version of
Neovim v0.9+
. - Have installed
NvChad v2.0
. - Have Installed
Neovide
(optional, if using Neovide as Neovim GUI). - Have the following programs installed on your system:
- Terminal with true color support.
- Use a
Nerd Font v3+
in your terminal emulator, make sure the nerd font you set doesn't end with Mono to present small icons. This config recommends Cascadia Code (Caskaydia Cove) or Fira Code fonts. - Delete old custom NvChad config folder (check uninstall commands below).
# Linux/macOS
rm -rf ~/.config/nvim/lua/custom
git clone https://github.com/DuongHieu0712z/nvchad-config.git ~/.config/nvim/lua/custom
# Windows (Powershell)
rm -r -fo ~\AppData\Local\nvim\lua\custom
git clone https://github.com/DuongHieu0712z/nvchad-config.git ~\AppData\Local\nvim\lua\custom
Note: These commands only delete this config, not NvChad config. To delete NvChad config, please go here.
# Linux/macOS
rm -rf ~/.config/nvim/lua/custom
rm -rf ~/.local/share/nvim
rm -rf ~/.cache/nvim
# Windows (Powershell)
rm -r -fo ~\AppData\Local\nvim\lua\custom
rm -r -fo ~\AppData\Local\nvim-data
Open nvim
and enter the following:
:checkhealth
You'll probably notice you don't have support for copy/paste also that python
and node
haven't been setup.
So let's fix that.
First, we'll fix copy/paste:
-
On macOS,
pbcopy
should be builtin. -
On Ubuntu:
sudo apt install xsel # for X11 sudo apt install wl-clipboard # for wayland
Next, we need to install python
and node
support:
-
Neovim python
support:pip install pynvim
-
Neovim node
support:npm i -g neovim
To update NvChad to the latest version
:NvChadUpdate
If you build markdown-preview.nvim
get error, you can fix it by:
-
Change to
markdown-preview.nvim
directory:# Linux/macOS cd ~/.local/share-nvim/lazy/markdown-preview.nvim
# Windows (Powershell) cd ~\AppData\Local\nvim-data\lazy\markdown-preview.nvim
-
Build plugin:
yarn install yarn build
Get an API key from OpenAI, which you can obtain here.
Save API key to file openai.txt
in your $HOME
folder.
Generate a new GPG key if you haven't, follow the instructions
here.
After generate, use the follow command to encrypt file openai.txt
in your $HOME
folder:
gpg -e openai.txt -r <USER-ID>
Note: You can use passphrase for security, but I recommend not using passphrase for convenience.
If the previous command run successfully, a new filename openai.txt.gpg
will be
generated in your $HOME
folder.
The following configuration would use GPG to decrypt a local file containing
the API key in file custom/configs/chatgpt.lua
:
local home = vim.fn.expand "$HOME"
local M = {
api_key_cmd = "gpg -d " .. home .. "/openai.txt.gpg",
}
return M
When start Neovim, run :Codeium Auth
to set up the plugin and
start using Codeium.
Copy the token from your browser and paste it into API token request.
Use Ctrl-R *
or Ctrl-R +
, to paste the token into Popup.