Skip to content

Instantly share code, notes, and snippets.

@syntaxlexx
Last active January 29, 2026 12:09
Show Gist options
  • Select an option

  • Save syntaxlexx/d5361fe035e085055c7f99b192d3f479 to your computer and use it in GitHub Desktop.

Select an option

Save syntaxlexx/d5361fe035e085055c7f99b192d3f479 to your computer and use it in GitHub Desktop.
# Universal Shell Aliases, should work with both Bash and ZSH.
alias mkdir='mkdir -p'
alias chown='chown -Rv'
alias chmod='chmod -Rv'
alias grep='grep --color=always'
alias diff='colordiff'
alias tar='tar --verbose'
alias tmux='tmux -2'
#alias rsync='rsync --verbose --progress --stats --compress --recursive --times --perms --links exclude "*bak" --exclude "*~*"'
alias psaux='ps aux'
alias psl='psaux|more'
alias psg='psaux|grep'
alias df='pydf -a -h -B'
alias more='less'
alias tracert='mtr'
alias traceroute='mtr'
alias logout='sudo pkill -u $USER'
alias log-out='sudo pkill -u $USER'
# http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
alias emacsnw='emacs -nw'
alias emacsn='emacs -nw'
alias emacsd='emacs -daemon'
alias emacsc='emacsclient'
alias yi='yi --as=vim'
alias lla='ls -alF --group-directories-first --color=always'
alias ll='ls -l --group-directories-first --color=always'
alias la='ls -A --group-directories-first --color=always'
alias lh='ls -lh --group-directories-first --color=always'
alias l='ls -CF --group-directories-first --color=always'
alias llg='ls -alF --group-directories-first --color=always|grep'
alias llm='ls -alF --group-directories-first --color=always|more'
alias lll='ls -alF --group-directories-first --color=always|more'
alias vm='vim'
alias vom='vim'
# Git operations
alias g="git"
alias gcn='git clone'
alias ga='git add .'
alias gaa='git add -A'
alias gcm='git commit -m'
alias gcmu="git commit -m 'update'"
alias gcau="git commit -am 'update'"
alias gst='git status'
alias gs="git status"
alias gpom='git push --all origin'
alias gpum='git pull --all upstream'
alias gfum='git fetch --all upstream'
alias gp='git push'
alias gpl="git pull"
alias gpa='git pull --all'
alias gf='git fetch --all'
alias grv='git remote -v'
alias grau='git remote add upstream'
# push tracking branch to remote tracking branch
# ex: git push [remotename] [trackingbranch]:[remotetrackingbranch]
# ex: git push origin precise:precise
# ex: git push origin v2.0.0:v2.0.0
alias gptr='git push origin $1:$2'
alias corona="git reset --hard && git clean -fd"
# home folder navigation Shortcuts
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias ds="cd ~/dev"
# Laravel Web Dev
alias pa="php artisan"
alias par="php artisan routes"
alias pam="php artisan migrate"
alias pam:r="php artisan migrate:refresh"
alias pam:roll="php artisan migrate:rollback"
alias pam:rs="php artisan migrate:refresh --seed"
alias pda="php artisan dumpautoload"
alias cu="composer update"
alias ci="composer install"
alias cda="composer dump-autoload -o"
alias pacc="php artisan cache:clear"
alias pavc="php artisan view:clear"
# NPM
alias nrd="npm run dev"
alias nrw="npm run watch"
alias nrb="npm run build"
alias nrp="npm run production"
alias nrs="npm run start"
alias nrt="npm run test"
alias pnpx='pnpm dlx'
# NWIDARD Modules
alias pamm="php artisan module:migrate"
alias pammg="php artisan module:make-migration"
alias pamp="php artisan module:publish"
alias pampc="php artisan module:publish-config -f"
alias pammc="php artisan module:make-command"
alias pammr="php artisan module:make-resource"
alias pammcr="php artisan module:make-controller"
# pbcopy - sudo apt-get install xclip -y
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
# For MAC
alias ios="open -a Simulator.app"
alias dropbox="cd ~/Dropbox-Uploader/ && ./dropbox_uploader.sh"
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- Theme
config.color_scheme = "Catppuccin Macchiato"
config.font = wezterm.font("JetBrains Mono NL")
config.font_size = 11
config.window_background_opacity = 0.96
-- Hide window buttons like close, minimize, maximize
-- config.window_decorations = "RESIZE"
-- tab bar
config.hide_tab_bar_if_only_one_tab = false
config.tab_bar_at_bottom = true
config.use_fancy_tab_bar = true
config.tab_and_split_indices_are_zero_based = true
-- Keybindings
config.leader = { key = "q", mods = "ALT", timeout_milliseconds = 2000 }
config.keys = {
{
mods = "LEADER",
key = "c",
action = wezterm.action.SpawnTab "CurrentPaneDomain",
},
{
mods = "LEADER",
key = "x",
action = wezterm.action.CloseCurrentPane { confirm = false }
},
{
mods = "LEADER",
key = "[",
action = wezterm.action.ActivateTabRelative(-1)
},
{
mods = "LEADER",
key = "]",
action = wezterm.action.ActivateTabRelative(1)
},
{
mods = "CTRL|ALT",
key = "LeftArrow",
action = wezterm.action.ActivateTabRelative(-1)
},
{
mods = "CTRL|ALT",
key = "RightArrow",
action = wezterm.action.ActivateTabRelative(1)
},
{
mods = "LEADER",
key = "\\",
action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" }
},
{
mods = "LEADER",
key = "-",
action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" }
},
{
mods = "LEADER",
key = "j",
action = wezterm.action.ActivatePaneDirection "Left"
},
{
mods = "LEADER",
key = "k",
action = wezterm.action.ActivatePaneDirection "Down"
},
{
mods = "LEADER",
key = "i",
action = wezterm.action.ActivatePaneDirection "Up"
},
{
mods = "LEADER",
key = "l",
action = wezterm.action.ActivatePaneDirection "Right"
},
{
mods = "LEADER",
key = "LeftArrow",
action = wezterm.action.AdjustPaneSize { "Left", 5 }
},
{
mods = "LEADER",
key = "RightArrow",
action = wezterm.action.AdjustPaneSize { "Right", 5 }
},
{
mods = "LEADER",
key = "DownArrow",
action = wezterm.action.AdjustPaneSize { "Down", 5 }
},
{
mods = "LEADER",
key = "UpArrow",
action = wezterm.action.AdjustPaneSize { "Up", 5 }
},
}
for i = 0, 9 do
-- leader + number to activate that tab
table.insert(config.keys, {
key = tostring(i),
mods = "LEADER",
action = wezterm.action.ActivateTab(i),
})
end
-- tmux status
wezterm.on("update-right-status", function(window, _)
local SOLID_LEFT_ARROW = ""
local ARROW_FOREGROUND = { Foreground = { Color = "#333333" } }
local prefix = ""
if window:leader_is_active() then
prefix = " " .. utf8.char(0x1f30a) -- ocean wave
SOLID_LEFT_ARROW = utf8.char(0xe0b2)
end
if window:active_tab():tab_id() ~= 0 then
ARROW_FOREGROUND = { Foreground = { Color = "#333333" } }
end -- arrow color based on if tab is first pane
window:set_left_status(wezterm.format {
{ Background = { Color = "#b7bdf8" } },
{ Text = prefix },
ARROW_FOREGROUND,
{ Text = SOLID_LEFT_ARROW }
})
end)
-- and finally, return the configuration to wezterm
return config
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="robbyrussell"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# helpers
addToPath() {
if [[ "$PATH" != *"$1"* ]]; then
export PATH=$PATH:$1
fi
}
addToPathFront() {
if [[ "$PATH" != *"$1"* ]]; then
export PATH=$1:$PATH
fi
}
# aliases
source $HOME/.aliases
source $HOME/.aliases_personal
# composer
addToPath $HOME/.config/composer/vendor/bin
# pnpm
export PNPM_HOME="/home/lexx/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# JAVA Home
export JAVA_HOME="$HOME/java/latest/"
addToPath $HOME/java/latest/bin
# android studio
addToPath $HOME/android-studio/bin
# android SDK
export ANDROID_HOME="$HOME/Android/Sdk"
# intellij idea
addToPath $HOME/intellij-idea/bin
# adb
addToPath $HOME/Android/Sdk/platform-tools
# flutter
addToPath $HOME/flutter/bin
# bun completions
[ -s "/home/lexx/.bun/_bun" ] && source "/home/lexx/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
addToPathFront $BUN_INSTALL/bin
# python
alias python=/usr/bin/python3
# Turso
addToPathFront /home/lexx/.turso
export PATH=$HOME/.local/bin:$PATH
# wezterm
alias wezterm='flatpak run org.wezfurlong.wezterm'
# cursor
function cursor {
(nohup /home/lexx/Desktop/cursor-0.44.11x86_64.AppImage --no-sandbox "$@" > /dev/null 2>&1 &)
}
function c {
(nohup /home/lexx/Desktop/cursor-ide.AppImage --no-sandbox "$@" > /dev/null 2>&1 &)
}
# windsurf
alias wind="windsurf"
# set brightness
b() {
brightnessctl set "${1:-3}%"
}
# automatic pnpm/npm/bun. p install
p(){
declare pm="npm"
if [ -f "pnpm-lock.yaml" ]; then
pm="pnpm"
elif [ -f "yarn.lock" ]; then
pm="yarn"
elif [ -f "bun.lock" ]; then
pm="bun"
elif [ -f "bun.lockb" ]; then
pm="bun"
fi
"$pm" "$@"
}
# expo and capacitor tuning
export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/android-studio/bin/studio
export EAS_LOCAL_BUILD_WORKINGDIR=$HOME/tmp
# automatic pnpm/npm/bun
p(){
declare pm="npm"
if [ -f "pnpm-lock.yaml" ]; then
pm="pnpm"
elif [ -f "yarn.lock" ]; then
pm="yarn"
elif [ -f "bun.lock" ]; then
pm="bun"
elif [ -f "bun.lockb" ]; then
pm="bun"
fi
"$pm" "$@"
}
// Place your key bindings in this file to override the defaults
[
{
"key": "shift shift",
"command": "workbench.action.quickOpen"
},
{
"key": "alt alt",
"command": "workbench.action.showCommands"
},
{
"key": "ctrl ctrl",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "alt+/",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+[",
"command": "workbench.action.previousEditorInGroup",
},
{
"key": "alt+]",
"command": "workbench.action.nextEditorInGroup",
},
{
"key": "alt+x",
"command": "workbench.action.closeActiveEditor",
},
{
"key": "alt+j",
"command": "workbench.action.focusLeftGroup",
},
{
"key": "alt+l",
"command": "workbench.action.focusRightGroup",
},
{
"key": "alt+i",
"command": "workbench.action.focusAboveGroup",
},
{
"key": "alt+k",
"command": "workbench.action.focusBelowGroup",
},
{
"key": "alt+\\",
"command": "workbench.action.splitEditorLeft",
},
{
"key": "alt+-",
"command": "workbench.action.splitEditorDown",
},
{
"key": "alt+shift+f",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "ctrl+k",
"command": "-aipopup.action.modal.generate",
"when": "editorFocus && !composerBarIsVisible"
},
{
"key": "ctrl+e",
"command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
"when": "!activeEditorGroupEmpty"
}
]
@syntaxlexx
Copy link
Author

syntaxlexx commented Nov 7, 2024

Ensure you have Oh My Zsh and wezterm installed. Also, I am using VsCode currently (Sorry neovim)

Packages

sudo apt install bat 

mkdir -p ~/.local/bin
ln -s /usr/bin/batcat ~/.local/bin/bat

Oh My Zsh Plugins

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

@syntaxlexx
Copy link
Author

Install brightnessctl if using Ubuntu-variant

sudo apt install brightnessctl

@isaackabucho
Copy link

This is a very great guide in simplifying workflow and reduces the time to switch your setup from one machine to the other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment