Skip to content

4ndymcfly/42env-en

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spanish Flag Spanish version

header_logo

42 ENVironment Configuration Script

Automates the installation and configuration of the basic environment to get started in the 42 cursus.

Tested on Ubuntu 22.04 LTS


Table of Contents

  1. Software
  2. Recommendations
  3. Installation
  4. During Execution
  5. LazyVim
  6. Extras
  7. Kitty Terminal
  8. In Progress...

Software

This script installs the following software if it is not already installed:

Recommendations

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.

Installation

header_logo

First, download the repository and navigate to the 42env folder of the cloned repository.

git clone https://github.com/4ndymcfly/42env.git ; cd 42env

Next, grant execute permissions to the script and run it. It is recommended to keep the shell window maximized.

chmod +x 42env.sh ; ./42env.sh
install_log

During Execution

When 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.

nvim

If 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.

lazyvim_install

lazyvim_install_2

Wait a few moments, and LazyVim will be ready and configured to start.


lazyvim_install_3

Press `F4` to close nvim (keyboard shortcut already configured).

LazyVim

If you run nvim without specifying a file name, you will access the LazyVim main menu, allowing you to perform various actions.

header_logo

header_logo

Basic Usage of LazyVim

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.

header_42

Key F2: Formats the code for norminette.

example_code fix_errors

Key F3: Runs norminette with the -R CheckForbiddenSourceHeader flags.

errors_norminette

Key F4: Closes the active window / norminette / Closes nvim / Equivalent to :q.

norminette_ok fix_errors


Key F5: Saves the active document / Equivalent to :w.


Key F6: Opens or closes the file explorer.

nvim_explorer

Tabs in LazyVim

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.

nvim_explorer

nvim_explorer

Note

All other vim shortcuts work the same.

Extras

LSD (LSDeluxe)

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=first
lsd_example

To view file and folder permissions in octal, use llo, which is an alias for:

/usr/bin/lsd -lha --group-dirs=first --permission octal
lsd_example_octal

LazyGit

LazyGit 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!

lazy_git

Kitty-Terminal

Kitty Logo

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.

Main Keyboard Shortcuts:

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

Example images:

kitty_example

Image and Graphic Support:

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.jpg

picture is an aliased to:

kitty +kitten icat

Tabs:

Kitty 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.

kitty_example_02

In Progress...

Further improvements will be made to enhance the user experience and add more features to the script.

Thank you!

Return to Table of Contents

About

42 Environment Configuration Script for 42 students

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors