记录一些github上有趣 / 实用的小工具

bash completion

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.

1
2
3
4
5
6
7
8
9
10
11
# TRIAL without installation

git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
make -C ble.sh
source ble.sh/out/ble.sh

# Quick INSTALL to BASHRC (If this doesn't work, please follow Sec 1.3)

git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc

the fuck

The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 从github安装最新版 (发行版与新版python不兼容)
pip install git+https://github.com/nvbn/thefuck.git

# 添加到PATH
which thefuck
echo "export PATH=\"\$PATH:$(dirname $(which thefuck))\"" >> ~/.bashrc

# 添加别名
eval $(thefuck --alias)

#另一种别名方式
fuck(){
eval $(thefuck --alias)
#eval $(thefuck --alias --enable-experimental-instant-mode)
fuck "$@"
}

#Note: 实验模式可以加快速度,但是会影响Bash的缩进,不美观