All Projects β†’ andreiborisov β†’ sponge

andreiborisov / sponge

Licence: MIT license
🧽 Clean fish history from typos automatically

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to sponge

fish-color-scheme-switcher
A fish shell 🐟 plugin to switch color schemes 🌈
Stars: ✭ 48 (-30.43%)
Mutual labels:  fish, fisher, fish-plugin
fish logo
🐠 Fish shell colorful ASCII-art logo
Stars: ✭ 82 (+18.84%)
Mutual labels:  fish, fisher, fish-plugin
fish-abbreviation-tips
πŸ’‘ Help you remembering your abbreviations
Stars: ✭ 155 (+124.64%)
Mutual labels:  fish, fisher, fish-plugin
fish-exa
🐟 exa aliases for fish
Stars: ✭ 24 (-65.22%)
Mutual labels:  fish, fish-plugin
Fisher
A plugin manager for Fish.
Stars: ✭ 5,386 (+7705.8%)
Mutual labels:  fish, fish-plugin
Xxh
πŸš€ Bring your favorite shell wherever you go through the ssh.
Stars: ✭ 2,559 (+3608.7%)
Mutual labels:  fish, fisher
Awsm.fish
A curation of prompts, plugins & other resources for Fish. 🐚
Stars: ✭ 2,641 (+3727.54%)
Mutual labels:  fish, fish-plugin
goto
A fish shell utility to quickly navigate to aliased directories supporting tab-completion
Stars: ✭ 17 (-75.36%)
Mutual labels:  fish
dotfiles
Dotfiles for Neovim (0.7+), Fish shell, git, Kitty, tmux, and more.
Stars: ✭ 54 (-21.74%)
Mutual labels:  fish
Blackeye-for-Windows
This is a Phishing tool. Phishing is a type of hacking also called credential harvesting. It creates fake websites for victims to login which saves their login info which includes IP, User-Agent, Username and Password to a file in the computer running Blackeye. This tool has been there for Linux and even Android via Termux. I converted it to Win…
Stars: ✭ 38 (-44.93%)
Mutual labels:  fish
pyenv
Pyenv support plugin for fish-shell
Stars: ✭ 62 (-10.14%)
Mutual labels:  fish
dotfiles
Poom's Neovim, Tmux, Fish and other configurations for macOS & Linux. Literally my entire world.
Stars: ✭ 36 (-47.83%)
Mutual labels:  fish
fish-symnav
Symbolic link navigation for Fish shell
Stars: ✭ 11 (-84.06%)
Mutual labels:  fish
dotfiles
Personal dotfiles for my Arch / BSPWM install.
Stars: ✭ 46 (-33.33%)
Mutual labels:  fish
dotfiles
My work setup
Stars: ✭ 14 (-79.71%)
Mutual labels:  fish
dotfiles
No description or website provided.
Stars: ✭ 20 (-71.01%)
Mutual labels:  fish
fishline
A powerline prompt framework for the fish-shell built in fish-shell.
Stars: ✭ 66 (-4.35%)
Mutual labels:  fish
FSA
FSA (Fisheries Stock Assessment) package provides R functions to conduct typical introductory fisheries analyses.
Stars: ✭ 54 (-21.74%)
Mutual labels:  fish
fish
Fish config with awesome flexible prompt, unicode symbols, better fzf integration and lot of handy functions.
Stars: ✭ 27 (-60.87%)
Mutual labels:  fish
fzf-zsh-plugin
ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.
Stars: ✭ 117 (+69.57%)
Mutual labels:  command-history

🧽 Sponge Releases

Discord Twitch Status

Don't you hate it when you spend half an hour searching for a command, finally find it and happily press Enter only to realize a couple of seconds later... it's not that one, it's another one you've entered two months ago, the one with the typo.

Ugh. Awful. Ungodly. Unproductive. Your day is ruined… unless you use Sponge.

Sponge quietly runs in the background and keeps your shell history clean from typos, incorrectly used commands and everything you don't want to store due to privacy reasons.

πŸ’Ύ Installation

Install with Fisher:

fisher install meaningful-ooo/sponge

πŸ€– System requirements

πŸ•ΉοΈ Usage

Just use your shell as usual and enjoy typos-free history😎

Sponge will automatically filter out all failed commands unless they have been in the history before. The last 2 entries are always available so you can quickly fix a misspelled command.

Sponge won’t filter commands retroactively. If you don’t want previously mistyped commands clogging up your search results, clear the history once after Sponge installation:

history clear

βš™οΈ Settings

πŸ’© Filter failed

By default Sponge will filter out all commands that don’t have 0 as an exit code. You can tweak which exit codes Sponge considers successful with sponge_successful_exit_codes variable:

set sponge_successful_exit_codes 0 127

If you wish to filter out all failed commands regardless of whether they already have been in the history or not, change sponge_allow_previously_successful variable:

set sponge_allow_previously_successful false

πŸ•΅πŸ» Filter by regex

You can use the full power of regular expressions to filter out unwanted commands. Set sponge_regex_patterns variable and everything matched will be kept away from the history. For example, to filter out every command that contains IPv4 address, type:

set sponge_regex_patterns '(?:\d{1,3}\.){3}\d{1,3}'

πŸ¦₯ Adjusting delay

By default Sponge delays deleting of filtered command so you can always access the last 2 history entries. If you want to remove commands immediately or increase the delay, change sponge_delay variable:

set sponge_delay 5

πŸ€“ Custom filters

Sponge works by invoking an array of filters. You can plug into this mechanism by defining your own filters.

Filter is simply a function with a specific call signature:

Argument Name Description
1 command The exact command that was entered
2 exit_code The exit code of the command
3 previously_in_history true or false flag indicating if the command has been in the history before

Return with exit status 0 to filter out provided command and anything else to keep the command in the history.

You can define your filter in config.fish or as a standalone function in fish functions folder.

Be mindful of what you put in filters, as they are run synchronously after each command execution and can slow down your prompt in case of compute-intensive tasks or network requests.

After that you need to register your filter with Sponge by adding its name in sponge_filters variable:

set --append sponge_filters my_awesome_filter

Make sure to append sponge_filters like in the example above unless you want to disable the built in filters:

©️ License

MIT

πŸ΄β€β˜ οΈ 🏰 πŸ’Ž Meaningful

We are the first ever blockchain state. More.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].