McFly replaces your default ctrl-r
shell history search with an intelligent search engine that takes into account
your working directory and the context of recently executed commands. McFly's suggestions are prioritized
in real time with a small neural network.
TL;DR: an upgraded ctrl-r
where history results make sense for what you're working on right now.
ctrl-r
to bring up a full-screen reverse history search prioritized with a small neural network.%
to match any number of characters when searching.The key feature of McFly is smart command prioritization powered by a small neural network that runs in real time. The goal is for the command you want to run to always be one of the top suggestions.
When suggesting a command, McFly takes into consideration:
bash
brew tap cantino/mcfly
mcfly
:
bash
brew install mcfly
Add the following to the end of your ~/.bashrc
, ~/.zshrc
, or ~/.config/fish/config.fish
file:
Bash:
bash
eval "$(mcfly init bash)"
Zsh:
bash
eval "$(mcfly init zsh)"
Fish:
bash
mcfly init fish | source
. ~/.bashrc
/ . ~/.zshrc
/ source ~/.config/fish/config.fish
or restart your terminal emulator.mcfly
:
bash
brew uninstall mcfly
bash
brew untap cantino/mcfly
~/.bashrc
/ ~/.zshrc
/ ~/.config/fish/config.fish
.bash
sudo port selfupdate
mcfly
:
bash
sudo port install mcfly
Add the following to the end of your ~/.bashrc
, ~/.zshrc
, or ~/.config/fish/config.fish
file, as appropriate:
Bash:
bash
eval "$(mcfly init bash)"
Zsh:
bash
eval "$(mcfly init zsh)"
Fish:
bash
mcfly init fish | source
. ~/.bashrc
/ . ~/.zshrc
/ source ~/.config/fish/config.fish
or restart your terminal emulator.mcfly
:
bash
sudo port uninstall mcfly
~/.bashrc
/ ~/.zshrc
/ ~/.config/fish/config.fish
.curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly
Add the following to the end of your ~/.bashrc
, ~/.zshrc
, or ~/.config/fish/config.fish
file, respectively:
Bash:
bash
eval "$(mcfly init bash)"
Zsh:
bash
eval "$(mcfly init zsh)"
Fish:
bash
mcfly init fish | source
Run . ~/.bashrc
/ . ~/.zshrc
/ source ~/.config/fish/config.fish
or restart your terminal emulator.
$PATH
. (For example, you could create a directory at ~/bin
, copy mcfly
to this location, and add export PATH="$PATH:$HOME/bin"
to your .bashrc
/ .zshrc
, or run set -Ua fish_user_paths "$HOME/bin"
for fish.)Add the following to the end of your ~/.bashrc
, ~/.zshrc
, or ~/.config/fish/config.fish
file, respectively:
Bash:
bash
eval "$(mcfly init bash)"
Zsh:
bash
eval "$(mcfly init zsh)"
Fish:
bash
mcfly init fish | source
. ~/.bashrc
/ . ~/.zshrc
/ source ~/.config/fish/config.fish
or restart your terminal emulator.git clone https://github.com/cantino/mcfly
and cd mcfly
cargo install --path .
~/.cargo/bin
is in your $PATH
.Add the following to the end of your ~/.bashrc
, ~/.zshrc
, or ~/.config/fish/config.fish
file, respectively:
Bash:
bash
eval "$(mcfly init bash)"
Zsh:
bash
eval "$(mcfly init zsh)"
Fish:
bash
mcfly init fish | source
. ~/.bashrc
/ . ~/.zshrc
/ source ~/.config/fish/config.fish
or restart your terminal emulator.Add below code to your zshrc.
zsh
zinit ice lucid wait"0a" from"gh-r" as"program" atload'eval "$(mcfly init zsh)"'
zinit light cantino/mcfly
$(mcfly init zsh)
will be executed after promptTo avoid McFly's UI messing up your scrollback history in iTerm2, make sure this option is unchecked:
A number of settings can be set via environment variables. To set a setting you should add the following snippets to your ~/.bashrc
/ ~/.zshrc
/ ~/.config/fish/config.fish
.
To swap the color scheme for use in a light terminal, set the environment variable MCFLY_LIGHT
.
bash / zsh:
bash
export MCFLY_LIGHT=TRUE
fish:
bash
set -gx MCFLY_LIGHT TRUE
Tip: on macOS you can use the following snippet for color scheme to be configured based on system-wide settings:
bash / zsh:
bash
if [[ "$(defaults read -g AppleInterfaceStyle 2&>/dev/null)" != "Dark" ]]; then
export MCFLY_LIGHT=TRUE
fi
By default Mcfly uses an emacs
inspired key scheme. If you would like to switch to the vim
inspired key scheme, set the environment variable MCFLY_KEY_SCHEME
.
bash / zsh:
bash
export MCFLY_KEY_SCHEME=vim
fish:
bash
set -gx MCFLY_KEY_SCHEME vim
To enable fuzzy searching, set MCFLY_FUZZY
to an integer. 0 is off; higher numbers weight toward shorter matches. Values in the 2-5 range get good results so far; try a few and report what works best for you!
bash / zsh:
bash
export MCFLY_FUZZY=2
fish:
bash
set -gx MCFLY_FUZZY 2
To change the maximum number of results shown, set MCFLY_RESULTS
(default: 10).
bash / zsh:
bash
export MCFLY_RESULTS=50
fish:
bash
set -gx MCFLY_RESULTS 50
To change interface view, set MCFLY_INTERFACE_VIEW
(default: TOP
).
Available options: TOP
and BOTTOM
bash / zsh:
bash
export MCFLY_INTERFACE_VIEW=BOTTOM
fish:
bash
set -gx MCFLY_INTERFACE_VIEW BOTTOM
To disable the menu interface, set the environment variable MCFLY_DISABLE_MENU
.
bash / zsh:
bash
export MCFLY_DISABLE_MENU=TRUE
fish:
bash
set -gx MCFLY_DISABLE_MENU TRUE
To change the sorting of results shown, set MCFLY_RESULTS_SORT
(default: RANK).
Possible values RANK
and LAST_RUN
bash / zsh:
bash
export MCFLY_RESULTS_SORT=LAST_RUN
fish:
bash
set -gx MCFLY_RESULTS_SORT LAST_RUN
McFly stores its SQLite database in the standard location for the OS. On OS X, this is in ~/Library/Application Support/McFly
and on Linux it is in $XDG_DATA_DIR/mcfly/history.db
(default would be ~/.local/share/mcfly/history.db
). For legacy support, if ~/.mcfly/
exists, it is used instead.
If you have a very large history database and you notice that McFly launches slowly, you can set MCFLY_HISTORY_LIMIT
to something like 10000 to limit how many records are considered when searching. In this example, McFly would search only the latest 10,000 entries.
Contributions and bug fixes are encouraged! However, we may not merge PRs that increase complexity significantly beyond what is already required to maintain the project. If you're in doubt, feel free to open an issue and ask.
cargo test
Cargo.toml
and bump the version.cargo clippy
and cargo fmt
.cargo build
).git add -p
git ci -m 'Bumping to vx.x.x'
git tag vx.x.x
git push origin head --tags
pkg/brew/mcfly.rb
and update the version and SHAs. (shasum -a 256 ...
)../homebrew-mcfly/pkg/brew/mcfly.rb
too.
cp pkg/brew/mcfly.rb ../homebrew-mcfly/pkg/brew/mcfly.rb
diff ../homebrew-mcfly/pkg/brew/mcfly.rb ../mcfly/pkg/brew/mcfly.rb ; diff ../homebrew-mcfly/HomebrewFormula/mcfly.rb ../mcfly/HomebrewFormula/mcfly.rb
git add -p && git ci -m 'Update homebrew' && git push
cd ../homebrew-mcfly && git add -p && git ci -m 'Update homebrew' && git push && cd ../mcfly
cargo publish