Skip to content
/ jog Public

Simple script to print the last 10 commands you ran in the current directory

Notifications You must be signed in to change notification settings

natethinks/jog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

jog

Print the last 10 commands you ran in the current directory

Gif of Fezzik jogging memory

Usage

  1. Add this function to your .zshrc
function zshaddhistory() {
  if [[ "${1}" != ${~HISTORY_IGNORE} ]]; then
	echo "${1%%$'\n'}⋮${PWD}   " >> ~/.zsh_history_ext
  fi
}
  1. Download or copy the jog script from this repo and place it somewhere in your $PATH.

  2. Run touch ~/.zsh_history_ext ; chmod 600 ~/.zsh_history_ext to ensure that only you can read and write your history.

  3. Restart your current terminal sessions for changes to take effect. exec $SHELL

  4. Use jog whenever you find yourself lost and confused.

It's not possible to retroactively store the directory in which a command was run, so this tool will only work from this point forward.

Todo List

Contributions and feature requests are welcome

  • Add support for other shells: bash, fish.
  • Automatically truncate .zsh_history_ext when HISTSIZE is surpassed

About

Simple script to print the last 10 commands you ran in the current directory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •