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.

151 lines
4.5 KiB

15 years ago
  1. ========
  2. AUTOJUMP
  3. ========
  4. ----------------------------
  5. A ``cd`` command that learns
  6. ----------------------------
  7. One of the most used shell commands is ``cd``. A quick survey among my friends revealed that between 10 and 20% of all commands they type are actually ``cd`` commands! Unfortunately, jumping from one part of your system to another with ``cd`` requires to enter almost the full path, which isn't very practical and requires a lot of keystrokes.
  8. autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line. The jumpstat command shows you the current contents of the database. You need to work a little bit before the database becomes usable. Once your database is reasonably complete, you can "jump" to a commonly "cd"ed directory by typing:
  9. j dirspec
  10. where dirspec is a few characters of the directory you want to jump to. It will jump to the most used directory whose
  11. name matches the pattern given in dirspec. Note that autojump isn't meant to be a drop-in replacement for cd, but rather a complement. Cd is fine when staying in the same area of the filesystem; autojump is there to help when you need to jump far away from your current location.
  12. Autojump supports tab completion. Try it! Autojump should be compatible with bash 4. Please report any problems!
  13. Pierre Gueth contributed a very nice applet for freedesktop desktops (Gnome/KDE/...). It is called "jumpapplet", try it!
  14. Thanks to Simon Marache-Francisco's outstanding work, autojump now works perfectly with zsh.
  15. Examples
  16. ========
  17. ::
  18. j mp3
  19. could jump to ``/home/gwb/my mp3 collection``, if that is the directory in which you keep your mp3s. ::
  20. jumpstat
  21. will print out something in the lines of::
  22. ...
  23. 54.5: /home/shared/musique
  24. 60.0: /home/joel/workspace/coolstuff/glandu
  25. 83.0: /home/joel/workspace/abs_user/autojump
  26. 96.9: /home/joel/workspace/autojump
  27. 141.8: /home/joel/workspace/vv
  28. 161.7: /home/joel
  29. Total key weight: 1077
  30. The "key weight" reflects the amount of time you spend in a directory.
  31. Author
  32. ======
  33. Joel Schaerer (joel.schaerer (at) laposte.net)
  34. Autojump applet written by Pierre Gueth
  35. Zsh support: Simon Marache-Francisco
  36. Install script written by Daniel Jackoway and others.
  37. License
  38. =======
  39. autojump is free software: you can redistribute it and/or modify
  40. it under the terms of the GNU General Public License as published by
  41. the Free Software Foundation, either version 3 of the License, or
  42. (at your option) any later version.
  43. autojump is distributed in the hope that it will be useful,
  44. but WITHOUT ANY WARRANTY; without even the implied warranty of
  45. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  46. GNU General Public License for more details.
  47. You should have received a copy of the GNU General Public License
  48. along with autojump. If not, see <http://www.gnu.org/licenses/>.
  49. Installation
  50. ============
  51. Auto Installation
  52. -----------------
  53. run::
  54. ./install.sh
  55. or::
  56. ./install.zsh
  57. depending on your shell.
  58. Enter your root password if it asks.
  59. Add the line::
  60. source /etc/profile
  61. to ``~/.bashrc`` or ``~/.zshrc`` if it isn't already there.
  62. Troubleshoot
  63. ------------
  64. If the script fails, you may need to do::
  65. chmod +x install.(z)sh
  66. before the first step.
  67. Manual installation of autojump is very simple: copy
  68. - autojump to /usr/bin,
  69. - autojump.sh to /etc/profile.d,
  70. - autojump.1 to /usr/share/man/man1.
  71. Make sure to source ``/etc/profile`` in your ``.bashrc`` or ``.zshrc`` ::
  72. source /etc/profile
  73. Packaging
  74. =========
  75. For now gcarrier and I have packaged autojump for Arch Linux. It is available in [community]. To install, type::
  76. pacman -S autojump
  77. Tanguy Ortolo packaged autojump for Debian testing/unstable. It will eventually reach Ubuntu. To install, type::
  78. apt-get install autojump
  79. I would be very interested by packages for other distros. If you think you can help me with the packaging, please contact me!
  80. Uninstallation
  81. ==============
  82. To completely remove autojump you should remove these files:
  83. ``/etc/profile.d/autojump.bash``
  84. ``/etc/profile.d/autojump.sh``
  85. ``/etc/profile.d/autojump.zsh``
  86. ``/usr/bin/autojump``
  87. ``/usr/bin/jumpapplet``
  88. ``/usr/share/autojump/icon.png``
  89. ``/usr/share/autojump/``
  90. ``/usr/share/man/man1/autojump.1``
  91. Remove any mention of autojump in your ``.bashrc`` or ``.zshrc``, then in currently running shells do:``source /etc/profile``.
  92. If you keep getting ``autojump: command not found`` at the Bash prompt, do:``unset PROMPT_COMMAND``. You can also restart your shell.