about summary refs log tree commit diff
path: root/pkgs/tools/misc/autojump/default.nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-05-26 22:05:05 +0000
committerLudovic Courtès <ludo@gnu.org>2009-05-26 22:05:05 +0000
commit8c2a5ccdcb17607aacc9e46c8e9b280d68440b54 (patch)
tree0d5ad705632d701bee6e8827b432d63260567021 /pkgs/tools/misc/autojump/default.nix
parentded055c896364d1f73edb1f5078dd027304a6071 (diff)
downloadnixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar.gz
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar.bz2
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar.lz
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar.xz
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.tar.zst
nixlib-8c2a5ccdcb17607aacc9e46c8e9b280d68440b54.zip
Add Autojump, a smart replacement for `cd'.
svn path=/nixpkgs/trunk/; revision=15738
Diffstat (limited to 'pkgs/tools/misc/autojump/default.nix')
-rw-r--r--pkgs/tools/misc/autojump/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/tools/misc/autojump/default.nix b/pkgs/tools/misc/autojump/default.nix
new file mode 100644
index 000000000000..ac3aa5a6b1e3
--- /dev/null
+++ b/pkgs/tools/misc/autojump/default.nix
@@ -0,0 +1,64 @@
+{ fetchurl, stdenv, python }:
+
+let version = "4"; in
+  stdenv.mkDerivation rec {
+    name = "autojump-${version}";
+
+    src = fetchurl {
+      url = "http://github.com/joelthelion/autojump/tarball/release-v4";
+      name = "autojump-${version}.tar.gz";
+      sha256 = "06hjkdmfhawi6xksangymf9z85ql8d7q0vlcmgsw45vxq7iq1fnp";
+    };
+
+    # FIXME: Appears to be broken with Bash 4.0:
+    # http://wiki.github.com/joelthelion/autojump/doesnt-seem-to-be-working-with-bash-40 .
+
+    patchPhase = ''
+      sed -i "install.sh" \
+          -e "s,/usr/,$out/,g ; s,/etc/,/nowhere/,g ; s,sudo,,g"
+    '';
+
+    buildInputs = [ python ];
+
+    installPhase = ''
+      ensureDir "$out/bin" "$out/share/man/man1"
+      yes no | sh ./install.sh
+
+      ensureDir "$out/etc/bash_completion.d"
+      cp -v autojump.bash "$out/etc/bash_completion.d"
+
+      echo "Bash users: Make sure to source \`$out/etc/bash_completion.d/autojump.bash'"
+      echo "to get the \`j' and \`jumpstat' commands."
+
+      # FIXME: What's the right place for `autojump.zsh'?
+    '';
+
+    meta = {
+      description = "Autojump, a `cd' command that learns";
+
+      longDescription = ''
+        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.
+
+        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 jstat command shows you the
+        current contents of the database.  You need to work a little
+        bit before the database becomes useable.  Once your database
+        is reasonably complete, you can “jump” to a directory by
+        typing "j dirspec", where dirspec is a few characters of the
+        directory you want to jump to.  It will jump to the most used
+        directory whose name matches the pattern given in dirspec.
+
+        Autojump supports tab-completion.
+      '';
+
+      homepage = http://wiki.github.com/joelthelion/autojump;
+
+      license = "GPLv3+";
+    };
+  }