Giter Site home page Giter Site logo

.tmux's Introduction

Quickly Build Linux Terminal Development Environment

a guide powered by zsh + oh-my-zsh + tmux + oh-my-tmux

Requirements

  • Linux platform (e.g. Ubuntu 20.04)
  • root or sudo privilege
  • basic tools such as curl and git
  • purely available network environment

Installation

zsh

Install zsh via apt.

$ sudo apt install zsh

Check whether zsh is available.

$ cat /etc/shells
# /etc/shells: valid login shells
/usr/bin/zsh

oh-my-zsh

Install oh-my-zsh via curl. You can also use wget referred to oh-my-zsh. Note that proxy may be needed.

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

Change login shell into zsh and then re-login.

$ chsh -s /bin/zsh

Check whether zsh is login shell now.

$ echo $SHELL
/bin/zsh

If you are using vscode remote development, you should

  • kill vscode-server in command panel
  • modify default terminal in remote settings

These operations are necessary to make zsh the default shell.

agnoster theme is recommended.

$ vim ~/.zshrc
ZSH_THEME="agnoster"

Install zsh-autosuggestions and zsh-syntax-highlighting plugins and enable them.

$ git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
$ vim ~/.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

tmux

Install tmux via apt.

$ sudo apt install tmux

If tmux is already installed, restart it.

$ tmux kill-server

oh-my-tmux

Install oh-my-tmux from github. My customized fork is used here. You can also start from oh-my-tmux instead.

$ cd
$ git clone https://github.com/xxyQwQ/.tmux
$ ln -sf .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .

Optional

migration

If you already have some customized settings in .bashrc, copy and append them to .zshrc. This promises your previous configurations are still available.

$ vim ~/.zshrc
# proxy setting
if [ -f /etc/profile.d/clash.sh ]; then
    . /etc/profile.d/clash.sh
fi

anaconda

When you install anaconda, auto activation is recommended to be disabled. Otherwise, PATH could be switched incorrectly when you enter tmux.

$ vim ~/.condarc
auto_activate_base: false

appearance

Hostname can be too long and meaningless. Hack the configurations to improve it.

For oh-my-zsh, modify agnoster.zsh-theme.

$ vim ~/.oh-my-zsh/themes/agnoster.zsh-theme
prompt_context() {
  if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)%n"
  fi
}

For oh-my-tmux, modify ~/.tmux.conf.local.

$ vim ~/.tmux.conf.local
tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} "

.tmux's People

Contributors

gpakosz avatar xxyqwq avatar pianojockl avatar alanoliveira avatar arttaylor avatar ciceropablo avatar divok avatar frederick888 avatar asuza avatar luisdavim avatar mattysweeps avatar nmahoney avatar ytang avatar sarumont avatar

Stargazers

 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.