mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-29 14:36:04 +02:00
fix(common-aliases): open documents with the platform's opener (#14051)
This commit is contained in:
@@ -99,18 +99,21 @@ $ find . -type f 2>/dev/null
|
|||||||
## File extension aliases
|
## File extension aliases
|
||||||
|
|
||||||
These are special aliases that are triggered when a file name is passed as the command. For example,
|
These are special aliases that are triggered when a file name is passed as the command. For example,
|
||||||
if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf`
|
if the pdf file extension is aliased to `open_command`, running `file.pdf` opens that file with
|
||||||
that file will be open with `acroread`.
|
whatever application your system uses for PDFs.
|
||||||
|
|
||||||
### Reading Docs
|
### Reading Docs
|
||||||
|
|
||||||
| Alias | Command | Description |
|
These use `open_command`, which picks the right opener for your platform: `open` on macOS,
|
||||||
| ----- | ---------- | ---------------------------------- |
|
`xdg-open` on Linux, `cygstart` on Cygwin.
|
||||||
| pdf | `acroread` | Opens up a document using acroread |
|
|
||||||
| ps | `gv` | Opens up a .ps file using gv |
|
| Alias | Command | Description |
|
||||||
| dvi | `xdvi` | Opens up a .dvi file using xdvi |
|
| ----- | -------------- | ----------------------------------------------- |
|
||||||
| chm | `xchm` | Opens up a .chm file using xchm |
|
| pdf | `open_command` | Opens up a .pdf file in your default viewer |
|
||||||
| djvu | `djview` | Opens up a .djvu file using djview |
|
| ps | `open_command` | Opens up a .ps file in your default viewer |
|
||||||
|
| dvi | `open_command` | Opens up a .dvi file in your default viewer |
|
||||||
|
| chm | `open_command` | Opens up a .chm file in your default viewer |
|
||||||
|
| djvu | `open_command` | Opens up a .djvu file in your default viewer |
|
||||||
|
|
||||||
### Listing files inside a packed file
|
### Listing files inside a packed file
|
||||||
|
|
||||||
|
|||||||
@@ -71,12 +71,9 @@ if is-at-least 4.2.0; then
|
|||||||
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
||||||
for ft in $_media_fts; do alias -s $ft=mplayer; done
|
for ft in $_media_fts; do alias -s $ft=mplayer; done
|
||||||
|
|
||||||
#read documents
|
# read documents with the platform's default application
|
||||||
alias -s pdf=acroread
|
_doc_fts=(pdf ps dvi chm djvu)
|
||||||
alias -s ps=gv
|
for ft in $_doc_fts; do alias -s $ft=open_command; done
|
||||||
alias -s dvi=xdvi
|
|
||||||
alias -s chm=xchm
|
|
||||||
alias -s djvu=djview
|
|
||||||
|
|
||||||
#list what's inside packed file
|
#list what's inside packed file
|
||||||
alias -s zip="unzip -l"
|
alias -s zip="unzip -l"
|
||||||
|
|||||||
Reference in New Issue
Block a user