100 Commits
Author SHA1 Message Date
rupa 703bb54e63 avoid issues when date has been aliased
Closes #323
2023-12-09 17:38:07 -05:00
rupa 6ba07224f7 avoid issues when env has been aliased
Closes #325
2023-12-09 17:35:12 -05:00
rupa 9723bc0669 welp 2020-03-06 01:01:19 -05:00
rupa 80d82084d9 better exit codes fwiw
afaict all three of these exit lines are required 🤷
2020-03-06 00:45:45 -05:00
rupa f1f113d9ba avoid sort -g
scale the score so we can work with ints
2020-02-15 16:56:40 -05:00
rupa 4f08e7febb continuous frecency
a curve that seems to fit original behavior pretty closely.

h/t @dcervenkov
2019-10-24 01:49:52 -04:00
rupa dcd5541e7d Allow changing the max score for aging
user can set _Z_MAX_SCORE (probably not the greatest name). Closes #231
2019-10-24 01:32:02 -04:00
rupa ea5ec78343 pipe calls to _z_dirs, and a litle simplification
h/t @ericbn. Closes #217 and #196 maybe
2018-01-23 10:17:47 -05:00
rupa 2ebe419ae1 whitespace cleanup 2017-12-18 16:52:15 -05:00
rupa 0a47c9ceca dereference symlinked datafile
Closes #163
2017-07-26 19:27:33 -04:00
rupa 3eb64444d7 typo 2017-06-18 19:49:00 -04:00
rupa 1379584090 whitespace 2017-06-18 19:43:40 -04:00
rupa 7b2e8d8a50 License clarification 2017-06-18 19:42:18 -04:00
rupa 1a8efde1a7 fix typo.
Hat tip @thomassross
2017-06-18 19:38:12 -04:00
rupa 62e9cdc11d fix zsh builtin complaints
remove a uselessly clever variable substitution
2016-07-20 21:38:22 -04:00
rupa 91cbf1a326 Use builtin cd in case you've messed with it. 2016-07-20 19:57:46 -04:00
rupa 9dafe447af docs; closes #186 2016-04-23 15:30:53 -04:00
rupa cd9f1e2d96 streamline implementation of -e flag 2016-01-25 20:02:17 -05:00
rupa d0cf5282df add -e flag to echo best match only (no cd)
-l lists and does not cd, but has enough extra stuff going on to make
it a bit of a pain if you want to parse out just the best match for
your own nefarious purposes - therefore this.
h/t @synthetiv. Closes #161
2016-01-25 19:43:16 -05:00
rupa 5dc2a863cc Merge branch 'master' of github.com:rupa/z 2015-09-13 16:38:00 -04:00
rupa e12eefeeb2 use type in shell checks
shouldn't change behavior, and should be faster on load.
2015-09-13 16:35:17 -04:00
rupa d5adc9a623 Merge pull request #152 from Somasis/master
Fix special char escaping so `mawk` likes it

LTGM, thanks
2015-04-14 10:35:48 -04:00
rupa aec4df7d40 Merge pull request #148 from tomhoover/patch-1
commit c507bdd broke zsh -- this fixes it
2015-02-17 12:09:44 -05:00
rupa 588fbb917b Merge pull request #130 from notwa/quiet_shift
Prevent extraneous shifting
2015-02-14 13:42:56 -05:00
rupa c507bdd707 also ignore subdirs of _Z_EXCLUDE_DIRS 2015-02-14 13:24:04 -05:00
rupa b620b0a8af Age a bit slower. 2014-08-31 13:24:36 -04:00
rupa f0a71cae87 remove tab literal 2014-08-31 13:06:38 -04:00
rupa a830cc1cd4 Merge branch 'master' into ordered_args 2014-08-07 11:16:12 -04:00
rupa 855ca298c4 Document $_Z_OWNER 2014-08-07 11:15:51 -04:00
rupa 0e89aebce8 Merge pull request #137 from dan-bolsun/z_owner
Allow usage of z while in 'sudo -s' mode
2014-08-07 11:11:35 -04:00
rupa 4fab37850e Merge branch 'master' into ordered_args 2014-06-27 12:44:58 -04:00
rupa 56027bfa61 suppress error from tab completion when datafile not exists
h/t @juanpabloaj. Closes #136
2014-06-27 12:42:47 -04:00
rupa 0f559cd60a Merge branch 'master' into ordered_args 2014-05-28 11:12:49 -04:00
rupa 24895f3e39 Merge pull request #132 from lge88/master
use command pwd instead of pwd. h/t Ige88
2014-05-28 11:08:23 -04:00
rupa 5741d9044d Fix sed errors on OSX, without breaking ubuntu
h/t @Keithbsmiley. Closes #125
2014-02-05 18:04:38 -05:00
rupa b6faed01b8 Merge branch 'master' into ordered_args 2013-12-12 20:04:56 -05:00
rupa 575cada5e9 Different syntax for setting zsh precmd
Old versions of bash choke on the += syntax, even though it's in a chunk
of code for another shell. Closes #122 - h/t @atannen.
2013-12-12 20:01:41 -05:00
rupa dcb47814c5 Merge branch 'master' into ordered_args 2013-08-23 10:22:44 -04:00
rupa f1500aa03d Typo fix. Closes #115. 2013-08-23 10:22:07 -04:00
rupa ce00ee16b8 Don't need to do a substr cause we've removed leading space from $fnd 2013-08-18 14:20:05 -04:00
rupa 2511918400 Merge branch 'master' into ordered_args 2013-08-18 14:13:30 -04:00
rupa 2d45afcc7f Eliminate leading space from $fnd 2013-08-18 14:12:51 -04:00
rupa 0f59bdb1f3 Merge branch 'master' into ordered_args 2013-08-18 02:42:01 -04:00
rupa dde88df53f Delete a letter in man page. 2013-08-18 02:41:29 -04:00
rupa 4932acafc7 Arguments to z must be ordered.
E.g. 'z foo bar' matches /foo/bar but not /bar/foo.
2013-08-18 02:26:08 -04:00
rupa 8053deda75 Avoid duplicate precmd functions in zsh
Hat tip @knu ... closes #110
2013-07-30 10:23:34 -04:00
rupa a3b78989b2 Merge pull request #109 from uchida/fix-for-solaris10-or-earlier
redirect to /dev/null instead of '-q' option for solaris 10 or earlier
2013-07-29 11:03:06 -07:00
rupa 6de41080cb redirect to dev/null a bit more POSIXly 2013-07-07 17:48:07 -04:00
rupa a3f3874696 Merge branch 'cleanup' of github.com:rupa/z into cleanup 2013-06-25 22:59:21 -04:00
rupa 1016795b40 Merge branch 'master' into cleanup 2013-06-25 22:58:45 -04:00
rupa 748b7ef678 Merge branch 'master' into cleanup 2013-06-24 10:15:04 -04:00
rupa ea574b79df Alternate approach to appending to PROMPT_COMMAND
Seems to work well no matter what weirdness is already in
PROMPT_COMMAND.

