GithubHelp home page GithubHelp logo

tmux_config's Introduction

Tmux config plus zsh themeing

Nice tmux config :)

Usage

Install tpm

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Set tmux config.

# Start tmux, press prefix keys then :
# enter...
source-file ~/.tmux.conf

Copy the tmux.conf into "~/.tmux.conf" save and reload your termainal.

# Richard Jones, 22/07/2023 - Custom Tmux config
## General Settings

set -g default-terminal "xterm-256color"
set -g history-limit 5000
setw -g xterm-keys on
set -s escape-time 10                     # faster command sequences
set -sg repeat-time 600                   # increase repeat timeout
set -s focus-events on

## Change the default key binding from Ctrl+b to Ctrl+a
unbind C-b
set -g prefix C-a

## mouse support 
set -g mouse on

## Hot reload Ctrl+r
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"

## Change split panes to v,h
bind h split-window -h
bind v split-window -v
unbind '"'
unbind %

## Display

set -g base-index 1           # start windows numbering at 1
setw -g pane-base-index 1     # make pane numbering consistent with windows
setw -g automatic-rename on   # rename window to reflect current program
set -g renumber-windows on    # renumber windows when a window is closed
set -g set-titles on          # set terminal title

## Activity
set -g monitor-activity on
set -g visual-activity off


# Dracula theme
set -g @plugin 'dracula/tmux'

set -g @dracula-show-battery true
set -g @dracula-show-powerline false
set -g @dracula-plugins "cpu-usage ram-usage time battery"
set -g @dracula-battery-label ""
set -g @dracula-military-time true
set -g @dracula-day-month true
set -g @dracula-show-timezone false
set -g @dracula-refresh-rate 10

# enable if powerline 10k installled
#set -g @dracula-show-powerline true

# Set tpm
set -g @plugin 'tmux-plugins/tpm'

# copy to xsel (Enable if on kali) 
#if-shell -b 'command -v xsel > /dev/null 2>&1' 'bind -y run -b "tmux save-buffer - | xsel -i -b"'

# WSL
if-shell -b 'test -n "$WSLENV"' 'bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel clip.exe'
if-shell -b 'test -n "$WSLENV"' 'bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel clip.exe'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Install Dracula Theme

https://draculatheme.com/tmux

image

Custom keys

###Prefix Ctrl + a

Windows

split verticle : prefix + v
split horizontal : prefix + h

Hot tmux config reload

reload = prefix + r

Cheatsheet (Normal tmux)

Toggle pane zoom

prefix + z

Convert pane into a window

prefix + !

Config

  • Click and drag with the Left Mouse Button to select some text and copy it into the primary selection
  • Double-click the Left Mouse Button on a word to select the word and copy it into the primary selection
  • Triple-click the Left Mouse Button on a line to select the whole line and copy it into the primary selection
  • Click the Middle Mouse Button to paste from the primary selection
  • Ctrl + Shift + c to copy the selection into the clipboard
  • Ctrl + Shift + v to paste from the clipboard

Screenshots

image

image

Cheatsheet

image

image

image

image

image


Bonus

Install Ohmyzsh

OhMyZsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Set default shell

chsh -s $(which zsh)

Add some plugins

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

Now, edit your ~/.zshrc file to include them.

plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)

Restart your Zsh with source ~/.zshrc.

Powerlevel10k theme

Install

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Add correct font

MesloLGS NF Regular.ttf
MesloLGS NF Bold.ttf
MesloLGS NF Italic.ttf
MesloLGS NF Bold Italic.ttf

wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

cli install

make folder in ~/.local/share/fonts
cp the fonts to the location and refresh the font cache. 

$ fc-cache -f -v

Then, add powerlevel10k to ~/.zshrc

ZSH_THEME="powerlevel10k/powerlevel10k"

Configure

$ p10k configure

tmux_config's People

Contributors

assassinukg avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.