Skip to content

Instantly share code, notes, and snippets.

@LearnWebCode
Last active June 11, 2024 04:19

Revisions

  1. LearnWebCode revised this gist Mar 7, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion f.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # Add an alias named f to your .zshrc file like this:
    # alias f="/Users/brad/Documents/shell-scripts/f.sh"

    code $(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)
    code "$(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)"

    # todo someday
    # currently it only searches for folders, but it would be nice if I could search for zshrc or specific files, but I'm not sure if that will include too many files and be slow...
  2. LearnWebCode revised this gist Mar 4, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion f.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # You need to give this file permission to execute by doingn the following...
    # You need to give this file permission to execute by doing the following...
    # chmod +x f.sh

    # Add an alias named f to your .zshrc file like this:
    @@ -7,5 +7,6 @@
    code $(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)

    # todo someday
    # currently it only searches for folders, but it would be nice if I could search for zshrc or specific files, but I'm not sure if that will include too many files and be slow...
    # If you press escape or control C and dont want to open any folder, dont feed code command an empty string, just dont run the command at all.
    # Greatly, greatly, greatly reduce the folders we're finding, perhaps only search wp-content/themes etc or make better use of -maxdepth and -mindepth etc...
  3. LearnWebCode created this gist Mar 4, 2024.
    11 changes: 11 additions & 0 deletions f.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # You need to give this file permission to execute by doingn the following...
    # chmod +x f.sh

    # Add an alias named f to your .zshrc file like this:
    # alias f="/Users/brad/Documents/shell-scripts/f.sh"

    code $(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)

    # todo someday
    # If you press escape or control C and dont want to open any folder, dont feed code command an empty string, just dont run the command at all.
    # Greatly, greatly, greatly reduce the folders we're finding, perhaps only search wp-content/themes etc or make better use of -maxdepth and -mindepth etc...