Thanks @godlygeek. Closes #99
2013-06-23 23:13:45 -04:00
rupa c2cdaa380c comments 2013-06-20 00:43:14 -04:00
rupa 0109444865 Cleanup
Rename variables, improve comments, etc, for clarity and to better fit
my programmerly preferences.
2013-06-18 21:37:19 -04:00
rupa 66b9ab69c1 Indentation is 4 spaces.
When I was a feckless youth, I preferred single space indentation for
shell. Now in my wise old age that feels cramped. Don't even say
anything about tabs - I will slap you.
2013-06-18 20:38:28 -04:00
rupa 4d77b0815f Merge branch 'master' into prompt_command_append
Conflicts:
	z.sh
2013-06-09 23:16:45 -04:00
rupa 9e1e288375 remove mktemp dependency
Closes #103
2013-06-09 23:14:34 -04:00
rupa 9c6a7aca3e Handle empty PROMPT_COMMANDS 2013-05-27 14:41:16 -04:00
rupa 7570b48b16 Replace an echo with a redirect 2013-05-27 14:37:33 -04:00
rupa 54be46728d Append, rather than prepend to PROMPT_COMMAND 2013-05-27 14:16:38 -04:00
rupa 8aac576b7c revert warning if z.sh is being exec'd and not sourced
Because we can't reliably determine if we're really being exec'd.
2013-05-20 20:50:19 -04:00
rupa db827eec15 Throw away tmp files if mv fails
Attempt to get rid of stale temp files that occasionally drop. While
there is anecdotal evidence that this doesn't solve the problem, it
doesn't hurt, and it's the only place I can see to fix it.
2013-05-20 12:51:43 -04:00
rupa 19de191e25 Merge pull request #98 from baskerville/fix-typo
Fix a few typos
2013-05-18 07:59:26 -07:00
rupa 2ae54cd64e Regenerate README from man page
Closes #97
2013-05-18 10:54:42 -04:00
rupa 29dd032b56 Merge pull request #94 from baskerville/prune-pwd
New option: -x
2013-05-17 08:52:09 -07:00
rupa df34a871cb Warn user if z's datafile path is a directory.
Cause this means z will fill up the directory with temp files, and not
work.
2013-03-28 23:30:55 -04:00
rupa a41f9c6ea7 Merge pull request #86 from matthiasgoergens/master
Deal with spaces in $HOME when creating tempfile
2013-03-17 17:23:59 -07:00
rupa 7f2b9189a0 chmod -x z.sh 2013-03-05 17:56:37 -05:00
rupa b82dadc1a8 Be explicit that -c matches should start with cwd, not just contain it. 2013-03-03 09:47:02 -05:00
rupa 2ce7fca7af Remove extra . from man page. 2013-03-03 02:54:55 -05:00
rupa 2c2ebc2b28 update README to match man page 2013-03-03 02:51:50 -05:00
rupa 76852ebb49 Allow options to be combined e.g -clt 2013-03-03 02:49:11 -05:00
rupa f5e4ff6a26 test directly, instead of testing exit variable 2013-03-03 02:24:12 -05:00
rupa ce3330e91f Make -c without args work like regular z does 2013-03-03 01:59:26 -05:00
rupa 0f3f7a437f -c option restricts matches to subdirs of cwd.
Closes #83
2013-03-03 00:54:40 -05:00
rupa b554f71399 Use _Z_CMD in z -h 2013-03-03 00:51:32 -05:00
rupa f186800c13 Add Makefile for README 2013-02-25 01:42:05 -05:00
rupa ca5661cb39 Add warning message if z.sh is executed instead of sourced.
Closes #74
2013-02-22 15:20:08 -05:00
rupa 2bdd699beb Merge pull request #78 from ntsuji/groff_man
More groff_man-ish coding style
2013-01-22 08:30:07 -08:00
rupa 51dd0ba37f reflect aging formula changes in man page and README 2013-01-20 11:19:14 -05:00
rupa cf49435c73 Merge pull request #76 from nmeum/master
You only need one '=' character to check if something is equal. closes #75 and #76.
2013-01-20 08:11:06 -08:00
rupa b6f32ee5cd Change aging algorithm.
Aging happens when the sum of rankings passes a threshold. Raise this
threshold from 1000 to 6000.
Change aging multiplier from .9 to .99.

