A simple vim configuration aiming at improving productivity while coding at the piscine and beyond.
- Customizable login: Set your login globally, and it will be automatically used in the header.
- Insert 42-style header: A function to easily insert a complete 42-style header into a new file or at the top of an existing file.
- Automatic
Updated:
line update: Updates theUpdated:
line with the current date, time, and your login every time you save a file with the 42-style header.
-
Save the script to your Vim configuration directory as
42.vim
:- Linux/macOS:
~/.vim/42.vim
- Linux/macOS:
-
Source the script in your
~/.vimrc
:source ~/.vim/42.vim
-
Set your login globally in the script (replace
"YOUR_LOGIN"
with your actual login):let g:my_login = "YOUR_LOGIN"
-
Done! The script is now ready to use.
To insert the 42-style header at the top of a file, run the following command:
:call InsertHeader()
This will insert the header at the top of the file, including placeholders for the filename, your login, and the current date.
Every time you save a file, the Updated:
line in the 42-style header will automatically be updated with the current timestamp and your login.
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* myfile.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: johndoe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/01 12:34:56 by johndoe #+# #+# */
/* Updated: 2025/02/01 11:55:06 by johndoe ### ########.fr */
/* */
/* ************************************************************************** */
This script is open-source and available for personal or educational use.