my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.4 KiB

3 years ago
  1. # Fastfile plugin
  2. This plugin adds a way to reference certain files or folders used frequently using
  3. a global alias or shortcut.
  4. To use it, add `fastfile` to the plugins array in your zshrc file:
  5. ```zsh
  6. plugins=(... fastfile)
  7. ```
  8. ## Usage
  9. Example: you access folder `/code/project/backend/database` very frequently.
  10. First, generate a shortcut with the name `pjdb`:
  11. ```zsh
  12. $ fastfile pjdb /code/project/backend/database
  13. ```
  14. Next time you want to access it, use `§pjdb`. For example:
  15. ```zsh
  16. $ cd §pjdb
  17. $ subl §pjdb
  18. ```
  19. where § is the fastfile prefix (see [below](#options) for how to change).
  20. **Note:** shortcuts with spaces in the name are assigned a global alias
  21. where the spaces have been substituted with underscores (`_`). For example:
  22. a shortcut named `"hello world"` corresponds with `§hello_world`.
  23. ## Functions
  24. - `fastfile <shortcut_name> [path/to/file/or/folder]`: generate a shortcut.
  25. If the second argument is not provided, the current directory is used.
  26. - `fastfile_print <shortcut_name>`: prints a shortcut, with the format
  27. `<prefix><shortcut_name> -> <shortcut_path>`.
  28. - `fastfile_ls`: lists all shortcuts.
  29. - `fastfile_rm <shortcut_name>`: remove a shortcut.
  30. - `fastfile_sync`: generates the global aliases for the shortcuts.
  31. ### Internal functions
  32. - `fastfile_resolv <shortcut_name>`: resolves the location of the shortcut
  33. file, i.e., the file in the fastfile directory where the shortcut path
  34. is stored.
  35. - `fastfile_get <shortcut_name>`: get the real path of the shortcut.
  36. ## Aliases
  37. | Alias | Function |
  38. |--------|------------------|
  39. | ff | `fastfile` |
  40. | ffp | `fastfile_print` |
  41. | ffrm | `fastfile_rm` |
  42. | ffls | `fastfile_ls` |
  43. | ffsync | `fastfile_sync` |
  44. ## Options
  45. These are options you can set to change certain parts of the plugin. To change
  46. them, add `<variable>=<value>` to your zshrc file, before Oh My Zsh is sourced.
  47. For example: `fastfile_var_prefix='@'`.
  48. - `fastfile_var_prefix`: prefix for the global aliases created. Controls the prefix of the
  49. created global aliases.
  50. **Default:** `§` (section sign), easy to type in a german keyboard via the combination
  51. [`⇧ Shift`+`3`](https://en.wikipedia.org/wiki/German_keyboard_layout#/media/File:KB_Germany.svg),
  52. or using `⌥ Option`+`6` in macOS.
  53. - `fastfile_dir`: directory where the fastfile shortcuts are stored. Needs to end
  54. with a trailing slash.
  55. **Default:** `$HOME/.fastfile/`.
  56. ## Author
  57. - [Karolin Varner](https://github.com/koraa)