ZSH 插件列表

Oh My Zsh 是一个用来管理 ZSH插件的框架, 我们可以用它很轻松的安装和管理各种插件; 但是时间久了配置文件就会多了一堆不知道干啥的插件, 然后就忘记一堆很有用的功能. 鉴于此, 整理一下当前使用的插件以及对应的功能.

安装

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#oh-my-zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 
# zsh-autosuggestions 
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# fast-syntax-highlighting 
git clone https://github.com/zdharma/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
# zsh-history-substring-search 
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
# Spaceship theme, Set ZSH_THEME="spaceship" in  .zshrc.
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" 

插件

当前正在使用的插件列表:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
plugins=(
  #suggestions
  zsh-autosuggestions history-substring-search history
  #navigation
  z zsh-interactive-cd fasd
  #copy
  cp copyfile copydir copybuffer
  #application
  mosh docker pip
  #alias
  git docker-compose vscode common-aliases rsync
  # apparance
  fast-syntax-highlighting colored-man-pages 
  #other
  man
)

# settings for zsh-autosuggestions
bindkey '^j' autosuggest-accept
alias ls=lsd # brew install lsd for mac
alias typora='open -a typora'

命令补全&搜索类🔍

  • zsh-autosuggestions: Fish-like fast/unobtrusive autosuggestions for zsh.

  • zsh-history-substring-search:This is a clean-room implementation of the Fish shell's history search feature, where you can type in any part of any command from history and then press chosen keys, such as the UP and DOWN arrows, to cycle through matches.

  • history:Provides a couple of convenient aliases for using the history command to examine your command line history.

    • h alias to history;

    • hs alias to history | grep;

    • hsi alias to history | grep -i(i means case-insensitive)

工作目录跳转

  • z:This plugin defines the z command that tracks your most visited directories and allows you to access them with very few keystrokes.

  • zsh-interactive-cd: A fish-like interactive tab completion for the cd command.

  • fasd: Fasd offers quick access to files and directories.

    Alias Command Description
    v fasd -f -e "$EDITOR" List frequent/recent files matching the given filename.
    o fasd -a -e xdg-open List frequent/recent files and directories matching.
    j fasd_cd -d -i cd with interactive selection

文件复制

  • cp: Defines a cpv function that uses rsync so that you get the features and security of this command.

  • copyfile: Define copyfile <filename> to copy file to system clipboard.

  • copydir: Define copydir to copy cwd to system clipboard.

  • copybuffer:Binds the ctrl-o keyboard shortcut to a command that copies the text that is currently typed in the command line ($BUFFER) to the system clipboard.

Application

  • mosh: This plugin allows SSH tab completion for mosh hostnames.

  • docker: This plugin adds auto-completion for docker.

  • pip: This plugin adds completion for pip, the Python package manager.

Alias

  • git: The git plugin provides many aliases and a few useful functions.

  • docker-compose: This plugin provides completion for docker-compose as well as some aliases for frequent docker-compose commands.

  • vscode: This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor.

  • common-aliases: This plugin creates helpful shortcut aliases for many commonly used commands.

  • rsync: Adds aliases for frequent rsync commands.

    Alias Command
    rsync-copy rsync -avz --progress -h
    rsync-move rsync -avz --progress -h --remove-source-files
    rsync-update rsync -avzu --progress -h
    rsync-synchronize rsync -avzu --delete --progress -h

语法高亮

其它

  • man:This plugin adds a shortcut to insert man before the previous command.
    Shortcut Description
    Esc + man add man before the previous command to see the manual for this command
updatedupdated2023-06-052023-06-05
Update https-ca.md