Skip to content
Binary file added docs/books/nvchad/images/install_nvchad_25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 108 additions & 92 deletions docs/books/nvchad/install_nvchad.md

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions docs/books/nvchad/marksman.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ tags:

# Marksman - code assistant

!!! 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).

Marksman is a useful tool when drafting your document for Rocky Linux. It allows the easy entry of symbols needed to define the *markdown* language tags. This allows you to write faster and reduces the possibility of errors.

NvChad/Neovim already includes text widgets that aid writing, such as the repetition of often-used words indexed by frequency of entry. The new options included by this language server will enrich these widgets.
Expand All @@ -30,7 +26,7 @@ NvChad/Neovim already includes text widgets that aid writing, such as the repeti
## Requirements and skills

- A basic knowledge of the Markdown language, recommended reading the [Markdown Guide](https://www.markdownguide.org/)
- NvChad on the machine in use with the [Template Chadr](./template_chadrc.md) properly installed
- NvChad on the machine in use properly installed

**Difficulty level** :star:

Expand All @@ -44,22 +40,20 @@ Installation of the language server does not involve any particular problems sin

The command will open the *Mason* interface and directly install the required language server. Once binary installation completes, you can close the *Mason* screen with the ++"q"++ key.

Its installation, however, does not yet involve its integration into the editor. Enable this by editing the `custom/configs/lspconfig.lua` file of the *Chadrc Template*.
Its installation, however, does not yet include its integration into the editor. To enable it, it must be placed in the `configs/lspconfig.lua` file of the configuration.

## Integration into the editor

!!! note "LSP in NvChad"

The [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin integrates the language servers into NvChad. This plugin greatly simplifies their inclusion in the NvChad configuration.

If during the editor installation you also chose to install the *Template Chadrc*, this creates the *lspoconfig.lua* file in your `custom/configs` folder.

This file takes care of entering the calls needed to use the language servers and also allows you to specify the ones you have installed. To integrate *marksman* into the editor's language server configuration you will need to edit the *local servers* string by adding your new LSP.
The file *lspconfig.lua* takes care of entering the calls needed to use the language servers and also allows you to specify the ones you have installed. To integrate *marksman* into the editor's language server configuration you will need to edit the *local servers* string by adding your new LSP.

Open your NvChad on the file with the command:

```bash
nvim ~/.config/nvim/lua/custom/configs/lspconfig.lua
nvim ~/.config/nvim/lua/configs/lspconfig.lua
```

And edit the *local servers* string, which will look as follows when completed:
Expand Down
64 changes: 53 additions & 11 deletions docs/books/nvchad/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,72 @@ tags:

# Overview

!!! 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).

## Introduction
## :material-message-outline: Introduction

The custom configuration created by the developers of NvChad allows you to have an integrated environment with many of the features of a graphical IDE. These features are built into the Neovim configuration by means of plugins. Those selected for NvChad by the developers have the function of setting up the editor for general use.

However, the ecosystem of plugins for Neovim is much broader and through their use, allows you to extend the editor to focus on your own needs.

The scenario addressed in this section is the creation of documentation for Rocky Linux, so plugins for writing Markdown code, managing Git repositories, and other tasks that relate to the purpose will be explained.

## Requirements
### :material-arrow-bottom-right-bold-outline: Requirements

- NvChad properly installed on the system with the "*template chadrc*"
- NvChad properly installed on the system
- Familiarity with the command line
- An active internet connection

## General hints about plugins
### :material-comment-processing-outline: General hints about plugins

If you chose during the installation of NvChad to also install the [template chadrc](../template_chadrc.md) you will have in your configuration a **~/.config/nvim/lua/custom/** folder. All changes for your plugins should be made in the **/custom/plugins.lua** file in that folder. In case the plugin needs additional configurations, these are placed in the **/custom/configs** folder.
The configuration of NvChad involves inserting user plugins from the `lua/plugins` folder, inside it is initially the **init.lua** file with the installation of the *conform.nvim* plugin and some examples for customizing the functionality of the system ones.
Although you can put your own plugins in the file it is advisable to use separate files for user configurations, this way you can use the initial file for any overrides of the basic plugins while you can organize your plugins in independent files according to your preferences.

Neovim, on which the configuration of NvChad is based, does not integrate an automatic configuration update mechanism with the running editor. This implies that each time the plugins file is modified, it is necessary to stop `nvim` and then reopen it to get the full functionality of the plugin.
### :material-location-enter: Inserting plugins

The `plugins` folder is queried by the configuration and all *.lua* files in it are loaded, this allows for multiple configuration files that will be merged when loading from the editor.
To be properly inserted, the additional files must have the plugins' configurations enclosed within ==lua tables==:

```lua title="lua table example"
return {
{ -- lua table
-- your plugin here
}, -- end lua table
}
```

A `configs` folder is also provided where particularly long settings of some plugins or user-modifiable parts such as in the case of *conform.nvim* can be entered.

Turning to a practical example suppose we want to include in the editor's functionality the [karb94/neoscroll.nvim](https://github.com/karb94/neoscroll.nvim) plugin, which allows for improved scrolling within very long files.
For its creation we can choose to create a `plugins/editor.lua` file where we put all plugins related to the use of the editor or a `plugins/neoscroll.lua` file and keep all additional plugins separate.

In this example the first option will be followed, so let's create a file in the `plugins` folder:

Installation of the plugin can be performed immediately after it is placed in the file since the `lazy.nvim` plugins manager keeps track of the changes in **plugins.lua** and therefore allows its "live" installation.
```bash
touch ~/.config/nvim/lua/plugins/editor.lua
```

And following the information on the project page we insert the following block of code into it:

```lua title="editor.lua"
return {
{
"karb94/neoscroll.nvim",
keys = { "<C-d>", "<C-u>" },
opts = { mappings = {
"<C-u>",
"<C-d>",
} },
},
}
```

Once saved it will be recognized by the NvChad configuration, which will take care of its insertion by making use of the functionality offered by the *lazy.nvim* handler.

Neovim, on which the configuration of NvChad is based, does not integrate an automatic configuration update mechanism with the running editor. This implies that each time the plugins file is modified, it is necessary to stop `nvim` and then reopen it to get the full functionality of the plugin.

![plugins.lua](./images/plugins_lua.png)

## Conclusions and final thoughts

There is a large ecosystem of plugins for Neovim that can be integrated into NvChad, for their research one can use the support of the site [Dotfyle](https://dotfyle.com/) which provides information on plugins and configurations for Neovim or of [Neovimcraft](https://neovimcraft.com/) which focuses instead only on available plugins. Both provide excellent general information about plugins and links to the respective projects on GitHub.

The introduction of the new plugin search feature, which has been present since version 2.5, makes it possible to organize user plugins in a very efficient and highly configurable manner. In a complex configuration, it allows plugins that require special configurations (lua code or autocmds) to be managed separately, greatly simplifying their management.
28 changes: 12 additions & 16 deletions docs/books/nvchad/plugins/md_preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ tags:

# Markdown Preview

!!! 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).

## Introduction

One of the features of the Markdown language that make it widely used in writing technical documentation is its convertibility. Code can be converted for display in many formats (HTML, PDF, plain text,..), therefore making content usable in numerous scenarios.
Expand All @@ -29,13 +25,17 @@ To integrate this functionality into your editor, two of the plugins available f

[Peek](https://github.com/toppair/peek.nvim) uses [Deno](https://deno.com/manual) a JavaScript, TypeScript and WebAssembly runtime with default and secure settings for its operation. By default Deno does not allow any file, network or environment access unless explicitly enabled.

If you have also installed the [Template Chadrc](../template_chadrc.md) this component will already be available as it is one of the language servers installed by default. In case it is not yet present in the editor you can install it with the command `:MasonInstall deno`.
To install the language server in the editor configuration, the *mason.nvim* plugin is used, which provides the command `:MasonInstall`, a command that enables the automatic inclusion and configuration of *Deno*.

```text
:MasonInstall deno
```

!!! Warning

The language server **must** be installed before proceeding to install the plugin. Otherwise the installation will fail and it will be necessary to remove the code from **/custom/plugins.lua**, perform a configuration cleanup by opening `Lazy` and typing ++"X"++ to delete the plugin and then repeat the installation procedure.
The language server **must** be installed before proceeding to install the plugin. Otherwise the installation will fail and it will be necessary to remove the code from **plugins/init.lua**, perform a configuration cleanup by opening `Lazy` and typing ++"X"++ to delete the plugin and then repeat the installation procedure.

To install the plugin you will have to edit the file **/custom/plugins.lua** by adding the following block of code:
To install the plugin you will have to edit the file **plugins/init.lua** by adding the following block of code:

```lua
{
Expand Down Expand Up @@ -83,7 +83,7 @@ In this configuration, the "browser" method was chosen, which opens the file to

[Markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim) is a plugin written in `node.js` (JavaScript). Its installation on NvChad does not require any dependencies as the developers provide a precompiled version that works perfectly in the editor.

To install this version you will need to add this code block to your **/custom/plugins.lua**:
To install this version you will need to add this code block to your **plugins/init.lua**:

```lua
{
Expand Down Expand Up @@ -125,16 +125,12 @@ vim.g.mkdp_browser = "/usr/bin/chromium-browser"

This way the next time NvChad is opened, `chromium-browser` will be used regardless of the system's default browser.

The configuration also provides the commands `:MarkdownPreview` and `:MarkdownPreviewStop` to open and close the preview, respectively. For faster access to the commands you can map them to the **/custom/mapping.lua** file as follows:
The configuration also provides the commands `:MarkdownPreview` and `:MarkdownPreviewStop` to open and close the preview, respectively. For faster access to the commands you can map them to the **mapping.lua** file as follows:

```lua
-- binding for Markdown Preview
M.mdpreview = {
n = {
["<leader>mp"] = { "<cmd> MarkdownPreview<CR>", "Open Preview" },
["<leader>mc"] = { "<cmd> MarkdownPreviewStop<CR>", "Close Preview" },
},
}
-- mapping for Markdown Preview
map("n", "<leader>mp", "<CMD> MarkdownPreview<CR>", { desc = "Open Preview" })
map("n", "<leader>mc", "<CMD> MarkdownPreviewStop<CR>", { desc = "Close Preview" })
```

This will allow you to open the markdown preview by typing ++enter++ + ++"m"++ followed by ++"p"++ and close it with the combination ++enter++ + ++"m"++ followed by ++"c"++.
Expand Down
14 changes: 3 additions & 11 deletions docs/books/nvchad/plugins/projectmgr.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ tags:

## Introduction

!!! 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).

One of the features that an IDE must surely have is the ability to manage the various projects that a developer or publisher works on. Being able to select the project to work on once NvChad is open, without the need to type commands in the *statusline* to achieve the goal. This saves time and allows for simplified management in the case of a large number of projects.

Using [charludo/projectmgr.nvim](https://github.com/charludo/projectmgr.nvim) will integrate this functionality. The plugin provides excellent integration with `Telescope` and some interesting additional features such as the ability to synchronize a *git* repository when opening the *project*.
Expand All @@ -25,7 +21,7 @@ The plugin also tracks the status of the editor when it closes allowing you to h

### Plugin installation

To install the plugin you will need to edit the **custom/plugins.lua** file by adding the following block of code:
To install the plugin you will need to edit the **plugins/init.lua** file by adding the following block of code:

```lua
{
Expand Down Expand Up @@ -145,15 +141,11 @@ To check if the open files do not match those updated from the repository you ca

### Mapping

To speed up the opening of your projects, you can create a keyboard shortcut to put in your mapping in **/custom/mapping.lua**. An example might be:
To speed up the opening of your projects, you can create a keyboard shortcut to put in your mapping in **mapping.lua**. An example might be:

```lua
-- Projects
M.projects = {
n = {
["<leader>fp"] = { "<cmd> ProjectMgr<CR>", "Open Projects" },
},
}
map("n", "<leader>fp", "<CMD> ProjectMgr<CR>", { desc = "Open Projects" })
```

With the editor in the **NORMAL** state you can open the project manager with the combination ++space++ + ++"f"++ followed by ++"p"++.
Expand Down
10 changes: 3 additions & 7 deletions docs/books/nvchad/vale_nvchad.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ tags:

# `vale` in NvChad (Neovim)

!!! 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-message-outline: Introduction

`vale.sh` is one of the foremost open source projects for technical writers looking to improve their voice and style consistency. It can be used with a number of editors on nearly every major OS platform (Linux, MacOS, Windows). You can find out more about the project by heading up to [the vale.sh website](https://vale.sh/). This guide is going to walk you through adding `vale` to NvChad. Since it is included in the Mason packages used for install, the process is not too difficult, although it does involve some minor editing and configuration to get things going. To be clear, NvChad is really the configuration manager for the editor Neovim, so from this point forward, the reference will be `nvim`.
Expand All @@ -27,7 +23,7 @@ tags:

The [nvim-lint](https://github.com/mfussenegger/nvim-lint) plugin provides support for inserting ==linters== into the editor by correcting code or content for both the syntactic and semantic parts.

To install the plugin, you need to edit the `custom/plugins.lua` file by adding the following block of code:
To install the plugin, you need to edit the `lua/plugins/init.lua` file by adding the following block of code:

```lua title="plugins.lua"
{
Expand All @@ -39,7 +35,7 @@ To install the plugin, you need to edit the `custom/plugins.lua` file by adding
},
```

The plugin has a configuration file to be placed in the `custom/configs` folder. Inside it we find a table ==linters_by_ft== where you can enter the *linters* for the languages used for development.
The plugin has a configuration file to be placed in the `lua/configs` folder. Inside it we find a table ==linters_by_ft== where you can enter the *linters* for the languages used for development.

```lua title="lint.lua"
require("lint").linters_by_ft = {
Expand Down Expand Up @@ -127,7 +123,7 @@ Just having `vale` installed is not enough. You need a couple of additional item

### :material-file-edit-outline: The `lint.lua` file changes

There is one final step needed. You need to change the `lint.lua` file found in `~/.config/nvim/lua/custom/configs/` and add the `vale` linter.
There is one final step needed. You need to change the `lint.lua` file found in `~/.config/nvim/lua/configs/` and add the `vale` linter.

Using the example shown above to add *vale* to the linter available for markdown files it will be necessary to add the new linter to the string already present:

Expand Down