{"id":16803106,"url":"https://github.com/n-r-k/shellmarks","last_synced_at":"2025-04-11T00:42:45.386Z","repository":{"id":111508284,"uuid":"394914679","full_name":"N-R-K/shellmarks","owner":"N-R-K","description":"Simple directory bookmark management via symlinks. [MIRROR OF https://codeberg.org/NRK/shellmarks]","archived":false,"fork":false,"pushed_at":"2024-04-01T09:45:47.000Z","size":95,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:42:37.442Z","etag":null,"topics":["bash","bookmarks","directory-bookmarks","zsh"],"latest_commit_sha":null,"homepage":"https://codeberg.org/NRK/shellmarks","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N-R-K.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-11T08:13:30.000Z","updated_at":"2025-02-20T09:35:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"60a44bc5-c064-4474-b8d6-f48dbd9e5b04","html_url":"https://github.com/N-R-K/shellmarks","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/N-R-K%2Fshellmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2Fshellmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2Fshellmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2Fshellmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N-R-K","download_url":"https://codeload.github.com/N-R-K/shellmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322602,"owners_count":21084336,"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":["bash","bookmarks","directory-bookmarks","zsh"],"created_at":"2024-10-13T09:41:34.923Z","updated_at":"2025-04-11T00:42:45.371Z","avatar_url":"https://github.com/N-R-K.png","language":"Shell","readme":"# Shellmarks\n\n[![CodeBerg](https://img.shields.io/badge/Hosted_at-Codeberg-%232185D0?style=flat-square\u0026logo=CodeBerg)](https://codeberg.org/NRK/shellmarks)\n\nA simple shell script for managing bookmarks via symlinks.\n\n![shellmarks](shellmarks.png)\n\nShellmarks is heavily inspired by [bashmarks][].\nUnlike bashmarks however, shellmarks uses symlinks to create and manage bookmarks.\n\n[bashmarks]: https://github.com/huyng/bashmarks\n\nThis is a better and more flexible approach because now you can point many\ndifferent application, such as your filemanger or the filepicker etc, to a\nsingle unified directory. You no longer need to maintain and sync different\nbookmarks for different applications.\n\n## Installation\n\nClone the repo.\n\n```console\n$ git clone https://codeberg.org/NRK/shellmarks.git\n```\n\nThen just copy/move `shellmarks` into your `$PATH` (e.g `/usr/local/bin/`).\nInstead of copying, you can also create a symlink. This way you can do a git\npull to get updates.\n\n## Usage\n\nBy default shellmarks uses `~/.local/share/shellmarks` as the bookmark\ndirectory. This can be changed via the `$SH_MARKS` environment variable.\n\nAdd a bookmark. If `target` is omitted the current working directory `$PWD`,\nwill be used.\n```\nshellmarks add \u003cname\u003e [target]\n```\n\nList all the available bookmarks. When called with the `-n` flag, it will only\nprint the bookmark name without printing the realpath.\n```\nshellmarks ls [-n]\n```\n\nRemove a bookmark.\n```\nshellmarks rm \u003cname\u003e\n```\n\nPrint the real path of a bookmark.\n```\nshellmarks path \u003cname\u003e\n```\n\nAll of these commands are meant to be aliased. In the example image above I'm\nusing the following aliases. Copy paste them into your `~/.bashrc` or\n`~/.zshrc`.\n\n```sh\nalias l=\"shellmarks ls\"\nalias d=\"shellmarks rm\"\nalias sd=\"shellmarks add\"\n```\n\nYou can also disable the colored output by calling shellmarks with the `-c` flag.\nThe [`NO_COLOR`][no-color] environment variable is also respected.\n\n[no-color]: https://no-color.org\n\n### Cd-ing into a directory\n\nSince shellmarks simply creates symlinks, there's a couple ways to actually\nachieve this. My preferred way is to adding a small function wrapper to your\nshell.\n\nAdd the following function into your `~/.bashrc` or `~/.zshrc`.\n\n```sh\ng() {\n  local cddir=\"$(shellmarks path \"$1\")\"\n  case \"$cddir\" in\n    /*) cd \"$cddir\" ;;\n    *) printf '%s' \"$cddir\" ;;\n  esac\n}\n```\n\nNow you can do `g \u003cname\u003e` to cd into a directory form the command line. You are\nfree to change `g` to something else here if you wish.\n\nAnother way would be to utilize the [`CDPATH`][cdpath] environment variable.\nDo be careful to not modify this variable outside your interactive shell, as\nthat might lead to undesirable side-effects.\n\n[cdpath]: https://linux.101hacks.com/cd-command/cdpath/\n\n## Auto Complete\n\n### ZSH\n\nAdd the following to your `.zshrc` to get auto-completion.\n\n```zsh\n_shmk_autocomp() { reply=($(shellmarks -c ls -n)); }\ncompctl -K _shmk_autocomp shellmarks\ncompctl -K _shmk_autocomp g  # for the cd function, change 'g' if your function is named differently\n```\n\n### Bash\n\nAdd the following to your `.bashrc` to get auto-completion.\n\n```bash\nbind 'set show-all-if-ambiguous on'  # optional, but good to have\n_shmk_autocomp() {\n  local curw\n  COMPREPLY=()\n  curw=${COMP_WORDS[COMP_CWORD]}\n  COMPREPLY=($(compgen -W '`shellmarks -c ls -n`' -- $curw))\n  return 0\n}\n\ncomplete -F _shmk_autocomp g  # for the cd function, change 'g' if your function is named differently\ncomplete -F _shmk_autocomp d  # for the d alias, change it to fit your alias\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-r-k%2Fshellmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-r-k%2Fshellmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-r-k%2Fshellmarks/lists"}