colson-tmux
v1.0.23
Published
Colson Tmux: Tmux + ZSH for Software Engineers!
Downloads
509
Maintainers
Readme
Tmux Configuration with Zsh Goodness (colson-tmux npm)
Unlock the full potential of your terminal with this meticulously crafted tmux configuration, accompanied by a versatile Zsh script for effortlessly launching websites and applications. 🔥
Installation through NPM
Ensure Tmux is installed on your machine!Tmux leader key
-> Ctrl + Space
$ npx colson-tmux
$ cd ~/.config/tmux
$ nvim .
Navigate to tmux.conf
Execute this command in normal mode!
<leader> + shit + i
Restart terminal to load Tmux!
$ zshrl
$ tmuxrl
If you've already installed this before then for the latest pull, do:
$ npx colson-tmux@latest
NOTE
: Read the documentation below for indepth wisdom on proper installation and uses!
Table of Contents
- Tmux Configuration with Zsh Goodness (colson-tmux npm)
Features
- Enhanced Tmux Configuration: Elevate your terminal experience with a comprehensive tmux setup tailored for efficiency.
- Web and App Launcher: Seamlessly launch websites and applications through an intuitive Zsh script.
- Plugin Management with TPM: Utilizes Tmux Plugin Manager (TPM) for hassle-free tmux plugin management.
- Catppuccin Theme: Elevate aesthetics with the visually pleasing Catppuccin theme.
Screenshots
✨ New Look (Colson TMUX)
💎 Old Look (Colson TMUX)
Prerequisites
Before diving in, ensure you have the following prerequisites:
- tmux: Ensure tmux is installed on your system.
- fzf: Install the fuzzy finder tool for interactive selection.
Getting Started
Installation
Begin by installing TPM (Tmux Plugin Manager):
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Clone this repository into your home directory:
git clone https://github.com/colson0x1/colson-tmux ~/.config/tmux
Reload your tmux environment to apply the configuration:
tmux source-file ~/.config/tmux/tmux.conf
Make the
goto.sh
script executable:chmod +x ~/.config/tmux/goto.sh
Add
.zshrc
to root on your machine:cat ~/.config/tmux/.zshrc >> ~/.zshrc
Restart your Terminal.
$ source ~/.zshrc $ zshrl $ tmuxrl
You're all set! Launch websites and applications using
goto.sh
.<leader>+o
NOTE: Leader in tmux is:
Ctrl+Space
Install Tmux Plugins
- Open tmux:
tmux
- Navigate to the tmux directory:
cd ~/.config/tmux
- Use Neovim to open the configuration:
nvim .
- Go to
tmux.conf
:
(Note: Leader key isleader+shift+i
Ctrl+Space
, so useCtrl+Space
andShift+i
)
Usage
- Leader Key:
ctrl+space
- Window Switching:
Shift+Alt+j
andShift+Alt+k
- Horizontal Split:
leader + -
- Vertical Split:
leader + |
- Launch Websites and Apps:
leader + o
NOTE
: Make sure fzf
is installed on your machine for <leader> + o
to work!!
$ sudo pacman -S fzf
Customization
Tailor your tmux configuration and the list of websites and applications in goto.sh
to match your preferences. Dive into the endless possibilities of customization and make your terminal truly yours. Additionally, explore the power of Zsh with a rich set of aliases and Git shortcuts in the included .zshrc
file.
🔥 Alias/Command for Engineers
This package also provides configurations and command aliases for Tmux
, Zsh
, Git
, Docker
, Kubernetes
, and other development tools, aiming to improve software development productivity.
Zsh & Tmux Commands
| Alias/Command | Description |
| ---------------------------------------------- | ------------------------------------ |
| tl
| List all tmux sessions |
| ts [session_name]
| Start a new tmux session |
| ta [session_name]
| Attach to an existing tmux session |
| tk [session_name]
| Kill a tmux session |
| tr [current_session_name] [new_session_name]
| Rename existing tmux session |
| tc [session_name]
| Switch between sessions |
| nv
| Open Neovim in the current directory |
| nvv
| Open Neovim with sudo privileges |
| cl
| Clear the terminal screen |
| tmuxrl
| Reload the tmux configuration |
| zshrl
| Reload the Zsh configuration |
| vim
| Alias for opening Neovim |
Tmux Specific Commands
| Command/Binding | Description |
| ---------------------- | ------------------------------------------------------------------------------- |
| <leader> + -
| Split the current pane horizontally |
| <leader> + \|
| Split the current pane vertically |
| Shift+Alt+J
| Move to the next window |
| Shift+Alt+K
| Move to the previous window |
| <leader> + r
| Rename current window |
| <leader> + n
| Switch to next window |
| <leader> + p
| Switch to previous window |
| <leader> + s
| Switch sessions |
| <leader> + shift + S
| Save tmux sessions (tmux-resurrect) even after machine restarts |
| <leader> + shift + R
| Restore the last saved tmux session (tmux-resurrect) even after restarting |
| <leader> + o
| Trigger the custom goto.sh
script for opening websites and apps from terminal |
| <Ctrl> + d
| Close current window |
| <leader> + d
| Exit Tmux sesion |
Git Aliases
| Alias/Command | Description |
| ------------------------------- | ---------------------------------------------- |
| gst
| Show the current git status |
| gd
| Show the git diff |
| ga
| Stage all changes |
| gaf [file1] [file2] ..
| Stage specific files |
| gc [message]
| Commit changes with a message |
| gpm
| Push changes to the main
branch |
| gpmf
| Force push changes to the main
branch |
| gl
| Show a readable git log |
| gg
| Show a colorful and condensed git log |
| gunt
| Show untracked files |
| gcan
| Amend the last commit with same commit message |
| gcam [message]
| Amend the last commit with new commit message |
| gcb [branch_name]
| Create and checkout a new branch |
| gco [branch_name]
| Switch to an existing branch |
| grh
| Reset the current branch to the latest commit |
| grh1
| Reset the last branch to the latest commit |
| gs
| Abbreviated git status |
| gb
| List branches sorted by most recent commit |
| gd [fileName or path to file]
| Show the git diff for a specific file |
| gds
| Side-by-side git diff |
| gwd
| Show a colorful word-diff |
| gp
| Push the current branch |
| gpl
| Pull the latest changes from the remote |
| gf
| Fetch changes from the remote |
| gsmst
| Check the status of all submodules |
| gasm
| Stage all changes, including submodules |
| gr <branch-name>
| Git rebase |
| gri <branch-name>
| Interactive rebase |
Add vimdiff
as default for diff!
$ git config --global diff.tool vimdiff
$ git config --global difftool.prompt false
Now, gds
works :)
+ Also make Git use main
as the default branch as opposed to classic master
convention!
$ git config --global init.defaultBranch main
Docker Aliases
| Alias/Command | Description |
| ----------------- | --------------------------------------------------- |
| d
| Alias for Docker |
| dps
| List Docker containers |
| di
| List Docker images |
| db [tag]
| Build a Docker image with a tag |
| dr [container]
| Run a Docker container |
| dex [container]
| Execute a command inside a running Docker container |
| dst [container]
| Stop a running Docker container |
| drm [container]
| Remove a Docker container |
| drmi [image]
| Remove a Docker image |
Kubernetes Aliases
| Alias/Command | Description |
| ----------------- | -------------------------------------------- |
| k
| Alias for kubectl |
| kgp
| Get all Kubernetes pods |
| kgs
| Get all Kubernetes services |
| kga
| Get all Kubernetes resources |
| kd [resource]
| Describe a Kubernetes resource |
| kdel [resource]
| Delete a Kubernetes resource |
| kaf [file]
| Apply a Kubernetes configuration from a file |
| kl [pod]
| Show logs of a Kubernetes pod |
| ke [pod]
| Execute a command inside a Kubernetes pod |
| kns [namespace]
| Switch Kubernetes namespace |
Development Tool Aliases
| Alias/Command | Description |
| ------------- | --------------------------------------------- |
| cra
| Create a new React app using Create React App |
| cva
| Create a new VITE app |
| cna
| Create a new Next.js app |
| bun
| Run Bun package manager |
Miscellaneous
| Alias/Command | Description |
| ------------------------- | ------------------------------- |
| gcloud
| Google Cloud SDK configuration |
| eval "$(ng completion)"
| Load Angular CLI autocompletion |
| bindkey -v
| Enable Vim key bindings in Zsh |
Concurrent Services Execution with one go!
cd ~
mkdir -p ~/bin
Refactor commands in the services-start-command.txt
file which is located at ~/.config/tmux
!
Make start-services.sh
executable!
cd ~/.config/tmux
chmod +x start-services.sh
cp start-services.sh ~/bin/start-services
zshrl
Uses:
Here, <session-name>
is the name of the Tmux
session that will be created (or attached to, if it already exists).
And services-start-commands.txt
is the text file that contains the list of commands to run in separate windows inside the Tmux
session!
ss <session-name> <services-start-commands-file>
services start ->
ss="~/.config/tmux/start-services.sh"
services start commands ->
ssc="~/.config/tmux/services-start-commands.txt"
Manual Execution!
cd ~/.config/tmux
chmod +x start-services.sh
zshrl
# Restart the Terminal
cd ~/.config/tmux
./start-services.sh <session-name> <command-file-txt-path>
# Example
./start-services.sh TYPEMUSE ~/.config/tmux/services-start-commands.txt
Command File Example
services-start-command.txt
cd ~/prod/TYPEMUSE/typemuse-web && pnpm dev
cd ~/prod/TYPEMUSE/typemuse-web && pnpm web:dev:tunnel
cd ~/prod/TYPEMUSE/auth-service && pnpm start:dev
cd ~/prod/TYPEMUSE/game-service && pnpm start:dev
cd ~/prod/TYPEMUSE/leaderboard-service && pnpm start:dev
cd ~/prod/TYPEMUSE/messaging-service && go run .
cd ~/prod/TYPEMUSE/payment-service && pnpm start:dev
cd ~/prod/TYPEMUSE/transaction-service && go run .
cd ~/prod/TYPEMUSE/social-network-service && pnpm start:dev
cd ~/prod/TYPEMUSE/react-native-app && pnpm start:dev
cd ~/prod/TYPEMUSE/electron-desktop-app && pnpm start:dev
cd ~/prod/TYPEMUSE/admin-service && pnpm start:dev
cd ~/prod/TYPEMUSE/dashboard-service && pnpm start:dev
cd ~/prod/TYPEMUSE/notification-service && pnpm start:dev
cd ~/prod/TYPEMUSE/multiplayer-service && pnpm start:dev
cd ~/prod/TYPEMUSE/account-service && pnpm start:dev
cd ~/prod/TYPEMUSE/order-service && pnpm start:dev
cd ~/prod/TYPEMUSE/subscription-service && pnpm start:dev
cd ~/prod/TYPEMUSE/event-bus-service && pnpm start:dev
Concurrency in Action!!
NOTE
: Make sure you have done this first!
cd ~/.config/tmux
chmod +x start-services.sh
Now restart the terminal and use the pattern below!
ss
-> Start Services
ssc
-> Start Services Commands
ss <session-name> ssc
EXAMPLE:
ss TYPEMUSE ssc
Peace!