2013-05-05 02:06:05 -07:00
|
|
|
|
{ fetchurl, stdenv, python, bash }:
|
2009-05-26 15:05:05 -07:00
|
|
|
|
|
2015-03-21 01:50:20 -07:00
|
|
|
|
let
|
2016-11-20 12:55:03 -08:00
|
|
|
|
version = "22.5.0";
|
2013-05-05 02:06:05 -07:00
|
|
|
|
in
|
2009-05-26 15:05:05 -07:00
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
name = "autojump-${version}";
|
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2013-05-05 02:06:05 -07:00
|
|
|
|
url = "http://github.com/joelthelion/autojump/archive/release-v${version}.tar.gz";
|
2009-05-26 15:05:05 -07:00
|
|
|
|
name = "autojump-${version}.tar.gz";
|
2016-11-20 12:55:03 -08:00
|
|
|
|
sha256 = "00ai0j37ka3557a8m7ig44dby7v01pckwi8gl479vz5b5pw1z8cd";
|
2009-05-26 15:05:05 -07:00
|
|
|
|
};
|
|
|
|
|
|
2013-05-05 07:24:16 -07:00
|
|
|
|
buildInputs = [ python bash ];
|
2013-05-05 02:06:05 -07:00
|
|
|
|
dontBuild = true;
|
2009-05-26 15:05:05 -07:00
|
|
|
|
|
|
|
|
|
installPhase = ''
|
2015-03-04 08:14:49 -08:00
|
|
|
|
python ./install.py -d $out -p ""
|
2013-09-25 16:17:31 -07:00
|
|
|
|
chmod +x $out/etc/profile.d/*
|
2009-05-26 15:05:05 -07:00
|
|
|
|
|
2012-01-18 12:16:00 -08:00
|
|
|
|
mkdir -p "$out/etc/bash_completion.d"
|
2015-03-04 08:14:49 -08:00
|
|
|
|
cp -v $out/share/autojump/autojump.bash "$out/etc/bash_completion.d"
|
2009-05-26 15:05:05 -07:00
|
|
|
|
|
2016-05-04 03:06:55 -07:00
|
|
|
|
cat <<SCRIPT > $out/bin/autojump-share
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
# Run this script to find the autojump shared folder where all the shell
|
|
|
|
|
# integration scripts are living.
|
|
|
|
|
echo $out/share/autojump
|
|
|
|
|
SCRIPT
|
|
|
|
|
chmod +x $out/bin/autojump-share
|
2009-05-26 15:05:05 -07:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = {
|
2013-10-05 07:22:46 -07:00
|
|
|
|
description = "A `cd' command that learns";
|
2009-05-26 15:05:05 -07:00
|
|
|
|
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
|
2014-12-29 18:31:03 -08:00
|
|
|
|
bit before the database becomes usable. Once your database
|
2009-05-26 15:05:05 -07:00
|
|
|
|
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;
|
2013-05-05 03:46:23 -07:00
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2013-05-05 02:06:05 -07:00
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
2016-05-17 04:57:28 -07:00
|
|
|
|
maintainers = [ stdenv.lib.maintainers.domenkozar ];
|
2009-05-26 15:05:05 -07:00
|
|
|
|
};
|
|
|
|
|
}
|