Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
acb6bdf
reinitiated NvChad Guide on development branch
ambaradan Aug 17, 2022
75e909d
added additional_software.md
ambaradan Aug 17, 2022
8f504e3
added install_nvim.md
ambaradan Aug 17, 2022
e5a79ca
added install_nvchad.md
ambaradan Aug 17, 2022
f9f2fcf
added nerd_fonts.md
ambaradan Aug 17, 2022
493b499
added nvchad_ui/builtin_plugins.md
ambaradan Aug 17, 2022
58ce283
added nvchad_ui/nvchad_ui.md and .pages
ambaradan Aug 17, 2022
ebcd9cd
added custom/lsp.md
ambaradan Aug 17, 2022
3346b1a
added custom/custom_folder.md and .pages
ambaradan Aug 17, 2022
47c81ba
added main .pages
ambaradan Aug 17, 2022
abe00cf
edited nvchad_ui.md ready for review
ambaradan Aug 17, 2022
186c520
add tag H1 inside the document
ambaradan Aug 18, 2022
a55763d
Editing pass `nvchad_ui.md`
sspencerwire Aug 18, 2022
81dd626
add tested meta
sspencerwire Aug 18, 2022
f34796f
Edited incorrect link and corrected strings
ambaradan Aug 19, 2022
8dd5190
Removed configuration no longer needed with Mason introduction
ambaradan Aug 20, 2022
ff09679
Wrong key corrected
ambaradan Aug 20, 2022
4fc926f
added introduction - fixed the titles
ambaradan Aug 21, 2022
f9bf922
Merge branch 'rocky-linux:main' into nvchad
ambaradan Aug 21, 2022
cf048aa
added installation from source
ambaradan Aug 21, 2022
39b7975
added page using_nvchad.md - edited .pages
ambaradan Aug 22, 2022
43cd813
small change
ambaradan Aug 22, 2022
ecc5dfd
Merge branch 'nvchad' of github.com:ambaradan/documentation into nvchad
ambaradan Aug 22, 2022
d216fee
fix headers
ambaradan Aug 22, 2022
4760252
fix headers - remove Usefull Plugins
ambaradan Aug 22, 2022
5834b41
added chadrc_lua.md
ambaradan Aug 22, 2022
ac9204b
Editing pass
sspencerwire Aug 22, 2022
84c25ab
modified INSERT mode commands - inserted explicit keys
ambaradan Aug 23, 2022
294ba7e
Merge branch 'nvchad' of github.com:ambaradan/documentation into nvchad
ambaradan Aug 23, 2022
fbe4586
added init_lua.md - custom/init.lua description
ambaradan Aug 23, 2022
554f960
added custom/mapping_lua.md
ambaradan Aug 23, 2022
f0f1aab
Merge branch 'rocky-linux:main' into nvchad
ambaradan Aug 23, 2022
17c67da
Merge branch 'rocky-linux:main' into nvchad
ambaradan Aug 25, 2022
ad1e87e
added override_lua.md page
ambaradan Aug 25, 2022
dc45033
Merge branch 'nvchad' of github.com:ambaradan/documentation into nvchad
ambaradan Aug 25, 2022
e4491ed
fix custom .pages
ambaradan Aug 25, 2022
9e57a30
added custom/plugins/init_lua.md page
ambaradan Aug 26, 2022
8277ea0
added introduction - edit Using Neovim as an IDE
ambaradan Aug 26, 2022
dd62a12
fix tags
ambaradan Aug 26, 2022
8a66c58
added lspconfig_lua.md
ambaradan Aug 27, 2022
d5b0910
changed method for "rg" - linking
ambaradan Aug 27, 2022
7472c16
fixed one sentence
ambaradan Aug 27, 2022
b965c46
small fixes
ambaradan Aug 27, 2022
d29bb80
add 0.8 option
ambaradan Aug 27, 2022
7d7743a
fix sentence
ambaradan Aug 27, 2022
a3815ab
reflected mason plugin change
ambaradan Aug 27, 2022
fcc9383
fix consistency
ambaradan Aug 28, 2022
67ac035
fix consistency
ambaradan Aug 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/books/nvchad/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
nav:
- ... | index*.md
- ... | additional_software*.md
- ... | install_nvim*.md
- ... | install_nvchad*.md
- ... | nerd_fonts*.md
- NvChad UI: nvchad_ui
- Customisation: custom
67 changes: 67 additions & 0 deletions docs/books/nvchad/additional_software.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Additional Software
author: Franco Colussi
contributors: Steven Spencer
tested with: 9.0
tags:
- nvchad
- coding
---

