TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Def – A zsh plugin for default folder behavior

5 pointsby thevinterabout 3 years ago

2 comments

JNRoweabout 3 years ago
Looks good!<p>It would be nice if there wasn&#x27;t an early exit when a matching directory is found in `def.config`. That way you could have multiple matches for a directory, and it would make simple stacking work for subdirectories too. The current behaviour makes subdirectory matches odd insofar as the behaviour is dependent on the order of entries in `def.config`.<p>A couple of <i>minor</i> notes in the spirit of helpful commentary:<p>• You&#x27;re creating a global `line` variable while reading the config, using `setopt warn_create_global` is a great built-in feature to highlight these during development.<p>• You can perform tilde expansion with `${~var}` instead of needing to run sed(see GLOB_SUBST in the zsh docs). This would also make zsh&#x27;s named directory support work in the config.<p>• There are shell constructs to remove the need for cut too: First word `${line%% *}`, other words `${line#* }`.
mathfailureabout 3 years ago
The project&#x27;s description made no sense to me.<p>And it lacks a demo of what it does.<p>I always treat such projects just as useless garbage.
评论 #31149414 未加载