Live data from Hacker News

Show HN: Redo – Command line utility for quickly creating shell functions

github.com

1–10 of 32 posts

Re: Show HN: Redo – Command line utility for quickly creating shell functions

#4
post #2

This looks very cool. I use shell aliases heavily on all my devices and try to avoid typing out the same one-liners more than once or twice when possible.

Thank you! Currently the software is very much alpha, so some bugs are expected. I also use shell aliases a lot, though redo is currently not creating aliases but shell functions. In the future I want to add support for creating actual aliases as well instead of shell functions. A simple solution would be to not create a function but an actual alias and chain the commands with &&, this would work but then you lose the power to edit the function and for example have arguments to some commands and not to others.

Re: Show HN: Redo – Command line utility for quickly creating shell functions

#7
Currently, I'll append a comment to a frequently used command for easy searching from my history. For a simple example, I can access `git diff -w ; git diff -w --cached # gitdiff` by pressing Ctrl+R and typing `# gitd`.

For commands I use frequently or that are clunky to maintain as one-liners, I'll convert them into functions in my bashrc.

This seems like the best of both worlds in many ways, or at least is a great third option to have.

Re: Show HN: Redo – Command line utility for quickly creating shell functions

#8
post #7

Currently, I'll append a comment to a frequently used command for easy searching from my history. For a simple example, I can access `git diff -w ; git diff -w --cached # gitdiff` by pressing Ctrl+R and typing `# gitd`. For commands I use frequently or that are clunky to maintain as one-liners, I'll convert them into functions in my bashrc. This seems like the best of both worlds in many ways, or at least is a great…

Interesting way of aliasing right from where you use it! I actually replaced my default shell history search with fuzzy search using (https://github.com/junegunn/fzf), I can highly recommend it!

Re: Show HN: Redo – Command line utility for quickly creating shell functions

#9
post #7

Currently, I'll append a comment to a frequently used command for easy searching from my history. For a simple example, I can access `git diff -w ; git diff -w --cached # gitdiff` by pressing Ctrl+R and typing `# gitd`. For commands I use frequently or that are clunky to maintain as one-liners, I'll convert them into functions in my bashrc. This seems like the best of both worlds in many ways, or at least is a great…

Interesting way of aliasing right from where you use it! I actually replaced my default shell history search with fuzzy search using ( https://github.com/junegunn/fzf ), I can highly recommend it!

Huh, apparently I've already starred that. It must have been posted on HN at some point.

Re: Show HN: Redo – Command line utility for quickly creating shell functions

#10
post #7

Currently, I'll append a comment to a frequently used command for easy searching from my history. For a simple example, I can access `git diff -w ; git diff -w --cached # gitdiff` by pressing Ctrl+R and typing `# gitd`. For commands I use frequently or that are clunky to maintain as one-liners, I'll convert them into functions in my bashrc. This seems like the best of both worlds in many ways, or at least is a great…

Interesting, I think there’s a shopt that I’m missing. When I append a comment, it’s not recorded in bash history, as I’d expect.
Post reply on HN