Skip to content

Commit

Permalink
osx: add function to remove .DS_Store files (#7008)
Browse files Browse the repository at this point in the history
rmdsstore removes .DS_Store files recursively in the current directory by default, or for the given directories.
  • Loading branch information
Matthieu PETIOT authored and mcornella committed Sep 10, 2018
1 parent fe5fe81 commit d4cae83
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
33 changes: 17 additions & 16 deletions plugins/osx/README.md
Expand Up @@ -42,19 +42,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Commands

| Command | Description |
| :-------------- | :----------------------------------------------- |
| `tab` | Open the current directory in a new tab |
| `split_tab` | Split the current terminal tab horizontally |
| `vsplit_tab` | Split the current terminal tab vertically |
| `ofd` | Open the current directory in a Finder window |
| `pfd` | Return the path of the frontmost Finder window |
| `pfs` | Return the current Finder selection |
| `cdf` | `cd` to the current Finder directory |
| `pushdf` | `pushd` to the current Finder directory |
| `quick-look` | Quick-Look a specified file |
| `man-preview` | Open a specified man page in Preview app |
| `showfiles` | Show hidden files |
| `hidefiles` | Hide the hidden files |
| `itunes` | Control iTunes. User `itunes -h` for usage details |
| `spotify` | Control Spotify and search by artist, album, track and etc.|
| Command | Description |
| :-------------- | :-------------------------------------------------- |
| `tab` | Open the current directory in a new tab |
| `split_tab` | Split the current terminal tab horizontally |
| `vsplit_tab` | Split the current terminal tab vertically |
| `ofd` | Open the current directory in a Finder window |
| `pfd` | Return the path of the frontmost Finder window |
| `pfs` | Return the current Finder selection |
| `cdf` | `cd` to the current Finder directory |
| `pushdf` | `pushd` to the current Finder directory |
| `quick-look` | Quick-Look a specified file |
| `man-preview` | Open a specified man page in Preview app |
| `showfiles` | Show hidden files |
| `hidefiles` | Hide the hidden files |
| `itunes` | Control iTunes. User `itunes -h` for usage details |
| `spotify` | Control Spotify and search by artist, album, track… |
| `rmdsstore` | Remove .DS\_Store files recursively in a directory |
7 changes: 6 additions & 1 deletion plugins/osx/osx.plugin.zsh
Expand Up @@ -209,7 +209,7 @@ if [[ ! -z "$playlist" ]]; then
opt="play"
else
opt="stop"
fi
fi
else
opt="set allPlaylists to (get name of every playlist)"
fi
Expand Down Expand Up @@ -282,3 +282,8 @@ source ${ZSH}/plugins/osx/spotify
# Show/hide hidden files in the Finder
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"

# Remove .DS_Store files recursively in a directory, default .
rmdsstore() {
find "${@:-.}" -type f -name .DS_Store -delete
}

0 comments on commit d4cae83

Please sign in to comment.