mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 01:48:34 -07:00
common-aliases: Replace static document program associations with calls to (xdg-)open
This commit is contained in:
parent
f246f4612a
commit
b58bf31444
@ -136,12 +136,28 @@ if is-at-least 4.2.0; then
|
||||
for ft in $_media_fts; do alias -s $ft=$XMVIEWER; done
|
||||
fi
|
||||
|
||||
#read documents
|
||||
alias -s pdf=acroread
|
||||
alias -s ps=gv
|
||||
alias -s dvi=xdvi
|
||||
alias -s chm=xchm
|
||||
alias -s djvu=djview
|
||||
#open complex document formats using the system viewer
|
||||
_document_fts=(
|
||||
# Long-term storage formats
|
||||
djvu dvi fb2 epub pdf ps rtf
|
||||
# Office Binary & Office OpenXML
|
||||
doc docx docm ppt pptx pptm xls xlsx xlsm
|
||||
# OpenDocument
|
||||
odt fodt ods fods odp fodp odg fodg odf
|
||||
# Uniform Office Format
|
||||
uof uot uos uop
|
||||
# StarOffice
|
||||
sdw sxw sdc sxc sdd sci sda sxd smf sxm
|
||||
# WordPerfect
|
||||
wpd wp wp4 wp5 wp6 wp7
|
||||
# Others
|
||||
abw gnm gnumeric pages hwp
|
||||
)
|
||||
if type xdg-open >/dev/null; then
|
||||
for ft in $_document_fts; do alias -s $ft=xdg-open; done
|
||||
elif type open >/dev/null; then
|
||||
for ft in $_document_fts; do alias -s $ft=open; done
|
||||
fi
|
||||
|
||||
#list whats inside packed file
|
||||
alias -s zip="unzip -l"
|
||||
|
Loading…
Reference in New Issue
Block a user