Skip to content

macfarlane-dev/nvchad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter config for NvChad

This project forks the popular NvChad.

Dependencies

  • NeoVim >=0.10.0
     cd /tmp
     version=0.10.1
     curl -LO https://github.com/neovim/neovim/releases/download/v${version}/nvim-linux64.tar.gz 
     # Use the checksum from the releases page to validate the downloaded file. 
     echo '4867de01a17f6083f902f8aa5215b40b0ed3a36e83cc0293de3f11708f1f9793  nvim-linux64.tar.gz' \
     	| sha256sum -c -
     tar xzf nvim-linux64.tar.gz
     sudo mkdir -p /opt/nvim
     sudo mv nvim-linux64 /opt/nvim/${version}
     sudo ln -s /opt/nvim/${version}/bin/nvim /usr/local/bin/nvim
     rm /tmp/nvim-linux64.tar.gz
  • Nerd Font such as CaskaydiaCove Nerd Font (reserved name: Cascadia Code)
    • Make sure the font doesn't end with 'Mono' to prevent small icons.
    • Configure your terminal to use the Nerd Font
  • Git >= 2.19.0
  • Make or Cmake (a C build tool) and gcc or zig (a C compiler used to build the plugin telescope-fzf-native)
    • Ubuntu: make from sudo apt-get install build-essential
    • Windows: Cmake from Visual Studio 2022 with C++ Build Tools
      • Download Visual Studio Build Tools at All Downloads > Tools for Visual Studio > Build Tools for Visual Studio 2022
      • Run the Build Tools manager and install Desktop Development C++ build tools
      • Run nvim for the first time
      • Navigate to /AppData/Local/nvim-data/lazy/telescope-fzf-native
      • Run build command (sourced from official docs)
       cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build
      
    • Windows: zig with winget install zig.zig (may take 10-20 minutes to install)
  • Ripgrep
  • A terminal that supports true color and undercurl
  • Git clone this project
    • Windows: git clone https://github.com/macfarlane-dev/nvchad.git ~/AppData/Local/nvim
    • Linux/MacOS: git clone https://github.com/macfarlane-dev/nvchad.git ~/.config/nvim
  • (optional) Install NodeJS, required to install some LSPs including Pyright

Installing Plugins

Lazy plugin manager

Understanding the Plugin Spec is essential to configuring plugins.

  • After cloning, restore plugin versions to lazy-lock.json with :Lazy restore
  • Use the :Lazy dashboard to install/update to latest versions/debug and more
  • Add, remove and configure plugins from the lua/plugins directory

Mason language manager

Mason manages tooling for code completion (LSP servers), debuggers (DAP servers), linters, and formatters Read more at :h mason.

  • Install the default tools with :MasonInstallAll
    • Defaults are defined at lua/plugins/init.lua
  • Use the :Mason dashboard to search packages
  • Install packages with :MasonInstall <package_name>

Pyright LSP configuration

The Python LSP Pyright requires a pyrightconfig.json configuration file at a project root to resolve imports.

{
  "venv": "myvenv"
}

Treesitter text highlighting

Read more at :h treesitter.

  • On startup Treesitter installs packages listed in lua/plugins/init.lua, opts.ensure_installed
  • Search supported languages here
  • Install additional packages with :TSInstall <package_name>

Building telescope-fzf-native

telescope-fzf-native must be compiled locally. This project is configured to build automatically on Linux with make. If this fails the first time it can be re-built from the :Lazy menu by navigating to telescope-fzf-native and hitting gb.

Add schemas

Schemas are maintained in schemas directory and referenced from lua/configs/yaml-companion.lua.

Update eksctl schema

yaml-companion looks for local schemas at ~/.schemas. If you are using eksctl, save it's schema with:

eks utils schema > schema/eksctl.json

Generate Helm Chart schemas

Helm plugin helm-schema-gen allows you to generate values.schema.json files from a yaml template. Assuming you already have helm installed, install the plugin and create a schema from a remote yaml file like so:

helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git
URL=https://raw.githubusercontent.com/apache/superset/a21f1840580ed4e911406135b742a58442965cf7/helm/superset/values.yaml
helm schema-gen <(curl -sL $URL) > schema/helm-superset.json

Customisation

  • Find your neovim configuration directory within neovim with :h XDG_CONFIG_HOME
  • Configure keybindings in lua/mappings.lua
  • Configure UI elements at lua/chadrc.lua
    • Options can be found here
  • Vim options are configured in lua/options.lua
  • Plugins are configured in the lua/configs directory

Help

  • Read the cheat sheet: <space>ch
  • Search the key mappings: <space>fk
  • Read the custom key mappings at lua/mappings.lua
  • Search the documentation: <space>fh
  • Read your locally installed plugins. Find their location at :h XDG_DATA_HOME

Further Reading

Plugins to Investigate

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published