←back to thread

1901 points l2silver | 1 comments | | HN request time: 0.204s | source

Maybe you've created your own AR program for wearables that shows the definition of a word when you highlight it IRL, or you've built a personal calendar app for your family to display on a monitor in the kitchen. Whatever it is, I'd love to hear it.
Show context
bouk ◴[] No.35746740[source]
I keep all my projects and other repos that I clone under `~/src` e.g. `~/src/github.com/rails/rails` for the rails project. I then have the following fish function to navigate to a project:

  function c
    set -l directory (fd -d 5 --prune -a -H -t d -g '.git' ~/src ~/b -x dirname {} | fzf --tiebreak=length,begin,end)
    if test -n "$directory"
      and test -d $directory
      cd $directory
    end
  end
I just type 'c' and then 'rails' and I'm in the rails project. I really like diving into code and this makes it much faster.

I also have this one to clone or cd a project from github like `gc rails/rails`

  function gc --argument repo
    set -l dir $HOME/src/github.com/$repo
    if not test -d $dir
      if test -d $HOME/go/src/github.com/$repo
        set dir $HOME/go/src/github.com/$repo
      else
        mkdir -p $dir
        if not git clone "git@github.com:$repo.git" $dir
          set -l git_status $status
          rmdir $dir 2>/dev/null
          return $git_status
        end
      end
    end
    cd $dir
  end
And this function:

  function list_after_cd --on-variable PWD
    ls
  end
Runs ls every time I change directory, which you basically always want anyways
replies(1): >>35746802 #
1. satvikpendem ◴[] No.35746802[source]
Reminds me of z / zoxide / fasd, I use zoxide personally