All Projects → b4b4r07 → zsh-history

b4b4r07 / zsh-history

Licence: other
A plugin for zsh history extended by golang, dealing it like SQL

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to zsh-history

Zsh Navigation Tools
Curses-based tools for Zsh, e.g. multi-word history searcher
Stars: ✭ 249 (+207.41%)
Mutual labels:  zsh-plugin
ls
Zsh plugin for ls
Stars: ✭ 73 (-9.88%)
Mutual labels:  zsh-plugin
zsh-aws-vault
oh-my-zsh plugin for aws-vault
Stars: ✭ 63 (-22.22%)
Mutual labels:  zsh-plugin
zsh-fast-alias-tips
Help remembering the aliases you defined once
Stars: ✭ 58 (-28.4%)
Mutual labels:  zsh-plugin
git
Provides nice git aliases and functions.
Stars: ✭ 26 (-67.9%)
Mutual labels:  zsh-plugin
zsh-startup-timer
A zsh plugin to print the time it takes for the shell to start up
Stars: ✭ 18 (-77.78%)
Mutual labels:  zsh-plugin
Z.lua
⚡ A new cd command that helps you navigate faster by learning your habits.
Stars: ✭ 2,164 (+2571.6%)
Mutual labels:  zsh-plugin
smartcd
Expedite your navigation of Linux filesystem.
Stars: ✭ 35 (-56.79%)
Mutual labels:  zsh-plugin
jq-zsh-plugin
jq zsh plugin
Stars: ✭ 155 (+91.36%)
Mutual labels:  zsh-plugin
jira.plugin.zsh
CLI support for JIRA & Git interaction
Stars: ✭ 31 (-61.73%)
Mutual labels:  zsh-plugin
tumult.plugin.zsh
Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Stars: ✭ 147 (+81.48%)
Mutual labels:  zsh-plugin
material-colors
Material colorscheme
Stars: ✭ 25 (-69.14%)
Mutual labels:  zsh-plugin
Theme-Engine
Theme-Engine is usually made for modification & customization, so you can make trunks even more Colourful and better your Termux.
Stars: ✭ 31 (-61.73%)
Mutual labels:  zsh-plugin
dotfiles
⚫️ ~ is where the ♥ is - my dotfiles.
Stars: ✭ 94 (+16.05%)
Mutual labels:  zsh-plugin
dockertex
🐋📓📽 Latex & Texstudio Dockerfiles with multiple texlive versions and proper command line tools 🔮 Mirror only!
Stars: ✭ 26 (-67.9%)
Mutual labels:  zsh-plugin
Zsh Vi Mode
💻 A better and friendly vi(vim) mode plugin for ZSH.
Stars: ✭ 181 (+123.46%)
Mutual labels:  zsh-plugin
fzf-zsh-plugin
ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.
Stars: ✭ 117 (+44.44%)
Mutual labels:  zsh-plugin
crash
Proper error handling, exceptions and try/catch for ZSH
Stars: ✭ 51 (-37.04%)
Mutual labels:  zsh-plugin
wakatime-zsh-plugin
🕒Track how much time you have spent in your terminal!
Stars: ✭ 71 (-12.35%)
Mutual labels:  zsh-plugin
nx-completion
Nx Devtools completion plugin for Zsh.
Stars: ✭ 70 (-13.58%)
Mutual labels:  zsh-plugin

zsh-history

A plugin for zsh history extended by golang, dealing it like SQL

Features

  • Fast and simple

  • Searchable by SQL

    • History searchable per directory
    • etc...
  • Can sub-string search (like zsh-users/zsh-history-substring-search)

  • Automatically backup daily DB file like:

    $ tree $ZSH_HISTORY_BACKUP_DIR
    /Users/b4b4r07/.zsh/history/backup
    `-- 2017
        `-- 02
            |-- 13.db
            `-- 14.db
    
    2 directories, 2 files

Installation

$ git clone https://github.com/b4b4r07/zsh-history && cd zsh-history
$ make && sudo make install
$ source init.zsh

Usage

Set the env like the following:

# DB file path
export ZSH_HISTORY_FILE="$HOME/.zsh_history.db"
# CLI selector
export ZSH_HISTORY_FILTER="fzy:fzf:peco:percol"

# History per directory
export ZSH_HISTORY_KEYBIND_GET_BY_DIR="^r"
# All histories
export ZSH_HISTORY_KEYBIND_GET_ALL="^r^a"

# Run any SQLs on original selector I/F (with screen)
export ZSH_HISTORY_KEYBIND_SCREEN="^r^r"

# substring
export ZSH_HISTORY_KEYBIND_ARROW_UP="^p"
export ZSH_HISTORY_KEYBIND_ARROW_DOWN="^n"

About zhist

Schema

Table name: history

Name Type Desc
id int ID
date string Date time (format by %F %T)
dir string Direcotry when executed
command string Command
status int Status code ($?)
host string Host name

Configurable

Located in ~/.config/zhist/config.toml:

prompt = "sqlite3> "
init_query = "SELECT DISTINCT(command) FROM history WHERE command LIKE '%%' AND status = 0 ORDER BY id DESC"
init_cursor = "%"
vim_mode_prompt = "VIM-MODE"
ignore_words = [
    "false",
    "echo",
]

License

MIT

Author

b4b4r07

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].