Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kurkale6ka/zsh
https://github.com/kurkale6ka/zsh
cd-bookmarks command-line fuzzy-cd zsh
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kurkale6ka/zsh
- Owner: kurkale6ka
- Created: 2015-02-20T17:21:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T11:11:15.000Z (8 months ago)
- Last Synced: 2024-06-10T01:33:51.048Z (5 months ago)
- Topics: cd-bookmarks, command-line, fuzzy-cd, zsh
- Language: Shell
- Size: 530 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NB: this is deprecated
Use [Fuzzy cd, using shell's history](https://github.com/kurkale6ka/scripts/blob/master/fuzzy_cd/README.md) instead# Fuzzy cd based on bookmarks
_Every cd is bookmarked and assigned a weight so you can later on jump to it quickly_
## All of the following is needed:
1. **Install** [fzf](https://github.com/junegunn/fzf)
2. **XDG setup**:
In `/etc/zsh/zshenv`, `/etc/zshenv` or `~/.zshenv`:
```sh
# XDG configuration home
if [[ -z $XDG_CONFIG_HOME ]]
then
export XDG_CONFIG_HOME=$HOME/.config
fi# XDG data home
if [[ -z $XDG_DATA_HOME ]]
then
export XDG_DATA_HOME=$HOME/.local/share
fi
```3. **Bookmarks database**:
```sh
mkdir -p $XDG_DATA_HOME/markssqlite3 $XDG_DATA_HOME/marks/marks.sqlite << 'INIT'
CREATE TABLE marks (
dir VARCHAR(200) UNIQUE,
weight INTEGER
);CREATE INDEX _dir ON marks (dir);
INIT
```4. **Autoload functions** ([ZSH Functions](http://zsh.sourceforge.net/Doc/Release/Functions.html)):
* [fuzzy cd](https://github.com/kurkale6ka/zsh/blob/master/autoload/fuzzy/c)
* [bookmarks update](https://github.com/kurkale6ka/zsh/blob/master/autoload/fuzzy/update_marks)
* [bookmarks cleanup](https://github.com/kurkale6ka/zsh/blob/master/autoload/fuzzy/ccleanup)5. **PWD hook function**: `chpwd_functions+=(update_marks)` in `~/.zshrc`
## Usage:
```
c # choose where to cd from all bookmarks
c pattern ... # cd to a matching path
c -s # statisticsccleanup
```