🧐
/
ðŸŠī ⏐ Other Apps
/
3. iTerm2

iTerm2

iTerm2 Settings

Configure iTerm2 for an improved terminal experience.

Adjust profiles, colors, and shortcuts to suit your preferences.

Go to Terminal Preferences > Keys > Key Mapping and chose in the Presets list Natural Text Editing.

Set Up Git SSH Key

Generate and configure an SSH key for GitHub or other Git services to enable secure, password-less authentication for repository interactions.

Here is the guide.

After, go to this page to finish the setup on GitHub.

Dotfiles Setup

Maintain consistency across development environments by using dotfiles to store configuration files.

Sync them across devices using version control.

.bash_profile

source ~/.nvm/nvm.sh
nvm use stable
shopt -s autocd
shopt -s histappend

export PATH=$PATH:$HOME/bin

export HISTSIZE=5000
export HISTFILESIZE=10000

bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
bldgrn='\e[1;32m' # Bold Green
bldpur='\e[1;35m' # Bold Purple
txtrst='\e[0m'    # Text Reset

emojis=("ðŸ‘ū" "🌐" "ðŸŽē" "🌍" "🐉" "ðŸŒĩ")

EMOJI=${emojis[$RANDOM % ${#emojis[@]} ]}

print_before_the_prompt () {
    dir=$PWD
    home=$HOME
    dir=${dir/"$HOME"/"~"}
    printf "\n $txtred%s: $bldpur%s $txtgrn%s\n$txtrst" "$HOST_NAME" "$dir" "$(vcprompt)"
}

PROMPT_COMMAND=print_before_the_prompt
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
PS1="$EMOJI >"

function mkcd()
{
	mkdir $1 && cd $1
}

# -------
# Aliases
# -------
alias l="ls" # List files in current directory
alias ll="ls -al" # List all files in current directory in long list format
alias o="open ." # Open the current directory in Finder

# ----------------------
# Git Aliases
# ----------------------
alias gaa='git add .'
alias gcm='git commit -m'
alias gpsh='git push'
alias gss='git status -s'
alias gs='echo ""; echo "*********************************************"; echo -e "   DO NOT FORGET TO PULL BEFORE COMMITTING"; echo "*********************************************"; echo ""; git status'

.gitconfig

[user]
	name = YOUR_GITHUB_USERNAME
	email = YOUR_GITHUB_EMAIL
[core]
	editor = nano
[init]
	defaultBranch = main

.gitignore

node_modules/
.DS_Store

.zshrc

export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"
CASE_SENSITIVE="true"
ENABLE_CORRECTION="true"

plugins=(git)

source $ZSH/oh-my-zsh.sh

export EDITOR='nano'

# -------
# Aliases
# -------
alias l="ls" # List files in current directory
alias ll="ls -al" # List all files in current directory in long list format
alias o="open ." # Open the current directory in Finder

# ----------------------
# Git Aliases
# ----------------------
alias gaa='git add .'
alias gcm='git commit -m'
alias gpsh='git push'
alias gss='git status -s'
alias gs='echo ""; echo "*********************************************"; echo -e "   DO NOT FORGET TO PULL BEFORE COMMITTING"; echo "*********************************************"; echo ""; git status'
Last updated on June 11, 2024