# Additional Software Needed

There are several pieces of additional software that, while not required, will aid in the overall use of NvChad. The sections below will walk you through that software and its uses.

## RipGrep

`ripgrep` is a line-oriented search tool that recursively searches the current directory for a _regex_ (regular expression) pattern. By default, _ripgrep_ respects the rules of _gitignore_ and automatically skips hidden files/directories and binaries. Ripgrep offers excellent support on Windows, macOS and Linux, with binaries available for each release.

Ripgrep is software written in _Rust_ and is installable with the `cargo` utility. Note, however, that `cargo` is not installed by the default installation of _rust_ so you have to install it explicitly.

```bash
dnf install rust cargo
```

Once the necessary software is installed, we can install `ripgrep` with:

```bash
cargo install ripgrep
```

The installation will save the `rg` executable in the `~/.cargo/bin` folder which is outside the PATH, to use it at the user level we will link it to `~/.local/bin/`.

```bash
ln -s ~/.cargo/bin/rg ~/.local/bin/
```

At this point we can check that everything is okay with:

```bash
rg --version
ripgrep 13.0.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
```

RipGrep is needed for recursive searches with `:Telescope`.

## Lazygit

[LazyGit](https://github.com/jesseduffield/lazygit) is an ncurses-style interface that allows you to perform all `git` operations in a more user-friendly way, it is required by the _lazygit.nvim_ plugin, this plugin makes it possible to use LazyGit directly from NvChad, it opens a floating window from where you can perform all operations on your repositories, thus allowing you to make all changes to the _git repository_ without leaving the editor.

To install it we can use the repository for Fedora. On Rocky Linux 9 it works perfectly.

```bash
sudo dnf copr enable atim/lazygit -y
sudo dnf install lazygit
```

Once installed we open a terminal and type the command `lazygit` and an interface similar to this will appear:

![LazyGit UI](images/lazygit_ui.png)

with the <kbd>x</kbd> key we can bring up the menu with all available commands.

![LazyGit UI](images/lazygit_menu.png)

Now that we have all the necessary supporting software on our system we can move on to installing the basic software, the editor on which all the configuration is based, [Neovim](install_nvim.md).
9 changes: 9 additions & 0 deletions docs/books/nvchad/custom/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
nav:
- ... | custom_folder*.md
- ... | chadrc_lua*.md
- ... | init_lua*.md
- ... | mappings_lua*.md
- ... | override_lua*.md
- Plugins: plugins
- ... | lsp*.md
52 changes: 52 additions & 0 deletions docs/books/nvchad/custom/chadrc_lua.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: WIP - chadrc.lua
tags:
- nvhad
- coding
- editor
---

# chadrc.lua

The chadrc.lua file in our `custom` folder contains information about where NvChad should look for additional configurations and personal plugins.

Special attention must be paid to the file hierarchy as there may be multiple files with the same name (see *init.lua*) but in different locations, the location is what determines the order in which the files are included in the configuration. Respectively `core` -> `custom` -> `plugins`.

The contents of the `chadrc.lua` file are as follows:

```lua
local M = {}
local override = require("custom.override")

M.ui = {
theme = "everforest",
theme_toggle = { "everforest", "everforest_light" },
}

M.mappings = require("custom.mappings")

M.plugins = {
user = require("custom.plugins"),
override = {
["kyazdani42/nvim-tree.lua"] = override.nvimtree,
["nvim-treesitter/nvim-treesitter"] = override.treesitter,
["lukas-reineke/indent-blankline.nvim"] = override.blankline,
},
}

return M
```

The first call you encounter refers to the inclusion of our *custom/override.lua* file containing the custom settings for the plugins in the *override* table defined in `M.plugins`, in particular the customizations refer to the state of the files with respect to a Git *repository* (if you are working with one), the automatic installation of *treesitter parsers* and the exclusion of the reference lines of nested routines and commands, this functionality in writing documentation in Markdown is not that important, in case you want to have this functionality as well just remove the line:

```lua
["lukas-reineke/indent-blankline.nvim"] = override.blankline,
```

And perform a `:PackerSync`.

Then follows the configuration of the default theme with its clear variant and next the `require` call of the *custom/mapping.lua* file that contains the custom commands.

We then find settings that call up personal configuration files (contained in *custom/plugins*) that will replace the default settings.

So we can say that the *chadrc.lua* file is the file that takes care of some aspects of the UI and more importantly to include our files in the NvChad configuration.
98 changes: 98 additions & 0 deletions docs/books/nvchad/custom/custom_folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: WIP -Custom Folder
tags:
- nvchad
- coding
---

# Advanced configuration of the Custom Folder

## Introduction

NvChad uses the version manager `git` for updates, this implies that at every update part or the whole configuration is overwritten by new commits, consequently it would be useless to make customizations within the default configuration. To solve this problem the NvChad developers have set up the possibility to make your changes in a folder called `custom` which must be mandatorily placed in `.config/nvim/lua/`. Below we have a representation of the basic structure of a standard NvChad installation

```text
nvim/
├── examples
│   ├── chadrc.lua
│   └── init.lua
├── init.lua
├── LICENSE
├── lua
│   ├── core
│   └── plugins
└── plugin
└── packer_compiled.lua
```

### Structure Creation

To start the customization we have to create for first the `custom` folder that will contain all our files, let's take the opportunity to also create the `plugins` folder that will contain the _configuration files_ of our plugins, since surely the folders will not be present we will use the `-p` flag to tell the _mkdir_ command to create the missing folders, the command will be as follows:

```bash
mkdir -p ~/.config/nvim/lua/custom/plugins
```

The structure of the `nvim/lua` folder should now look like this:

```text
├── lua
│   ├── core
│   ├── custom
│   │   └── plugins
│   └── plugins
```

The choice of path is not accidental but responds to the need to preserve this folder from updates, otherwise with each update the folder would simply be deleted as it is not part of the repository. The NvChad developers have prepared a `.gitignore` file for this, which determines its exclusion.

```bash
cat .config/nvim/.gitignore
plugin
custom
spell
```

### Structure of the Custom Folder

The structure of the _custom_ folder used for this guide is as follows:

```text
custom/
├── chadrc.lua
├── init.lua
├── mappings.lua
├── override.lua
└── plugins
├── init.lua
└── lspconfig.lua
```

We are going to analyze its contents and briefly describe the files it contains; the files will be analyzed in detail later on the pages dedicated to them.

- `chadrc.lua`: this file allows the override of default configurations. It also allows plugins to be overridden so that they can then be associated with _override.lua_ configurations. For example, it is used to save the interface theme with:

```lua
M.ui = {
theme = "everforest",
}
```

- `init.lua`: this file is executed after the main `init.lua` file contained in `nvim/lua/core/` and allows the execution of personalized commands at NvChad startup.

- `mappings.lua`: allows the setting of custom commands, these commands are normally used to abbreviate standard commands. An example is the abbreviation of the command `:Telescope find_files` which with this setting in _mapping.lua_:

```lua
["\\\\"] = { "<cmd> Telescope find_files<CR>", "file finder" },
```

Allows you to retrieve **:Telescope find_files** by typing two `\\`

![Telescope Find Files](../images/telescope_find_files.png)


- `override.lua`: this file contains the custom configurations that replace the default ones, this is possible thanks to the override effected upstream in _chadrc.lua_.

Let us now move on to the `plugins` folder, the folder contains all the configuration files of the various plugins installed and most importantly the `init.lua` file. In the `init.lua` file should be inserted the plugins we want to install on our IDE. Once inserted and configured, if necessary, they will be installable via the `:PackerSync` command.

The only plugin required is _neovim/nvim-lspconfig_, which enables LSP (language server) functionality for advanced editing.

34 changes: 34 additions & 0 deletions docs/books/nvchad/custom/init_lua.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: WIP - init.lua
tags:
- nvchad
- coding
- editor
---

# init.lua

The *nvim/lua/custom/init.lua* file is used for overwriting the default NvChad options defined in *lua/core/options.lua* and setting its own options. It is also used for the execution of Auto-Commands.

Writing documents in Makdown does not require much modification; we are going to set some behaviors such as the number of spaces for tabbing, a setting that makes formatting Markdown files very smooth.

Our file will look like this:

```lua
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()]]
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead

local opt = vim.opt

opt.tabstop = 4
opt.softtabstop = 4
opt.shiftwidth = 4
opt.shiftround = false
opt.expandtab = true
opt.autoindent = true
opt.smartindent = true
```

In our example we used an auto-command for synchronous buffer formatting and formatting options.

To summarize, the *init.lua* file is used for overwriting the default settings, this is because being read after the *core/init.lua* file replaces all previous options with the new ones we set.
Loading