交互地从bash/zsh历史记录中选择一个条目。
selecta的Python项目详细描述
用法
$ selecta --bash -y <(history)
热键
ctrl+i:切换大小写敏感度
CTRL+r:切换正则表达式搜索
安装
$ sudo pip3 install selecta
安装键盘快捷键alt+r:
$ selecta_install_bash
这将在您的~/.bashrc后面追加以下行:
bind '"\C-[r":"\C-a\C-k selecta --bash -y <(history)\C-m"'
–帮助输出
usage: selecta [-h] [-i] [-b] [-z] [-e] [-a] [-d] [-y] [--bash] [--zsh] [infile] positional arguments: infile the file which lines you want to select eg. <(history) optional arguments: -h, --help show this help message and exit -i, --revert-order revert the order of the lines -b, --remove-bash-prefix remove the numeric prefix from bash history -z, --remove-zsh-prefix remove the time prefix from zsh history -e, --regexp start in regexp mode -a, --case-sensitive start in case-sensitive mode -d, --remove-duplicates remove duplicated lines -y, --show-hits highlight the part of each line which match the substrings or regexp --bash standard for bash history search, same as -b -i -d --zsh standard for zsh history search, same as -b -i -d
待办事项
- 从选择器添加CD功能。
- 实现缺少的命令行开关。
- 添加缺少的键盘快捷键