5d6c3501663e4a2779e3c529a8940da0d16dd115

Author
Ahmad Awais <mrahmadawais@gmail.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Enhancement: Show/Hide OSX hidden files 💯 (#5275)

Diff

 1diff --git a/plugins/osx/README.md b/plugins/osx/README.md
 2index a06184a45b9090e58411b7fba1ac64956b98fee5..6de2b061eab180d4c15be5fcf27b11486d65368a 100644
 3--- a/plugins/osx/README.md
 4+++ b/plugins/osx/README.md
 5@@ -15,13 +15,15 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
 6 
 7 ## Commands
 8 
 9-| Command       | Description                                    |
10-|:--------------|:-----------------------------------------------|
11-| `tab`         | Open the current directory in a new tab        |
12-| `ofd`         | Open the current directory in a Finder window  |
13-| `pfd`         | Return the path of the frontmost Finder window |
14-| `pfs`         | Return the current Finder selection            |
15-| `cdf`         | `cd` to the current Finder directory           |
16-| `pushdf`      | `pushd` to the current Finder directory        |
17-| `quick-look`  | Quick-Look a specified file                    |
18-| `man-preview` | Open a specified man page in Preview app       |
19+| Command         | Description                                      |
20+| :-------------- | :----------------------------------------------- |
21+| `tab`           | Open the current directory in a new tab          |
22+| `ofd`           | Open the current directory in a Finder window    |
23+| `pfd`           | Return the path of the frontmost Finder window   |
24+| `pfs`           | Return the current Finder selection              |
25+| `cdf`           | `cd` to the current Finder directory             |
26+| `pushdf`        | `pushd` to the current Finder directory          |
27+| `quick-look`    | Quick-Look a specified file                      |
28+| `man-preview`   | Open a specified man page in Preview app         |
29+| `showfiles`     | Show hidden files                                |
30+| `hidefiles`     | Hide the hidden files                            |
31diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
32index 4dbc7578790bef8ad519acb4c7b42abc621427d3..f69bd7e5d5249bbdf79eff9abbc7e050a67c2607 100644
33--- a/plugins/osx/osx.plugin.zsh
34+++ b/plugins/osx/osx.plugin.zsh
35@@ -260,3 +260,7 @@ EOF
36 	esac
37 	osascript -e "tell application \"iTunes\" to $opt"
38 }
39+
40+# Show/hide hidden files in the Finder
41+alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
42+alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"