Crates.io | comembert |
lib.rs | comembert |
version | 0.1.1 |
source | src |
created_at | 2024-10-18 23:44:18.868646 |
updated_at | 2024-10-19 00:39:54.852028 |
description | A tool to remember commands, search them, and write them to the command line to use |
homepage | https://github.com/ficolas2/comembert |
repository | https://github.com/ficolas2/comembert |
max_upload_size | |
id | 1414962 |
size | 132,814 |
_--"-.
.-" "-.
|""--.. '-.
| ""--.. '-.
| ""--..". ____ _ _
| | / ___|___ _ __ ___ ___ _ __ ___ | |__ ___ _ __| |_
| .-' | | / _ \| '_ ` _ \ / _ \ '_ ` _ \| '_ \ / _ \ '__| __|
'--.. -. | |__| (_) | | | | | | __/ | | | | | |_) | __/ | | |_
""--.. : \____\___/|_| |_| |_|\___|_| |_| |_|_.__/ \___|_| \__|
""--.. |
""-' Com(mand re)member t(ool)
cargo install comembert
mkdir ~/.config/comembert
wget https://raw.githubusercontent.com/ficolas2/comembert/refs/heads/main/scripts/bash/cm -O ~/.config/comembert/cm.sh
echo 'source ~/.config/comembert/cm.sh' >> ~/.bashrc
cargo install comembert
mkdir ~/.config/comembert
wget https://raw.githubusercontent.com/ficolas2/comembert/refs/heads/main/scripts/zsh/cm -O ~/.config/comembert/cm.zsh
echo 'source ~/.config/comembert/cm.zsh' >> ~/.zshrc
cargo install comembert
wget https://raw.githubusercontent.com/ficolas2/comembert/refs/heads/main/scripts/fish/cm.fish -O ~/.config/fish/functions/cm.fish
cm
NOTE: INSERTING WITH THE COMMAND ONLY WORKS ON FISH SHELL, or with clipboard output mode, see Insertion options. If you are using bash or zsh, you need to press the keybinding Ctrl+F for command insertions.
fzf will show you a list of the saved commands, select one, and it will be printed to the terminal input.
cm --add 'command' 'command/route'
cm --prev 'command/route'
cm --edit 'command/route'
Your default editor will be oppened with the selected command.
If no command route is specified, fzf will be opened to select a command.
Note: the editor is defined by the $EDITOR environment variable.
cm --move 'command/route' 'new/command/route'
If no command route is specified, fzf will be opened once to select the command to move, and then you will be prompted to enter the new route.
cm --delete 'comand/route'
If no command route is specified, fzf will be opened to select a command.
cm --list
If you want to insert the command to the terminal prompt using the system clipboard, you can set the environment variable 'COMEMBERT_OUTPUT' to 'clipboard'. This will copy the command to the clipboard, and simulate the input to the terminal.
Currently, you need to have xdotool to simulate the input, and xclip to copy the command to the clipboard. This means that this option is only available on linux, with X11, but this should change in the future.
Bash and zsh don't allow inserting the command directly to the terminal prompt when running another command.
To insert the command to the terminal prompt, it has to be called from a keybinding. The default
keybinding is Ctrl+F, but you can change it modifying the file ~/.config/comembert/cm.sh
or
~/.config/comembert/cm.zsh
.
Fish shell allows inserting the command directly to the terminal prompt when running another command.
This means that you can simply call cm
and, pick the command, and it will be inserted to the terminal.
If you want to add a keybinding in fish shell, you can add add the binding to the file
~/.config/fish/functions/fish_user_key_bindings.fish
:
More info at https://fishshell.com/docs/current/cmds/bind.html
This project is licensed under the MIT License - see the LICENSE file for details.