Skip to content

Commit

Permalink
New pages - NvChad Guide 2.5 (#2001)
Browse files Browse the repository at this point in the history
* fix: remove admonition - fix some links

* docs: edit page - version 2.5

* docs: edit page - add new screenshots

* docs: new images
  • Loading branch information
ambaradan authored Apr 10, 2024
1 parent 6168e8b commit 45893b8
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 164 deletions.
Binary file modified docs/books/nvchad/images/lazy_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_nvim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/lazy_profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/remove_plugin_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/books/nvchad/images/remove_plugin_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 2 additions & 12 deletions docs/books/nvchad/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ tags:

# :material-book-open-page-variant-outline: Introduction

!!! warning "Release 2.5 changes"

With the release of version 2.5, the editor's developers significantly changed the configuration's structure. The most significant changes concern the following aspects:

* The configuration transformation into a Neovim plugin can then be updated using the *lazy.nvim* plugins manager
* Removing the `custom` folder for editor customization (now integrated into the main folder). A [migration script](https://gist.github.com/siduck/048bed2e7570569e6b327b35d1715404) is provided for current users.
* The mappings have been changed and no longer use nvchad's custom syntax, instead nvim's **vim.keymap.set** is used.

As a result, some pages of the guide, especially the whole part concerning the installation of NvChad and the subsequent installation of plugins, appear incorrect. The guide is **under revision** and will be updated soon.

Throughout this book, you will find ways to implement Neovim, along with NvChad, to create a fully functional ==**I**ntegrated **D**evelopment **E**nvironment== (IDE).

I say "ways" because there are many possibilities. The author focuses here on using these tools for writing markdown, but if markdown isn't your focus, don't worry simply read on. If you are unfamiliar with either of these tools (NvChad or Neovim), then this book will give you an introduction to both, and if you step through these documents, you'll soon realize that you can set up this environment to be a huge help for whatever your programming or script writing needs are.
Expand Down Expand Up @@ -89,7 +79,7 @@ Lua is not interpreted directly through a Lua file like other languages, for exa

### :simple-neovim: Neovim

Neovim is described in detail on its [dedicated page](install_nvim.md) so we will just dwell on the main features, which are:
Neovim is described in detail on its [dedicated page](./install_nvim.md) so we will just dwell on the main features, which are:

* Performance: Very fast.
* Customizable: Wide ecosystem of plugins and themes.
Expand Down Expand Up @@ -120,4 +110,4 @@ A parser is a component that decomposes data into smaller elements to facilitate

Although it may seem that the two services (LSP and tree-sitter) are redundant, they are actually complementary in that LSP works at the project level while tree-sitter works only on the open source file.

Now that we have explained a bit about the technologies used to create the IDE we can move on to the [Additional Software](additional_software.md) needed to configure our NvChad.
Now that we have explained a bit about the technologies used to create the IDE we can move on to the [Additional Software](./additional_software.md) needed to configure our NvChad.
171 changes: 54 additions & 117 deletions docs/books/nvchad/nvchad_ui/builtin_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,162 +2,99 @@
title: Built-In Plugins
author: Franco Colussi
contributors: Steven Spencer, Ganna Zhyrnova
tested_with: 8.6, 9.0
tested_with: 8.8, 9.3
tags:
- nvchad
- coding
- plugins
---

# Basic configuration plugins

!!! danger "Wrong instructions"

With the release of version 2.5, the instructions on this page are no longer correct; its use is not recommended for new installations. For more information see [the main page of the guide](../index.md).
# :material-folder-multiple-outline: Basic configuration plugins

!!! note "Plugin Naming Convention"

In this chapter, the format `user_github/plugin_name` will be used to identify the plugin. This is to avoid possible errors with similarly named plugins and to introduce the format that is used for plugin entry by both NvChad, and the `custom` configuration.

Version 2.0 brings numerous new features. The new version adopts `lazy.nvim` as the plugin manager instead of `packer.nvim`, this involves making some changes for users of the previous version with a custom configuration (*custom* folder).

`lazy.nvim` enables convenient management of plugins through a unified interface and integrates a mechanism for synchronizing plugins across installations (*lazy-lock.json*).

NvChad keeps the configuration of its default plugins in the file *lua/plugins/init.lua*. And the additional configurations of the various plugins are contained in the */nvim/lua/plugins/configs* folder.

We can see an excerpt of the *init.lua* file below:

```lua
require "core"
-- All plugins have lazy=true by default,to load a plugin on startup just lazy=false
-- List of all default plugins & their definitions
local default_plugins = {

"nvim-lua/plenary.nvim",

{
"NvChad/base46",
branch = "v2.0",
build = function()
require("base46").load_all_highlights()
end,
},

{
"NvChad/ui",
branch = "v2.0",
lazy = false,
},

{
"NvChad/nvterm",
init = function()
require("core.utils").load_mappings "nvterm"
end,
config = function(_, opts)
require "base46.term"
require("nvterm").setup(opts)
end,
},
...
...
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

-- bootstrap lazy.nvim!
if not vim.loop.fs_stat(lazypath) then
require("core.bootstrap").gen_chadrc_template()
require("core.bootstrap").lazy(lazypath)
end

dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
require "plugins"
```
The basic NvChad plugins are set up in the `~/.local/share/nvim/lazy/NvChad/lua/nvchad/plugins/` folder:

There's a huge amount of work by the NvChad developers that must be acknowledged. They have created an integrated environment among all plugins which makes the user interface clean and professional. In addition, plugins that work *under the hood* allow for enhanced editing and other features.
```text title=".local/share/nvchad/lazy/NvChad/lua/nvchad/plugins/"
├── init.lua
└── ui.lua
```

All of this means that ordinary users can have, in an instant, a basic IDE with which to start working, and an extensible configuration that can adapt to their needs.
and respective configurations in the `~/.local/share/nvim/lazy/NvChad/lua/nvchad/configs/` folder:

```text title=".local/share/nvchad/lazy/NvChad/lua/nvchad/configs/"
├── cmp.lua
├── gitsigns.lua
├── lazy_nvim.lua
├── lspconfig.lua
├── luasnip.lua
├── mason.lua
├── nvimtree.lua
├── telescope.lua
└── treesitter.lua
```

## Main Plugins
Within the `plugins` folder are the files *init.lua* and *ui.lua*, the former deals with the configuration of plugins that offer additional functionality to the editor (*telescope*, *gitsigns*, *tree-sitter*, etc..) while the latter sets the appearance of the editor (colors, icons, file manager, etc..).

## :material-download-circle-outline: Basic Plugins

The following is a brief analysis of the main plugins:

- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim) - Provides a library of commonly used lua functions that are used by the other plugins, for example *telescope* and *gitsigns*.
=== "init.lua plugins"

- [NvChad/base46](https://github.com/NvChad/base46) - Provides themes for the interface.
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim) - Provides a library of commonly used lua functions that are used by the other plugins, for example *telescope* and *gitsigns*.

- [NvChad/ui](https://github.com/NvChad/ui) - Provides the actual interface and the core utilities of NvChad. Thanks to this plugin we can have a *statusline* that gives us the information during editing and a *tabufline* that allows us to manage open buffers. This plugin also provides the utilities **NvChadUpdate** for updating it, **NvCheatsheet** for an overview of keyboard shortcuts, and **Nvdash** from which file operations can be performed.
- [stevearc/conform.nvim](https://github.com/stevearc/conform.nvim) Formatting plugin for Neovim, fast and extensible thanks to `configs/conform.lua` file provided by user configuration

- [NvChad/nvterm](https://github.com/NvChad/nvterm) - Provides a terminal to our IDE where we can issue commands. The terminal can be opened within the buffer in various ways:

- `<ALT-h>` opens a terminal by dividing the buffer horizontally
- `<ALT-v>` opens the terminal by dividing the buffer vertically
- `<ALT-i>` opens a terminal in a floating tab
- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Allows you to use the tree-sitter interface in Neovim, and provide some basic functionality, such as highlighting.

- [NvChad/nvim-colorizer.lua](https://github.com/NvChad/nvim-colorizer.lua) - Another plugin written by the developers of NvChad. It is specifically a high-performance highlighter.
- [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - Provides decoration for *git* with reports for added, removed, and changed lines-reports that are also integrated into the *statusline*.

- [kyazdani42/nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons) - Adds icons (requires one of the Nerd Fonts) to file types and folders in our IDE. This allows us to visually identify file types in our File Explorer, to speed up operations.
- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) - Allows simplified management of LSP (Language Server) installation through a convenient graphical interface.

- [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) - Provides guides to better identify indentation in the document, allowing sub-routines and nested commands to be easily recognized.
- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - Provides the appropriate configurations for almost every language server available. It is a community collection, with the most relevant settings already set. The plugin takes care of receiving our configurations and putting them into the editor environment.

- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Allows you to use the tree-sitter interface in Neovim, and provide some basic functionality, such as highlighting.
- [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) con i rispettivi sorgenti forniti dai plugin:

- [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - Provides decoration for *git* with reports for added, removed, and changed lines-reports that are also integrated into the *statusline*.
- [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip)
- [saadparwaiz1/cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip)
- [hrsh7th/cmp-nvim-lua](https://github.com/hrsh7th/cmp-nvim-lua)
- [hrsh7th/cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp)
- [hrsh7th/cmp-buffer](https://github.com/hrsh7th/cmp-buffer)
- [hrsh7th/cmp-path](https://github.com/hrsh7th/cmp-path)

## LSP functionality
- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) - Thanks to this plugin we have the functionality of automatic closing of parentheses and other characters. For example, by inserting a beginning parenthesis `(` completion will automatically insert the closing parenthesis `)` placing the cursor in the middle.

Now let's move on to the plugins that provide the functionality to integrate LSPs (Language Server Protocols) into our projects. This is definitely one of the best features provided by NvChad. Thanks to LSPs we can be in control of what we write in real time.
- [numToStr/Comment.nvim](https://github.com/numToStr/Comment.nvim) - Provides advanced functionality for code commenting.

- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) - Allows simplified management of LSP (Language Server) installation through a convenient graphical interface. The commands provided are:

- `:Mason`
- `:MasonInstall`
- `:MasonUninstall`
- `:MasonUnistallAll`
- `:MasonLog`
- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - Provides advanced file search capabilities, is highly customizable, and can also be (for example) used for selecting NvChad themes (command `:Telescope themes`).

- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - Provides the appropriate configurations for almost every language server available. It is a community collection, with the most relevant settings already set. The plugin takes care of receiving our configurations and putting them into the editor environment.
![Telescope find_files](../images/telescope_find_files.png)

It provides the following commands:

- `:LspInfo`
- `:LspStart`
- `:LspStop`
- `:LspRestart`
=== "ui.lua plugins"

## Lua Code
- [NvChad/base46](https://github.com/NvChad/base46) - Provides themes for the interface.

Following LSP, come all the plugins that provide functionality in writing and executing Lua code such as snippets, lsp commands, buffers etc. We will not go into detail on these, but they can be viewed in their respective projects on GitHub.
- [NvChad/ui](https://github.com/NvChad/ui) - Provides the actual interface and the core utilities of NvChad. Thanks to this plugin we can have a *statusline* that gives us the information during editing and a *tabufline* that allows us to manage open buffers. This plugin also provides the utilities **NvChadUpdate** for updating it, **NvCheatsheet** for an overview of keyboard shortcuts, and **Nvdash** from which file operations can be performed.

The plugins are:
- [NvChad/nvim-colorizer.lua](https://github.com/NvChad/nvim-colorizer.lua) - Another plugin written by the developers of NvChad. It is specifically a high-performance highlighter.

- [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip)
- [rafamadriz/friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
- [saadparwaiz1/cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip)
- [hrsh7th/cmp-nvim-lua](https://github.com/hrsh7th/cmp-nvim-lua)
- [hrsh7th/cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp)
- [hrsh7th/cmp-buffer](https://github.com/hrsh7th/cmp-buffer)
- [hrsh7th/cmp-path](https://github.com/hrsh7th/cmp-path)
- [kyazdani42/nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons) - Adds icons (requires one of the Nerd Fonts) to file types and folders in our IDE. This allows us to visually identify file types in our File Explorer, to speed up operations.

## Mixed Plugins
- [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) - Provides guides to better identify indentation in the document, allowing sub-routines and nested commands to be easily recognized.

- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) - Thanks to this plugin we have the functionality of automatic closing of parentheses and other characters. For example, by inserting a beginning parenthesis `(` completion will automatically insert the closing parenthesis `)` placing the cursor in the middle.
- [kyazdani42/nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) - A File Explorer for Neovim that allows the most common operations on files (copy, paste, etc.), has integration with Git, identifies files with different icons, and other features. Most importantly, it updates automatically (this is very useful when you work with Git repositories).

- [numToStr/Comment.nvim](https://github.com/numToStr/Comment.nvim) - Provides advanced functionality for code commenting.
![Nvim Tree](../images/nvim_tree.png)

## File Management
- [folke/which-key.nvim](https://github.com/folke/which-key.nvim) - Displays all possible autocompletions available for the entered partial command.

- [kyazdani42/nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) - A File Explorer for Neovim that allows the most common operations on files (copy, paste, etc.), has integration with Git, identifies files with different icons, and other features. Most importantly, it updates automatically (this is very useful when you work with Git repositories).

![Nvim Tree](../images/nvim_tree.png)
![Which Key](../images/which_key.png)

- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - Provides advanced file search capabilities, is highly customizable, and can also be (for example) used for selecting NvChad themes (command `:Telescope themes`).

![Telescope find_files](../images/telescope_find_files.png)
## Conclusions and final thoughts

- [folke/which-key.nvim](https://github.com/folke/which-key.nvim) - Displays all possible autocompletions available for the entered partial command.

![Which Key](../images/which_key.png)
There's a huge amount of work by the NvChad developers that must be acknowledged. They have created an integrated environment among all plugins which makes the user interface clean and professional. In addition, plugins that work *under the hood* allow for enhanced editing and other features.

Having introduced the plugins that make up the basic configuration of NvChad, we can move on to see how to manage them.
All of this means that ordinary users can have, in an instant, a basic IDE with which to start working, and an extensible configuration that can adapt to their needs..
Loading

0 comments on commit 45893b8

Please sign in to comment.