Skip to content

CHID -> Command History In Directory, so you never forget commands you did at the beginning of the project.

Notifications You must be signed in to change notification settings

Cvaniak/CommandHistoryInDirectory

Repository files navigation

πŸ” Command History In Repository (CHID)

Creates hisotry for current directory

⚠️ Project is in testing phase so history format may change in next version

πŸ”¦ Demo

Demo

πŸ’‘ Motivation

This code stores command history for current directory and allows you to display it.
This idea is result of problem that I always forget commands used at the beginning of the project.

βš™οΈ Installation

Add to your .zshrc this line, where <path/to/chid_directory> should be path to this repo.

  • source <path/to/chid_directory>/chid_plugin.zsh

If you want use alias do it with CHID_ALIAS like this:

CHID_ALIAS=your_custom_alias
CHID_SHORTCUT='^ ' # Default for Ctrl+SPACE
# for example ~/chid_directory/chid_plugin.zsh
source <path/to/chid_directory>/chid_plugin.zsh

you can also setup custom shortcut for buffer replacement with CHID_SHORTCUT.

πŸ› οΈ Usage

  • To list commands used in current directory run chid.
  • To list commands by time of first occurance use -sf or last occurance -sl.
  • By default chid displays first 20 lines of output. You can change it with -l <num> or --limit <num>.

Not tested well yet:

  • You can get command to buffer by chid number e.g. chid 1 and then running your shortcut (default to Ctrl+SPACE)

πŸ“ TODO

  • β­• Reverse List
  • βœ”οΈ Display by date
  • βœ”οΈ Limit output
  • β­• Better way to search commands in directory
  • β­• Support multiline commands (now they might not work well...)
  • β­• Sort by command (without arguments and flags)

πŸ‘€ Similar projects

While making this project I found very similar but with a little diffrent goal. Maybe you will like it more:

About

CHID -> Command History In Directory, so you never forget commands you did at the beginning of the project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published