An open API service indexing awesome lists of open source software.

https://github.com/vinicius507/ft_nvim

A Neovim plugin for École 42
https://github.com/vinicius507/ft_nvim

42header 42saopaulo 42school ecole-42 neovim neovim-plugin norminette

Last synced: about 1 month ago
JSON representation

A Neovim plugin for École 42

Awesome Lists containing this project

README

          

# 42 Nvim

Neovim plugin for [École 42](https://42.fr).

## Features

- **42 Header**: Utilities to manage the 42 header in your files.
- **Norminette Integration**: Use [norminette](https://github.com/42School/norminette) as a diagnostics source.

## Installation

**Requirements:**

- [Neovim](https://github.com/neovim/neovim) >= 0.6.0
- [nvim-lint](https://github.com/mfussenegger/nvim-lint) (Optional, used for norminette integration)

You can install the plugin using your favorite package manager:

- [lazy.nvim 💤](https://github.com/folke/lazy.nvim)

```lua
---@type LazySpec
return {
"vinicius507/ft_nvim",
cmd = { "FtHeader", "Norme" }, -- Lazy load the commands.
ft = { "c", "cpp" }, -- Lazy load for .c and .h files.
---@type ft_nvim.Config
opts = {},
}
```

- [packer.nvim](https://github.com/wbthomason/packer.nvim)

```lua
use({
"vinicius507/ft_nvim",
cmd = { "FtHeader", "Norme" }, -- Lazy load the commands.
ft = { "c", "cpp" }, -- Lazy load for .c and .h files.
config = function()
require("ft_nvim").setup()
end,
})
```

- Neovim's built-in package manager

```sh
git clone --depth 1 https://github.com/vinicius507/ft_nvim \
${XDG_DATA_HOME:-~/.local/share}/nvim/site/pack/packer/start/ft_nvim
```

## Configuration

The plugin can be configured by calling the `setup` function and passing an optional configuration object.

The following options are available:

```lua
require("ft_nvim").setup({
-- Configures the 42 Header integration
header = {
-- Enable the 42 Header integration (default: true).
enabled = true,
-- Your Intranet username (default: "marvin").
username = "marvin",
-- Your Intranet email (default: "marvin@42.fr").
email = "marvin@42.fr",
},
-- Configures the norminette integration.
norminette = {
-- Enable the norminette integration (default: true).
enabled = true,
-- The command to run norminette (default: "norminette").
cmd = "norminette",
-- A function to conditionally enable the norminette integration (default: nil)
condition = function()
return true
end,
},
})
```