r
stores all successfully executed commands per directory. Allowing you to easily see what command you last executed. You can also sort by most used commands, recently used and see commands from all directories.
- OS X / Linux
- Bash
brew tap jesselucas/r
brew install r
go get -u github.com/jesselucas/r
r -install
which will add.r.sh
to home directory and source in.bashrc
- or manually add
.r.sh
to your.bashrc
- ex.
. $GOPATH/src/github.com/jesselucas/r/.r.sh
- ex.
By default r
shows bash history per directory and is sorted by last used.
You can see all history by using the -global
flag.
Usage of r:
-install
installs r.sh to .bashrc
-global
show all commands stored by r
-g
show all commands stored by r (shorthand)
-u sort commands by usage rather than last used (shorthand)
-usage
sort commands by usage rather than last used
- Type
r
in any directory and it will promptr>
. - Press
tab
key to see all history. - Or start typing command and press
tab
to filter history. - Use
tab
orarrow
keys to navigate history items.
- Set the Directory and Global history in your
.bashrc
# r settings
export R_DIRHISTORY=30 # total to save for directory history
export R_GLOBALHISTORY=100 # total to save for global history
# export R_SORTBYUSAGE=1 # turn this on to default sorting by usage
- Write test!
Make history limit an environment variableCreate flag to see history for all directoriesCreate flag to sort by most used rather than the default last used.- Create brew formula
- Improve stability of .r.sh
- Make compatible with zsh