Log recently visited directories for FZF
Project description
fzf-dirhistory
A small Python package that keeps a history of recently visited directories. It is primarily intended for use by FZF to quickly jump to previous locations.
Installation
pip3 install --user fzf-dirhistory
Usage (with Bash)
Add this to your .bashrc
to log directories as you visit them:
PROMPT_COMMAND='python3 -m fzfdirhist log "$(pwd)"'
Then add this function to call FZF with the history file as input:
fdh() {
local dir=$(python3 -m fzfdirhist show | fzf --height=40% --reverse +m)
cd "$dir"
}
Calling fdh
will jump to the selected location. You may want to map that
function (here to ALT-H
denoted by \eh
):
bind '"\eh": "\C-k\C-u fdh\n"'
Configuration
The DIR_HISTORY_FILE
environment variable points to the history file (by
default ~/.dirhistory
):
export DIR_HISTORY_FILE="~/.fzf_dirhistory"
The DIR_HISTORY_SIZE
environment variable sets the history maximum size (by
default 100
):
export DIR_HISTORY_SIZE=200
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fzf-dirhistory-0.1.1.tar.gz
.
File metadata
- Download URL: fzf-dirhistory-0.1.1.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329142a32a026660aa4eb4b975632f0796161b0c77238bb1db02d93fbd45d78e |
|
MD5 | 0b73327343c900c1c7789eb30bd385ab |
|
BLAKE2b-256 | aef427016f87de3e6ae7ce178d5c806b21e507e642c0719de81d43636d451903 |
File details
Details for the file fzf_dirhistory-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fzf_dirhistory-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37fcfdfe7c040a41fb24cac5d5b525de43c109b7bc79dbf4f9ac3657e6449412 |
|
MD5 | f25bd01858998a099439dc55eaae68a0 |
|
BLAKE2b-256 | d89ce7a4e6a976c2b5006eda06ddc292cfbbc6a5986576ba8d25bf3944447ea8 |