42header is a custom Neovim plugin written in Lua that generates a standardized header for source code files. The header includes information such as the filename, author, creation date, and last updated date, along with a custom ASCII art banner.
- Automatically inserts a standard header at the top of supported file types.
- Updates the "Updated" date in the header before saving the file.
- Customizable ASCII art banner.
- Supports multiple file types with appropriate comment styles.
-
Ensure you have
packer.nviminstalled. If not, follow the installation instructions on thepacker.nvimGitHub page. -
Add the
42headerplugin to yourpackersetup in yourinit.lua:require('packer').startup(function() -- Packer can manage itself use 'wbthomason/packer.nvim' -- Add the 42header plugin use { 'MoulatiMehdi/42header.nvim', config = function() require('42header') -- Adjust the path if necessary end } end)
-
Open Neovim and run the following command to install the plugin:
:PackerSync
-
Ensure you have
lazy.nviminstalled. If not, follow the installation instructions on thelazy.nvimGitHub page. -
Add the
42headerplugin to yourlazy.nvimsetup in yourinit.lua:require('lazy').setup({ -- Other plugins { 'MoulatiMehdi/42header.nvim', config = function() require('42header') -- Adjust the path if necessary end }, })
-
Open Neovim and run the following command to install the plugin:
:Lazy sync
-
To insert the standard header, use the command:
:Stdheader
-
You can also use the shortcut
F1to insert the header. -
The plugin automatically updates the "Updated" date in the header before saving the file.
You can customize the ASCII art, the default header settings, and the supported file types by editing the 42header.lua file.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue.
Inspired by 42 header standards and Neovim customization.
