Let me tell you that you can also add comments to your terminal commands and use them to search history using fzf. This might sound confusing but basically you do this:

commandwithweirdoptions --option1=value1 --option2=value2 # run the usual thing

Then you press Ctrl+R and type anything like «the thing», it uses fuzzy matching and finds the command in history, with a menu of other similar commands. Press enter, done.

Note that you need to have fzf installed, otherwise there is no fuzzy matching and no menu of matching history results.

Fonzie!
link
fedilink
113M

Seems to work with [Ctrl]+[R] as well, though of course only with exact matches.

Sure, just as I said, this would work id you don’t need menu or fuzzy matching. But I would recommend using fzf history search anyway, it’s just too good.

Fonzie!
link
fedilink
33M

M-hm, I will try it as well! I was just letting people know the comment trick works regardless, cause that’s a nice tip as well!

I’ve never understood prompt decoration like this.

How.
Does.
Punctuating.
Every.
Statement.
Increase.
Readability.

Fonzie!
link
fedilink
23M

You meant the PS1 prompt?

I just use one of the default oh-my-zsh themes that makes a clear line, so I can easily find the last line above a long output, for example when trying to read it back chronologically. With other PS1’s I often scroll over it without noticing.

@ikidd@lemmy.world
link
fedilink
English
23M

It makes my eyes bleed.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog