Skip to content

Latest commit

 

History

History
175 lines (120 loc) · 6.12 KB

README.md

File metadata and controls

175 lines (120 loc) · 6.12 KB

Fast Deployment for Shell Envs

Table of Contents

usage

dependencies

before we can start deploy our envs, you should make sure zsh and oh-my-zsh are installed

# install zsh & oh-my-zsh
sudo apt install zsh  # on Ubuntu
# change shell to zsh
chsh -s $(which zsh)

# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

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

install

now we can start deploy .my_shell_envs

# install .my_shell_envs
cd $HOME
git clone https://github.com/hermanzhaozzzz/.my_shell_envs.git
## or git clone [email protected]:hermanzhaozzzz/.my_shell_envs.git

# deploy envs on MacOS / Linux / Windows
cd ~/.my_shell_envs

bash deploying_locally.sh # MacOS/Linux
# or
git-bash deploying_locally.sh # Windows, in powershell!


# <tips> via https or ssh
# you can set git clone via https (default) or ssh
# bash deploying_locally.sh ssh

# <tips>
# scoop install git  # powershell
# git-bash deploying_locally.sh  # powershell

cd ~/.my_shell_envs/
cd
# then just try
z my

when use windows:

  • scoop is the dependency
  • all commands below should run in PowerShell

update

mse_update

personal settings:

see details in .my_shell_envs/apply_personal_envs.sh

this script will remove exist zsh settings (zshenv, zprofile) and copy my personal settings (.my_shell_envs/zsh/zprofile_hermanzhaozzzz_demo) and rename it to ~/.zprofile

zprofile will be sourced before zshrc when you login, and don't effect no-login operations like scp / rsync

you can create a ~/.zprofile by yourself and don't use .my_shell_envs/apply_personal_envs.sh and zprofile_hermanzhaozzzz_demo

# e.g. deploy my personal settings, I just:
bash apply_personal_envs.sh

# <tips>
# you can create a ~/.zprofile and use it by yourself but not use my <apply_personal_envs.sh>
# when you login your system, ~/.zprofile (personal settings)
# will be sourced before ~/.zshrc (.my_shell_envs' public settings)

features and skills

1. micromamba: A faster and better "conda"

I use micromamba to replace conda, miniconda or mamba, because:

  • conda / miniconda: Slow as a turtle, trust me, you will wait until you want to hit the keyboard
  • mamba: Often you don't dare to update base env because of missing dependencies or version problems raised by mamba

when you use .my_shell_envs, if base is boomed, you just cd ~/.my_shell_envs && bash deploying_locally, that's all!

2. vim / neovim: Immediately start to use

vim config refs to vim-for-coding, it's lightweight but very practical.

neovim config refs to nvimdots, I really enjoy using it to write code on the server!

3. ZSH: Clear and practical ZSH themes and plugins

4. Spyder: Auto deploy spyder config

5. jcat: A convenient command for fast checking notebook with ipynb format in terminal

refs to jcat

6. wd: A dictory in terminal

refs to Wudao-dict

7. tldr: too long don't read, it is a famous command for repalcing man

refs to https://tldr.sh/

8. Other skills

  • a trash folder to avoid dangerous rm -rf
    • rm (alias mv to rm, use \rm or /bin/rm or rm.real.rm if you want to use raw rm)
    • rm.* cmds
      • rm.real.rm
      • rm.trash.back
      • rm.trash.clear
      • rm.trash.show
  • l / ll / lll / llll cmds to replace ls
  • btop cmd to replace top / htop
  • open cmd, to open a file with default apps
  • when you want to add cmds in your PATH, just cd ~/.my_shell_envs/bin && ln -s /absolute_path/cmd

license

Use my setting for free!