Automates the installation and configuration of the basic environment to get started in the 42 cursus.
Tested on Ubuntu 22.04 LTS
This script installs the following software if it is not already installed:
- LazyVim | Neovim setup powered + 42 Plugins
- git | Git Fast Version Control
- python3 | Python 3.10.2
- pip3 | Package Installer for Python
- zsh | ZSH Shell
- ripgrep | Recursively searches by regex pattern
- fd / fd-find | Simple alternative to 'find'
- luarocks | Package manager for Lua modules
- kitty | GPU-based terminal emulator
- nerd fonts | Iconic font aggregator, collection, and patcher | Hack Nerd Font
- lsd | The next-gen ls command
- lazygit | Simple terminal UI for git commands
- Keyboard shortcuts for 'nvim' and config for .zshrc
Warning
Before starting the process, it is recommended to create a backup or snapshot of your current virtual machine state. This script is intended for use on your personal computer. I will soon publish a version for limited users with compatibility across a wider range of distributions.
First, download the repository and navigate to the 42env folder of the cloned repository.
git clone https://github.com/4ndymcfly/42env.git ; cd 42envNext, grant execute permissions to the script and run it. It is recommended to keep the shell window maximized.
chmod +x 42env.sh ; ./42env.shWhen running the script, you will be prompted for your intra username; enter it and press Enter. This username will be used to configure the C header.
Once the process is complete, press Enter, and the system will reboot.
After rebooting, click on the new kitty icon, maximize the window, and run nvim.
nvimIf you don't click on the installation window, the installer might prompt you to press a key. In that case, press the space key. The configuration will continue and finish when it asks you to press enter.
Wait a few moments, and LazyVim will be ready and configured to start.
Press `F4` to close nvim (keyboard shortcut already configured).
If you run nvim without specifying a file name, you will access the LazyVim main menu, allowing you to perform various actions.
LazyVim has six main keys defined for daily use that only work in NORMAL mode:
Key F1: Inserts the 42 header, adds a line break, and switches the editor to Insert mode.
Key F2: Formats the code for norminette.
Key F3: Runs norminette with the -R CheckForbiddenSourceHeader flags.
Key F4: Closes the active window / norminette / Closes nvim / Equivalent to :q.
Key F5: Saves the active document / Equivalent to :w.
Key F6: Opens or closes the file explorer.
Every time you open a new file, it will open in a different tab, allowing you to have multiple files open and switch between them easily. It also notifies you if you are trying to close a tab without saving changes.
Note
All other vim shortcuts work the same.
The configuration includes the installation of LSD, which enhances terminal readability by taking advantage of the installed Nerd Fonts.
The alias ll is equivalent to:
/usr/bin/lsd -lha --group-dirs=firstTo view file and folder permissions in octal, use llo, which is an alias for:
/usr/bin/lsd -lha --group-dirs=first --permission octalLazyGit is ideal for those who prefer using the terminal but want a more comfortable and faster way to manage Git without typing all the commands manually. It is especially useful for developers working with large and complex repositories, as it simplifies visualizing changes and navigating between different sections of the repository.
Give it a try—you've got nothing to lose!
Kitty is an excellent choice if you're looking for a terminal emulator that combines speed, customization, and advanced functionality. It's ideal for users who want to make the most of their terminal environment. Kitty allows you to split the screen into multiple terminals within the same window, facilitating multitasking without needing multiple windows.
Kitty is an open-source project with active development, meaning it receives frequent updates and continuous improvements.
| Shortcut | Description |
|---|---|
Ctrl + Shift + Enter |
Open a new window in the current directory |
Ctrl + Shift + w |
Close the terminal or active window |
Ctrl + Shift + t |
Open a new tab in the current directory |
Ctrl + Shift + Alt + T |
Rename the tab in the current directory |
Ctrl + Shift + → |
Move to the tab on the right |
Ctrl + Shift + ← |
Move to the tab on the left |
Ctrl + ← |
Move to the neighboring window on the left |
Ctrl + → |
Move to the neighboring window on the right |
Ctrl + ↑ |
Move to the neighboring window above |
Ctrl + ↓ |
Move to the neighboring window below |
Ctrl + Shift + t |
Make the window wider |
Ctrl + Shift + l |
Make the window narrower |
Ctrl + Shift + i |
Make the window taller |
Ctrl + Shift + k |
Make the window shorter |
Shift + Alt + ↑ |
Scroll to the top of the scrollback buffer |
Shift + Alt + ↓ |
Scroll to the bottom of the scrollback buffer |
Shift + Alt + ← |
Scroll one page up |
Shift + Alt + → |
Scroll one page down |
Ctrl + Shift + z |
"Zoom" Toggle between tiling or fullscreen layout |
Kitty supports displaying images directly in the terminal, making it perfect for working with multimedia content.
Here's an example of how to display an image in Kitty:
picture photo.jpgpicture is an aliased to:
kitty +kitten icatKitty allows the use of tabs within a single window, making it easier to organize work across multiple terminal sessions. With tabs, you can keep several processes or files simultaneously opened, being able to switch between them quickly and efficiently without the need to open new windows. This optimizes screen space and enhances productivity when working in command-line environments.
Further improvements will be made to enhance the user experience and add more features to the script.





















