Installation
首先安装必要的依赖:
apt install wget curl安装必须的软件:
apt install git zsh tmux htop rangerstarship需要通过官网脚本进行安装:
curl -sS https://starship.rs/install.sh | sh注意脚本会自动检测服务器架构. 请你记住, 后续会使用
前往github的btop仓库. 找到右侧的Release, 点击进入, 注意部分架构的release包可能被隐藏. 根据自己的服务器架构找到合适的release包. 使用wget进行下载. 下载之后进行解压:
tar -xjf .tbz找到解压后的二进制文件, 复制到~/.local/bin路径下. 注意可能需要手动新建这个文件夹.
前往github的lazygit仓库. 找到右侧的Release, 进入, 注意部分架构的release包可能被隐藏. 根据自己服务器架构找到合适的release包, 在wget下载后进行解压:
tar -xvzf .tar.gz解压之后出现三个文件. 将lazygit复制到~/.local/bin路径下. 其他两个文件可以删除
Configuration
安装zsh插件.
提供语法高亮:
git clone https://github.com/zsh-users/zsh-syntax-highlighting .zsh/zsh-syntax-highlighting提供自动补全:
git clone https://github.com/zsh-users/zsh-autosuggestions .zsh/zsh-autosuggestions使用vim编辑zshrc配置文件. 将配置文件粘贴到~/.zshrc文件中
export PATH="$HOME/.local/bin":$PATH
eval "$(starship init zsh)"
export TERM=xterm-256color
export HISTFILE=~/.zsh_history
export HISTSIZE=100000
export SAVEHIST=100000
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
# auto suggestions history configuration
bindkey -e
# [PageUp] - Up a line of history
if [[ -n "${terminfo[kpp]}" ]]; then
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
fi
# [PageDown] - Down a line of history
if [[ -n "${terminfo[knp]}" ]]; then
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
bindkey -M viins "${terminfo[knp]}" down-line-or-history
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
fi
# Start typing + [Up-Arrow] - fuzzy find history forward
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey -M emacs "^[[A" up-line-or-beginning-search
bindkey -M viins "^[[A" up-line-or-beginning-search
bindkey -M vicmd "^[[A" up-line-or-beginning-search
if [[ -n "${terminfo[kcuu1]}" ]]; then
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# Start typing + [Down-Arrow] - fuzzy find history backward
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey -M emacs "^[[B" down-line-or-beginning-search
bindkey -M viins "^[[B" down-line-or-beginning-search
bindkey -M vicmd "^[[B" down-line-or-beginning-search
if [[ -n "${terminfo[kcud1]}" ]]; then
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
fi
# [Home] - Go to beginning of line
bindkey -M emacs "^[[H" beginning-of-line
bindkey -M viins "^[[H" beginning-of-line
bindkey -M vicmd "^[[H" beginning-of-line
# [End] - Go to end of line
bindkey -M emacs "^[[F" end-of-line
bindkey -M viins "^[[F" end-of-line
bindkey -M vicmd "^[[F" end-of-line
# [Shift-Tab] - move through the completion menu backwards
if [[ -n "${terminfo[kcbt]}" ]]; then
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
fi
# [Delete]
bindkey -M emacs "^[[3~" delete-char
bindkey -M viins "^[[3~" delete-char
bindkey -M vicmd "^[[3~" delete-char
# [Ctrl-Delete] - delete whole forward-word
bindkey -M emacs '^[[3;5~' kill-word
bindkey -M viins '^[[3;5~' kill-word
bindkey -M vicmd '^[[3;5~' kill-word
# [Ctrl-Backspace] - delete whole forward-word
bindkey -M emacs '^H' backward-kill-word
bindkey -M viins '^H' backward-kill-word
bindkey -M vicmd '^H' backward-kill-word
# [Ctrl-RightArrow] - move forward one word
bindkey -M emacs '^[[1;5C' forward-word
bindkey -M viins '^[[1;5C' forward-word
bindkey -M vicmd '^[[1;5C' forward-word
# [Ctrl-LeftArrow] - move backward one word
bindkey -M emacs '^[[1;5D' backward-word
bindkey -M viins '^[[1;5D' backward-word
bindkey -M vicmd '^[[1;5D' backward-word
# [Ctrl-d] - delete whole line
bindkey -M emacs '^D' kill-whole-line
bindkey -M viins '^D' kill-whole-line
bindkey -M vicmd '^D' kill-whole-line
source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
alias cls=clear
alias ls="ls --color=tty"
alias ll="ls -alFh"
alias lg="lazygit"
alias btop="btop --force-utf"
git clone https://github.com/eniverz/tmux-configuration将仓库复制并重命名到 ~/.config/tmux 路径上. 注意, 如果在~/.config路径中已经存在tmux文件夹, 那么你应该先移动成备份:
mv ~/.config/tmux ~/.config/tmux-bak然后将仓库复制同时重命名:
cp -r tmux-configuration ~/.config/tmux编程相关
下载并安装miniconda:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh可以通过这种方式来避免conda init导致zsh启动过慢:
alias base="source $HOME/miniconda3/bin/activate base"
重新刷新zsh配置文件之后直接通过执行base即可激活环境