TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

So you've installed `fzf`. Now what?

24 点作者 choult3 个月前

1 comment

jasonjmcghee3 个月前
The article is a nice introduction to fzf- it, and rg are the first things I install on a new machine (after homebrew on Mac)<p>You can combine fzf with all sorts of stuff. Like git via alias for a number of super useful commands (e.g. fuzzy search the last 5 branches I&#x27;ve been on sorted by recency)<p><pre><code> recent =&gt; !f() { git reflog | egrep -io &quot;moving from ([^[:space:]]+)&quot; | awk &quot;{ print \$3 }&quot; | awk &quot; !x[\$0]++&quot; | egrep -v &quot;^[a-f0-9]{40}$&quot; | head -n${1:-5}; }; f recent-checkout =&gt; !f() { git checkout $(git recent ${1:-25} | fzf); }; f </code></pre> (I use `git recent-checkout` multiple times per day every day. The only potentially tricky thing above is the order preserving dedup which is the `awk &quot; !x[\$0]++&quot;`)<p>Every terminal user (and probably developer) should take the time to learn some bash, basic commands, piping, Ctrl+R (instead of up arrow), navigation shortcuts, rg (and regex), fzf, among others. Huge for productivity.<p>It&#x27;s honestly a relatively small amount to learn and time to experiment before the vast majority of the things you&#x27;ll want to do will be easier to write yourself than describe to an LLM.
评论 #43074927 未加载