{"id":13897828,"url":"https://github.com/pabloariasal/zfm","last_synced_at":"2025-07-17T15:30:43.244Z","repository":{"id":42438003,"uuid":"247706158","full_name":"pabloariasal/zfm","owner":"pabloariasal","description":"Zsh Fuzzy Marks","archived":false,"fork":false,"pushed_at":"2022-09-04T01:50:45.000Z","size":66,"stargazers_count":58,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-07T18:44:38.726Z","etag":null,"topics":["bookmarks","cli","shell","zsh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pabloariasal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-16T13:14:16.000Z","updated_at":"2024-08-01T22:25:36.000Z","dependencies_parsed_at":"2022-08-12T10:00:39.432Z","dependency_job_id":null,"html_url":"https://github.com/pabloariasal/zfm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloariasal%2Fzfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloariasal%2Fzfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloariasal%2Fzfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloariasal%2Fzfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabloariasal","download_url":"https://codeload.github.com/pabloariasal/zfm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226274540,"owners_count":17598833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bookmarks","cli","shell","zsh"],"created_at":"2024-08-06T18:03:53.848Z","updated_at":"2024-11-25T04:30:18.401Z","avatar_url":"https://github.com/pabloariasal.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# zfm - Zsh Fuzzy Marks\n\n`zfm` is a command line bookmark manager for Zsh built on top of [fzf](https://github.com/junegunn/fzf).\nIt lets you bookmark files and directories in your system and rapidly access them.\n\nIt's intended to be a less intrusive alternative to `z`, `autojump` or `fasd` that doesn't pollute your prompt command (`PS1`) or create bookmarks behind the scenes: you have full control over what gets bookmarked and when, like bookmarks on a web browser.\n\n# Installation\n\n## Install fzf\n\n`zfm` is built on top of `fzf` so you must install that first. Follow the instructions [here](https://github.com/junegunn/fzf#installation).\n\n## Install zfm\n\n### Oh My Zsh\n\n1. Clone the repo in Oh My Zsh's plugin directory:\n\n```sh\ngit clone https://github.com/pabloariasal/zfm ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zfm}\n```\n\n2. Activate the plugin in your `.zshrc`:\n\n```sh\nplugins=(zfm)\n```\n\n### Antigen\n\nAdd this to your `.zshrc`:\n\n```sh\nantigen bundle pabloariasal/zfm\n```\n\n### Manual (Git Clone)\n\n1. Clone the repo\n\n```sh\ngit clone https://github.com/pabloariasal/zfm ~/.zsh/zfm\n```\n\n2. Add the following to your `.zshrc`:\n\n```sh\nsource ~/.zsh/zfm/zfm.zsh\n```\n\n# Usage\n\n## Bookmark files and directories\n\n```sh\n$ zfm add ~/Downloads ~/Documents/wallpaper.png\n```\n\n## List bookmarks\n\n```sh\n$ zfm list\n/home/pablo/Downloads                [d]\n/home/pablo/Documents/wallpaper.png  [f]\n```\n\nlist only bookmarked files:\n\n```sh\n$ zfm list --files\n/home/pablo/Documents/wallpaper.png  [f]\n```\nor directories:\n\n```sh\n$ zfm list --dirs\n/home/pablo/Downloads  [d]\n```\n\n## Enter a bookmark into the current command line buffer\n\nTo enter a bookmark into the current command line buffer, press `ctrl+o`.\nThis will open a selection menu with all your bookmarks:\n\n![](misc/bookmark_selection.png)\n\nand enter your selection(s) into the current command line buffer:\n\n![](misc/bookmark_inserted.png)\n\n## `cd` into a bookmarked directory\n\nOff course you can cd into a bookmarked directory, just press `ctrl+p`.\n\nThis will open a selection menu with all your bookmarked directories:\n\n![](misc/select_dir.png)\n\nand directly jump to the directory you have selected:\n\n![](misc/changed_dir.png)\n\nAlternatively, you can type `f` followed by a pattern to directly jump to the directory matching the pattern (like `autojump`):\n\n```sh\n$ f down\n/home/pablo/Downloads$\n```\nIf the pattern is ambiguous a selection menu will be opened with the possible options.\n\n## Use in custom scripts\n\nYou can use `zfm` in scripts and aliases.\n\n### Example: Open a bookmarked file in Vim\nFor example, you can create an alias to open a bookmarked file with vim by adding this to your `.zshrc`:\n\n```sh\nalias of='vim $(zfm select --files --multi)'\n```\nTyping `of` will open a selection menu with all bookmarked files and directly open the selection in vim.\n\nThe option `--multi` allows you to select multiple entries.\n\n### Example: Open a bookmarked file using `dmenu`\nYou can create a script that opens a bookmarked file in dmenu:\n\n```\n#!/usr/bin/env zsh\n\nselection=$(zfm list --files | dmenu | awk '{print $1}')\ngvim \"$selection\"\n# or open in vim inside a terminal emulator\nalacritty -e vim \"$selection\"\n```\n\n## Edit Bookmarks\n\nYou can edit your bookmarks (add, delete, reorder) with:\n\n```sh\nzfm edit\n```\n\nThis will open your bookmarks in a text editor (as defined by `EDITOR`) and let you manually edit, remove or reorder your bookmarks.\n\n# Commands\n\n| Command | Description | Extra Options\n| --- | --- | ---\n| `zfm list` | List bookmarks | `--files`, `--dirs`\n| `zfm add \u003cpath\u003e [\u003cpath\u003e...]` | Add a bookmark. |\n| `zfm select` | Open selection menu with all bookmarks and print selection to stdout. | `--files`, `--dirs`, `--multi`\n| `zfm query \u003cpattern\u003e` | Print bookmark matching `pattern` to stdout. Selection menu will open if match is ambiguous. | `--files`, `--dirs`\n| `zfm edit` | Open and edit the bookmarks file |\n| `zfm fix` | Remove bookmarked entries that no longer exist in the filesystem |\n| `zfm clear` | Remove all bookmarks |\n| `f \u003cpattern\u003e` | Jump to bookmark directory matching `pattern`, open selection if ambiguous |\n\n# Options\n\n| Option | Description | Available for |\n| --- | --- | --- |\n| `--files` | Restrict to just files | `query`, `list`, `select` |\n| `--dirs` | Restrict to just dirs | `query`, `list`, `select` |\n| `--multi` | Allow selecting multiple items | `select` |\n\n# Key Bindings\n\n| Key Binding | Description |\n| --- | --- |\n| `ctrl+o` | Select one or multiple bookmarks and insert them into the current command line |\n| `ctrl+p` | jump to selected directory               |\n\n\n# Variables\n\n## `ZFM_NO_BINDINGS`\n\nPer default, `zfm` creates two key bindings, `ctrl-p` and `ctrl-o`.\nTo disable the creation of key bindings, you can set the environment variable `ZFM_NO_BINDINGS` in your `zshrc`:\n\n```shell\nexport ZFM_NO_BINDINGS=1\n```\n\nor if you wish so, you can rebind them to something else, see [F.A.Q](#faq).\n\n## `ZFM_BOOKMARKS_FILE`\n\nSets the bookmarks file. Defaults to `~/.zfm.txt`\n\n```shell\nexport ZFM_BOOKMARKS_FILE='~/.my_bookmarks.txt'\n```\n\n# F.A.Q\n\n### Why not `autojump`, `z`, `fasd` and others?\n\nBecause explicit is better than implicit. I don't want every single directory I visit to be bookmarked, I know which directories I visit the most and which files I need rapid access to.\n\n### I don't like the default key bindings, can I change them?\n\nSure, you can set the `ZFM_NO_BINDINGS` environment variable to disable keybindings or manually unbind them by putting this on your `zshrc`:\n\n```\nbindkey -r '^P'\nbindkey -r '^O'\n```\n\nYou can also rebind them to something more suitable to you:\n\n```\nbindkey -r '^P'\nbindkey -r '^O'\nbindkey '^A' zfm-cd-to-bookmark\nbindkey '^E' zfm-insert-bookmark\n```\n*Tip:* you can use `ctrl+v` on your terminal window to display escape sequences of key bindings.\n\n# Contributing\n\nIf you change anything make sure to run the tests, bonus points if you enhance them:\n## Running the Tests\n\n**NOTE:** you must have python 3.5 or higher installed\n\n1) Install `pipenv`:\n```sh\npip install --user pipenv\n```\n\n2) Run the tests\n```sh\ncd zfm\npipenv run pytest -q test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloariasal%2Fzfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabloariasal%2Fzfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloariasal%2Fzfm/lists"}