# ersh **Repository Path**: ningxuup/ersh ## Basic Information - **Project Name**: ersh - **Description**: fork from https://github.com/jotyGill/ezsh - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-05-06 - **Last Updated**: 2023-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 因为autodl的shell是bash,没有任何的提示用起来很不爽。所以建了本仓库,本仓库修改自[ezsh](https://github.com/jotyGill/ezsh),作用是一键修改和美化autodl的shell。 因为原仓库需要clone github上的很多仓库,在国内速度慢,autodl官方给出了[免费的加速器](https://www.autodl.com/docs/network_turbo/),建议使用前可以按照官方文档设置相关代理,这样以后clone gitub的其他仓库时,也能获得一定的加速,但是官方不保证稳定性。所以有了本仓库,本仓库使用gitee下载几乎所有使用到的包,并且加了一些其他的特性,比如自动补全...详细见下面的说明。 使用方法: ```shell git clone https://gitee.com/ningxuup/ersh.git cd erch ./install.sh ``` (运行完成后关闭终端,然后重新打开即可) 另外建议在你的电脑上(不是autodl的服务器上)安装以下字体: [MesloLGS NF Regular.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) [MesloLGS NF Bold.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) [MesloLGS NF Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) [MesloLGS NF Bold Italic.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) 安装后双击字体文件即可完成安装,详细的安装方法见[MesloLGS](https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k) 。 修改后的终端特性: 1. 使用了oh my zsh的主题,让命令行不再单调 2. 提供了历史命令自动补全的功能,输入几个字符的历史命令后就会得到提示,然后点击键盘右键就可以进行补全。 3. 提供错误命令提示功能,如果输入命令有错误,则运行前就整行命令都是红色。 4. 可以在命令行中使用vim的visual mode(点击ESC键即可进行入visual mode) 5. 我习惯使用ctrl+g来清空命令行,如果需要修改为原始的ctrl+l可以打开本仓库下的install.sh,然后注释下面几行即可: ``` bindkey -r '^l' bindkey -r '^g' bindkey -s '^g' 'clear\n' ``` 6. 更加友好的vim,我在vim中添加了更美观的一些配置。 7. **fzf**我最喜欢的命令行插件之一,详细使用方法请看官方文档[fzf](https://github.com/junegunn/fzf) 8. 添加了对vscode命令`code`的支持,可以在命令行中使用`code`命令。 #################################### 下面是官方原文档的说明: # ezsh A simple script to setup an awesome shell environment. Quickly install and setup zsh and oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) with * powerlevel10k theme (https://github.com/romkatv/powerlevel10k) * Nerd-Fonts (https://github.com/ryanoasis/nerd-fonts) * zsh-completions (https://github.com/zsh-users/zsh-completions) * zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions) * zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting) * history-substring-search (https://github.com/zsh-users/zsh-history-substring-search) * fzf (https://github.com/junegunn/fzf) * k (https://github.com/supercrabtree/k) * marker (https://github.com/pindexis/marker) * todotxt (https://github.com/todotxt/todo.txt-cli) Sets following useful aliases and ohmyzsh plugins. **You can add more or overwrite these in your personal zsh config files under `~/.config/ezsh/zshrc/`** * l="ls -lah" - just type "l" instead of "ls -lah" * alias k="k -h" - show human readable filesizes, in kb, mb etc * e="exit" * [x="extract"](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/extract) - extract any compressed files * [z](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/z) - quickly jump to most visited directories * [web-search](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/web-search) - search on the web from cli * [sudo](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo) - easily prefix your commands with sudo by pressing `esc` twice * [systemd](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/systemd) - many useful aliases for systemd * https - make httpie use https * myip - (wget -qO- https://wtfismyip.com/text) - what's my ip: quickly find out external IP * cheat - (https://github.com/chubin/cheat.sh) - cheatsheets in the terminal! * speedtest - (curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -) run speedtest on the fly * dadjoke - (curl https://icanhazdadjoke.com) - terminally sick jokes * dict - (curl "dict://dict.org/d:$1 $2 $3") - dictionary definitions * ipgeo - (curl "http://api.db-ip.com/v2/free/$1") - finds geo location from IP * corona - (curl "https://corona-stats.online/") - shows corona virus spread live stats ## Demo Command prompt looks like this (easily customize it by placing your configs in ~/.config/ezsh/zshrc/) ![prompt](https://user-images.githubusercontent.com/8462091/43674765-8bb13a76-9817-11e8-8b7b-16b8b1998408.png) user : directory : git stats : last command exit code free memory: load : time Watch this to get an idea of what your Shell (well, life!) could be like!! [![asciicast](https://asciinema.org/a/225226.svg)](https://asciinema.org/a/225226) ## Installation Requirements: * `git` to clone it. * `python3` or `python` is required to run option '-c' which copies history from .bash_history ``` bash git clone https://github.com/jotyGill/ezsh cd ezsh ./install.sh -c # only run with '-c' the first time, running multiple times will duplicate history entries ``` This will install the setup under `~/.config/ezsh/` Change your terminal's fonts to either "RobotoMono Nerd Font" or "Hack Nerd Font" or "DejaVu Sans Mono Nerd Fonts". You can also manually install Nerd Fonts of your choice. ## Notes * If you are already using zsh, your zsh config will be backed up to .zshrc-backup-date * If the text/icons look broken, make sure your terminal is using one of the Nerd fonts. [discussion](https://github.com/powerline/fonts/issues/185). I recommend "RobotoMono Nerd Font" * marker's shortcut "Ctr+t" clashed with fzf so I rebound it to "Ctr +b" * All oh-my-zsh plugins are installed under ~/.config/ezsh/oh-my-zsh/plugin, Other tools (fzf,marker,todo) are installed in ~/.config/ezsh/ * The look of the shell can be very easily customised[https://github.com/bhilburn/powerlevel9k#prompt-customization] by overwriting POWERLEVEL10K settings in your personal config file under ~/.config/ezsh/zshrc/ . See my setup under example/personal_rc.zsh Suggestions about more cool tools are always welcome :)