This formula is still pretty naive, and wants improvement, but seems to
be nicer. The previous constants tended to forget things too fast.

Closes #53, for now.
2013-01-18 19:44:28 -05:00
rupa 41a9119d38 revert an accidentally commited bit 2013-01-12 00:48:30 -05:00
rupa 61c4b1f8c0 docs
README
also removes zsh backward incompatibility warning
2013-01-12 00:45:38 -05:00
rupa 8ed575354b add exclude functionality
* Exclude dirs listed in the $_Z_EXCLUDE_DIRS array
2013-01-11 12:28:23 -05:00
rupa dfd4308ae8 ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
Fix -t flag selecting the least, rather than most, recent matching
entry. Closes #68.
2012-09-06 11:50:57 -04:00
rupa b2d48e0a68 ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
Test for compctl first, as bash will never have compctl, but zsh may
have complete, if bashcompinit was called. Since we're using this test
for prompt/precmd as well as completion, we want to run the right logic.
2012-09-03 18:07:37 -04:00
rupa 9ac0898e1b Merge pull request #62 from aeosynth/master
remove double cdargs mention
2012-09-01 13:43:36 -07:00
rupa 9bf5feb86a ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
use cool PWD functionality in zsh precmd (and avoid a subshell) at
the expense of a kind of clunky if/else. Thanks @sorin-ionescu.
2012-08-30 17:39:47 -04:00
rupa 3d896ea6c4 ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
Better documentation of zsh changes in README
2012-08-30 11:32:34 -04:00
rupa 138cf7a9ed ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
* z now handles precmd functionality for zsh, and no longer requires
  it to be set manually. However, this breaks backward compatibility
  with zsh.
  Existing users who use zsh should remove the precmd function they
  added when installing.
* z now respects _Z_NO_RESOLVE_SYMLINKS and _Z_NO_PROMPT_COMMAND
  variables under zsh.
* Documentation updated to reflect changes in installation instructions
2012-08-29 01:32:15 -04:00
rupa 175a6d9723 let shells do the quoting in completions, like they should
Dug around in bash docs until I found out how to get it to quote
metachars in tab completions like zsh does by default, so that's
nice. I knew you you could do it, bash!
2012-08-10 03:03:20 -04:00
rupa 66898d08c8 metacharacters in directory names
* quote metachars in tab completions because bash doesn't, or at least,
  I can't figure out how to tell it to yet.
* tell zsh NOT to quote metachars in tab completions because it does, by
  default. this is irritating, as i'm sure it's better than me at it.
* do the irritating metachar quoting that's been a PITA on a copy
  of the variable, so we can return the original, because gsub modifies
  in place.

TODO: if we're going to be taking over metacharacter quoting, we ought
to do it less halfhazardly
2012-08-10 02:29:55 -04:00
rupa ae7f1d1660 another fix to the stupid regex escaping.
This one works in gawk as well as mawk, and let's hope it works in the
other bazillion flavors of awk as well. :/
2012-08-09 14:48:53 -04:00
rupa 10a7cfee01 correct a bug when escaping regex characters
* "\\&" was just turning characters into literal &s, "\\\&" seems to
  work, at least on this OS/awk version.
* Added ) and ] to escaped characters.
2012-08-09 14:11:31 -04:00
rupa 144b89b4a4 Merge branch 'master' of github.com:rupa/z 2012-07-11 17:08:32 -04:00
rupa 31f9866520 Try to be clearer in installation docs 2012-07-11 17:07:54 -04:00
rupa 9162239fbd fix for gawk with regex chars in paths
Sub out regex chars in paths before comparing them. Fixes gawk and
doesn't seem to break other awks. Closes #54
2012-07-04 00:27:26 -04:00
rupa 8272e6ff7f respect _Z_NO_PROMPT_COMMAND environment variable
For those who wish to set their PROMPT_COMMAND manually. Closes #44.
2012-07-03 17:54:36 -04:00
rupa 30cbc62c10 use and document _Z_NO_RESOLVE_SYMLINKS variable 2012-06-25 11:47:46 -04:00