diff --git a/docs/books/nvchad/images/install_nvchad_25.png b/docs/books/nvchad/images/install_nvchad_25.png new file mode 100644 index 0000000000..d6008c2256 Binary files /dev/null and b/docs/books/nvchad/images/install_nvchad_25.png differ diff --git a/docs/books/nvchad/install_nvchad.md b/docs/books/nvchad/install_nvchad.md index 0c461d00c4..8c99c03289 100644 --- a/docs/books/nvchad/install_nvchad.md +++ b/docs/books/nvchad/install_nvchad.md @@ -11,23 +11,17 @@ tags: # :simple-neovim: Turning Neovim into an advanced IDE -!!! 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-arrow-bottom-right-bold-outline: Pre-requisites As specified on the NvChad site you need to ensure the system meets the following requirements: -* [Neovim 0.9.4](https://github.com/neovim/neovim/releases/tag/v0.9.4). +* [Neovim 0.9.5](https://github.com/neovim/neovim/releases/tag/v0.9.4). * [Nerd Font](https://www.nerdfonts.com/) Set it in your terminal emulator. * Make sure the nerd font you set doesn't end with **Mono** * **Example:** Iosevka Nerd Font and not ~~Iosevka Nerd Font Mono~~ * [Ripgrep](https://github.com/BurntSushi/ripgrep) is required for grep searching with Telescope **(OPTIONAL)**. * GCC and Make -This is actually not a real "installation" but rather writing a custom Neovim configuration for our user. - ??? warning "Performing a Clean Installation" As specified in the requirements, installing this new configuration on top of a previous one can create unfixable problems. A clean installation is recommended. @@ -61,142 +55,164 @@ rm -rf ~/.cache/nvim ## :material-monitor-arrow-down-variant: Installation -Now that we have cleaned up, we can move on to installing NvChad. +The creation of the configuration structure is implemented by copying files from an initialization repository (==starter==) using *Git*. This method allows installing the NvChad configuration, prepared as a Neovim plugin, within the *lazy.nvim* plugin manager. +The configuration in this way is updated like all other plugins thus simplifying its management by the user, moreover this approach makes the entire user configuration independent allowing its total management and distribution among multiple machines. -### :octicons-repo-clone-16: Clone configuration - -To do this, simply run the following command from any location within your *home directory*: +To download and initialize the configuration use the following command: ```bash -git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim +git clone https://github.com/NvChad/starter ~/.config/nvim && nvim ``` -The first part of the command clones the NvChad repository to the ==~/.config/nvim== folder; this is Neovim's default path for searching the user configuration. The ==--depth 1== option instructs *git* to clone only the repository set as "default" on GitHub. +The command consists of two parts, the first downloads the contents of the *starter* repository to `~/.config/nvim/` (default folder for Neovim settings) while the second invokes the ==nvim== executable which initializes the editor with the configuration you just downloaded. Once you have finished installing the plugins and parsers you will be faced with the following screen, to close the plugins manager type ++"q "++ : -Once the cloning process is finished in the second part of the command, the Neovim executable (*nvim*) is called, which upon finding a configuration folder will start importing the configurations encountered in the ==init.lua== files of it in a predefined order. +![NvChad Install](images/install_nvchad_25.png) -### :material-timer-cog-outline: Bootstrap +The initial configuration is a minimal configuration that provides a starting point for your own customization. As evidenced by the screenshot when the editor is first started, only four modules (==plugins==), marked with a checkmark, are loaded, which are as follows: -Before starting the bootstrap, the installation will offer us the installation of a base structure (*template chadrc*) for our further customization: +* **base46** - providing editor themes +* **NvChad** - the basic configuration that allows the user configuration to be entered into Neovim +* **nvim-treesitter** - for analysis and highlighting of code +* **ui** - the editor interface (statusline, tabufline..) -> Do you want to install chadrc template? (y/n): +The remaining modules will be activated, thanks to the ==*lazyloading*== technique, when the functionality provided by the module is requested; this improves the performance of the editor in general and in particular improves its startup time. -Although choosing to install the recommended structure is not mandatory, it is definitely recommended for anyone new to this Editor. Current users of NvChad who already have a ==custom== folder will be able to continue using it after making the necessary changes. +The editor at this point is ready to be used, the following sections are an in-depth look at the installation process and are not necessary for its day-to-day use, if interested only in its use you can turn to the [Using NvChad](./nvchad_ui/using_nvchad.md) page. +A reading of the [official documentation](https://nvchad.com/docs/quickstart/install) for an introduction to its components and functionality remains recommended, however. -The structure created by the template will also be used in this guide for developing the configuration to be used for writing documents in Markdown. +To close the editor use the key ++colon++ ++"q "++. -For those who want to learn more about this topic before starting the installation, they can consult the dedicated page [Template Chadrc](template_chadrc.md). +### :material-timer-cog-outline: Bootstrap -The page contains information about the structure of the folder that will be created, the functions of related files, and other useful information for customizing NvChad. +The bootstrap process is implemented in the ==*init.lua*== file of the *starter* repository and consists of the following steps: -At this point the downloading and configuration of the basic plugins and if we have chosen to install the template as well the installation of the configured language server will begin. Once the process is complete, we will have our Editor ready to use. +An initial setting of the default theme path and `` key, in this case the ++space++ key: -![Installation](images/installed_first_time.png) +```lua +vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +vim.g.mapleader = " " +``` -As can be seen from the screenshot below, thanks to the configuration changes made, the editor has completely changed in appearance from the basic version of Neovim. It should be remembered, however, that although the configuration of NvChad completely transforms the editor, the base remains Neovim. +A subsequent installation of the main **lazy.nvim** plugin: -![NvChad Rockydocs](images/nvchad_ui.png) +```lua +-- bootstrap lazy and all plugins +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -## :material-file-tree-outline: Configuration Structure +if not vim.loop.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } +end -The installed configuration consists of two parts, one part dedicated to the editor that remains under version control (==git==) of the NvChad repository and one dedicated to user customization that is excluded from version control through the use of a ==.gitignore== file. +vim.opt.rtp:prepend(lazypath) -This makes it possible to update the editor without compromising personal configuration. +local lazy_config = require "configs.lazy" +``` -### Basic structure +And installation of NvChad plugins and all those configured in the `plugins` folder: -The part reserved for the editor is as follows: +```lua +-- load plugins +require("lazy").setup({ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + config = function() + require "options" + end, + }, + + { import = "plugins" }, +}, lazy_config) +``` -```text -.config/nvim -├── init.lua -├── lazy-lock.json -├── LICENSE -└── lua - ├── core - │   ├── bootstrap.lua - │   ├── default_config.lua - │   ├── init.lua - │   ├── mappings.lua - │   └── utils.lua - └── plugins - ├── configs - │   ├── cmp.lua - │   ├── lazy_nvim.lua - │   ├── lspconfig.lua - │   ├── mason.lua - │   ├── nvimtree.lua - │   ├── others.lua - │   ├── telescope.lua - │   └── treesitter.lua - └── init.lua +Then apply the theme to the *default* and *statusline* settings: + +```lua +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") +``` + +When finished, the ==autocmds== ([Neovim auto-commands](https://neovim.io/doc/user/autocmd.html)) required for configuration operation and keyboard mappings are also entered: + +```lua +require "nvchad.autocmds" + +vim.schedule(function() + require "mappings" +end) ``` -### Template Structure +## :material-file-tree-outline: Configuration Structure -While the part concerning customization consists of the following structure: +The structure installed by NvChad is as follows: ```text -.config/nvim/lua/custom/ -├── chadrc.lua -├── configs -│   ├── lspconfig.lua -│   ├── null-ls.lua -│   └── overrides.lua -├── highlights.lua +~/.config/nvim/ ├── init.lua -├── mappings.lua -├── plugins.lua +├── lazy-lock.json +├── LICENSE +├── lua +│   ├── chadrc.lua +│   ├── configs +│   │   ├── conform.lua +│   │   └── lazy.lua +│   ├── mappings.lua +│   ├── options.lua +│   └── plugins +│   └── init.lua └── README.md ``` -## :octicons-file-code-16: Structure analysis +It consists of a starting file **init.lua** that initializes and coordinates the insertion of customizations into the configuration of ==Neovim==, this file initially looks identical to the file used by the *bootstrap* from the **starter** repository shown above, it will be used later for loading other files into the configuration such as its own *autocommands.lua* file. -The first file we encounter is the `init.lua` file which initializes the configuration by inserting the `lua/core` folder and `lua/core/utils.lua` (and if present, the `lua/custom/init.lua`) files into the *nvim* tree. Runs the bootstrap of `lazy.nvim` (the plugin manager) and once finished initialize the `plugins` folder. +This is followed by the **lazy-lock.json** file where all the plugins in the installation and their status with respect to development on *GitHub* are stored.This file allows the editor status to be synchronized between installations present on multiple machines and to make custom installations replicating the desired status. -In particular, the `load_mappings()` function is called for loading keyboard shortcuts. In addition, the `gen_chadrc_template()` function provides the subroutine for creating the `custom` folder. +The rest of the configuration is located in the `lua` folder and is initialized starting with the **chadrc.lua** file, which in the initial version contains only the editor theme setting. +This file is used for customizing the appearance of the editor (==UI==) and shares syntax with the [nvconfig.lua](https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua) file of the **NvChad** plugin; to compile it, simply copy the desired part of the *nvconfig.lua* file into your *chadrc.lua* and change its properties as needed. -```lua -require("core") +The next file used by the configuration, the folders will be described later, is the **option.lua** file for editor customizations, such as indentation spaces, sharing the clipboard with the guest system, and very importantly, the inclusion of the binaries installed by *Mason* in the path. +Like the previous one, it shares the syntax of the [corresponding file](https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/options.lua) of the **NvChad** plugin; for its customization as above, simply copy the options and edit them. -local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1] +Last, the **mapping.lua** file is encountered where to set the keyboard keys to invoke the various features offered by the editor. The initial file contains the key mapping for entering **COMMAND** mode, for formatting with *conform.nvim* and the key for exiting **INSERT** mode. +The keys use Neovim's native `vim.keymap.set` syntax and for their configuration you can refer to NvChad's [default mapping](https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/mappings.lua) or alternatively to the help page included in Neovim `:h vim.keymap.set`. -if custom_init_path then - dofile(custom_init_path) -end +```lua +require "nvchad.mappings" -require("core.utils").load_mappings() +-- add yours here -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +local map = vim.keymap.set --- bootstrap lazy.nvim! -if not vim.loop.fs_stat(lazypath) then - require("core.bootstrap").gen_chadrc_template() - require("core.bootstrap").lazy(lazypath) -end +map("n", ";", ":", { desc = "CMD enter command mode" }) -vim.opt.rtp:prepend(lazypath) -require("plugins") +map("n", "fm", function() + require("conform").format() +end, { desc = "File Format with conform" }) -dofile(vim.g.base46_cache .. "defaults") +map("i", "jk", "", { desc = "Escape insert mode" }) ``` -Inclusion of the `core` folder also results in the inclusion of the `core/init.lua` file, which overrides some Neovim interface configurations and prepares for buffer management. +The two folders included in the configuration `configs` and `plugins` both serve to manage plugins; personal plugins should be placed in the `plugins` folder and their additional configurations, if any, in the `configs` folder. +Initially, a *plugins/init.lua* file will be available for installation with the *conform.lua* plugin configured in *configs/conform.lua* and *nvimtree.nvim* with the option for decorations related to *Git* inside it. -As we can see, each `init.lua` file is included following a well-established order. This is used to selectively override the various options from the basic settings. Broadly speaking, we can say that `init.lua` files have the functions to load global options, autocmds, or anything else. +!!! notes "Organization of plugins" -Continuing with the structural analysis, we find the *lua/plugins* folder, which contains the setup of the built-in plugins and their configurations. The main plugins in the configuration will be described in the next section. As we can see, the *core/plugins* folder also contains an ==init.lua== file, which is used here for the installation and subsequent compilation of the plugins. + The inclusion of plugins is done by inserting any properly configured file present in the `plugins` folder, this allows the plugins to be organized, for example by purpose, by creating separate files (*utils.lua*, *editor.lua*, *markdown.lua*, etc.) in this way it is possible to work on the configuration in a more orderly manner. -Finally, we find the ==lazy-lock.json== file. This file allows us to synchronize the configuration of NvChad plugins across multiple workstations, so that we have the same functionality on all the workstations used. Its function will be better explained in the section dedicated to the plugins manager. +There are also files for *licensing* and a *README.md* copied from the **starter** repository that can be used to illustrate one's configuration in case it is maintained in a *Git* repository. ## :material-keyboard-outline: Main keyboard keys -The installation of NvChad also inserts a set of keys for common commands into the editor, their configuration is contained in the file `lua/core/mappings.lua` and can be modified or extended with the file `lua/custom/mappings.lua`. - This is the call that returns basic command mappings: ```lua -require("core.utils").load_mappings() +vim.schedule(function() + require "mappings" +end) ``` This sets four main keys from which, in association with other keys, commands can be launched. The main keys are: @@ -210,10 +226,10 @@ This sets four main keys from which, in association with other keys, commands ca We will refer to these key mappings several times throughout these documents. -These are some of the keys set. We recommend consulting the file mentioned above for an exhaustive list. +The default mapping is contained in *lua/mapping.lua* of the NvChad plugin but can be extended with other custom commands using its own *mappings.lua*. `th` to change the theme ++space++ + ++"t"++ + ++"h"++ `` to open nvimtree ++ctrl++ + ++"n"++ `` to open a terminal in a floating tab ++alt++ + ++"i"++ -There are many combinations preset for you, and they cover all the uses of NvChad. It is worth pausing to analyze the key mappings before starting to use your NvChad-configured instance of Neovim. +There are many combinations pre-set for you, and they cover all the uses of NvChad. It is worth pausing to analyze the key mappings before starting to use your NvChad-configured instance of Neovim. diff --git a/docs/books/nvchad/marksman.md b/docs/books/nvchad/marksman.md index 2bc928cfe9..96428fb2af 100644 --- a/docs/books/nvchad/marksman.md +++ b/docs/books/nvchad/marksman.md @@ -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. @@ -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: @@ -44,7 +40,7 @@ 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 @@ -52,14 +48,12 @@ Its installation, however, does not yet involve its integration into the editor. 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: diff --git a/docs/books/nvchad/plugins/index.md b/docs/books/nvchad/plugins/index.md index 4e04828805..fb574eebe8 100644 --- a/docs/books/nvchad/plugins/index.md +++ b/docs/books/nvchad/plugins/index.md @@ -11,11 +11,7 @@ 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. @@ -23,18 +19,64 @@ However, the ecosystem of plugins for Neovim is much broader and through their u 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 = { "", "" }, + opts = { mappings = { + "", + "", + } }, +}, +} +``` + +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. diff --git a/docs/books/nvchad/plugins/md_preview.md b/docs/books/nvchad/plugins/md_preview.md index 581e15fcb9..2c7b07b63e 100644 --- a/docs/books/nvchad/plugins/md_preview.md +++ b/docs/books/nvchad/plugins/md_preview.md @@ -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. @@ -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 { @@ -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 { @@ -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 = { - ["mp"] = { " MarkdownPreview", "Open Preview" }, - ["mc"] = { " MarkdownPreviewStop", "Close Preview" }, - }, -} +-- mapping for Markdown Preview +map("n", "mp", " MarkdownPreview", { desc = "Open Preview" }) +map("n", "mc", " MarkdownPreviewStop", { 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"++. diff --git a/docs/books/nvchad/plugins/projectmgr.md b/docs/books/nvchad/plugins/projectmgr.md index d64188f676..b7eba25d39 100644 --- a/docs/books/nvchad/plugins/projectmgr.md +++ b/docs/books/nvchad/plugins/projectmgr.md @@ -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*. @@ -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 { @@ -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 = { - ["fp"] = { " ProjectMgr", "Open Projects" }, - }, -} +map("n", "fp", " ProjectMgr", { desc = "Open Projects" }) ``` With the editor in the **NORMAL** state you can open the project manager with the combination ++space++ + ++"f"++ followed by ++"p"++. diff --git a/docs/books/nvchad/vale_nvchad.md b/docs/books/nvchad/vale_nvchad.md index 960d6a2ed3..40d707372a 100644 --- a/docs/books/nvchad/vale_nvchad.md +++ b/docs/books/nvchad/vale_nvchad.md @@ -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`. @@ -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" { @@ -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 = { @@ -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: