←back to thread

768 points speckx | 6 comments | | HN request time: 0.616s | source | bottom
1. yipbub ◴[] No.45673860[source]
I have mkcd exactly ( I wonder how many of us do, it's so obvious)

I have almost the same, but differently named with scratch(day), copy(xc), markdown quote(blockquote), murder, waitfor, tryna, etc.

I used to use telegram-send with a custom notification sounnd a lot for notifications from long-running scripts if I walked away from the laptop.

I used to have one called timespeak that would speak the time to me every hour or half hour.

I have go_clone that clones a repo into GOPATH which I use for organising even non-go projects long after putting go projects in GOPATH stopped being needed.

I liked writing one-offs, and I don't think it's premature optimization because I kept getting faster at it.

replies(4): >>45673933 #>>45675901 #>>45677821 #>>45678272 #
2. justusthane ◴[] No.45673933[source]
Obviously that script is more convenient, but if you’re on a system where you don’t have it, you can do the following instead:

    mkdir /some/dir    
    cd !$   
    (or cd <alt+.>)
3. taejavu ◴[] No.45675901[source]
Doesn’t the built in `take` do exactly what `mkcd` does? Or is `take` a zsh/macos specific thing?

Edit: looks like it’s a zsh thing

replies(1): >>45677267 #
4. codesnik ◴[] No.45677267[source]
it's an .oh-my-zsh thing (~/.oh-my-zsh/lib/functions.zsh) but thanks, I didn't know about it.
5. linsomniac ◴[] No.45677821[source]
>I have mkcd exactly ( I wonder how many of us do, it's so obvious)

Mine is called "md" and it has "-p" on the mkdir. "mkdir -p $1 && cd $1"

6. mttpgn ◴[] No.45678272[source]
I too have a `mkcd` in my .zshrc, but I implemented it slightly differently:

  function mkcd {
    newdir=$1
    mkdir -p $newdir
    cd $newdir
  }