-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrifle.conf
157 lines (132 loc) · 5.71 KB
/
rifle.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# vim: ft=cfg
# See /usr/share/doc/ranger/config/rifle.conf
#-------------------------------------------
# Explicit text
#-------------------------------------------
!mime label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php, flag t = $EDITOR -- "$@"
!mime label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php, = $PAGER -- "$@"
#--------------------------------------------
# Code
#-------------------------------------------
ext py = python -- "$1"
ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext php = php -- "$1"
#--------------------------------------------
# Jupyter notebooks
#-------------------------------------------
ext ipynb, X, flag f = jupyter lab -- "$@"
ext ipynb, flag t = nbshow -OAMD -- "$@" | $PAGER
#-------------------------------------------
# Websites
#-------------------------------------------
ext x?html?, X, flag f = firefox --new-window "$@"
#-------------------------------------------
# Others
#-------------------------------------------
ext sla, X, flag f = scribus "$@"
ext gz, name .*sla, X, flag f = scribus "$@"
ext musicxml, X, flag f = musescore -- "$@"
ext mscx, X, flag f = musescore -- "$@"
ext mscz, X, flag f = musescore -- "$@"
ext blend, X, flag f = blender -- "$@"
#-------------------------------------------
# Documents
#-------------------------------------------
ext djvu, X, flag f = zathura -- "$@"
ext djvu, X, flag f = evince -- "$@"
ext pdf, X, flag f = zathura -- "$@"
ext pdf, X, flag f = evince -- "$@"
ext pdf, X, flag f = firefox --new-window "$@"
ext pdf, X, flag f = pdfpc -- "$@"
ext pdf, X, flag f = xournalpp -- "$@"
ext xoj, X, flag f = xournalpp -- "$@"
ext xopp, X, flag f = xournalpp -- "$@"
ext od[dfgpst], X, flag f = libreoffice "$@"
ext pptx?|docx?|xlsx?|, X, flag f = libreoffice "$@"
ext sxc|xlt|xlw|gnm|gnumeric, X, flag f = libreoffice "$@"
ext csv, X, flag f = libreoffice "$@"
ext pdf, X, flag f = libreoffice "$@"
#-------------------------------------------
# Images
#-------------------------------------------
mime ^image, X, flag f = imv -- "$@"
#mime ^image, X, flag f = imv . -n "$@"
#mime ^image, X, flag f = imv .
mime ^image, X, flag f = sxiv -a -- "$@"
mime ^image, X, flag f = firefox --new-window "$@"
mime ^image, X, flag f = gimp -- "$@"
mime ^image, X, flag f = inkscape -- "$@"
ext xcf, X, flag f = gimp -- "$@"
ext pdf|eps, X, flag f = gimp -- "$@"
ext pdf|eps, X, flag f = inkscape -- "$@"
# Adobe Illustrator
ext ai, X, flag f = inkscape -- "$@"
# Google Pixel motion photos (PXL_yyyymmdd_hhmmssxxx.MP.jpg).
match .*.MP.jpg, flag f = for file in "$@"; do split-motion-photo "$file"; done
# compress JPGs
match .*.jpg, flag f = for file in "$@"; do convert -quality 65 "$file" "$file"; done
#--------------------------------------------
# Audio / Video
#-------------------------------------------
mime ^video|audio, flag t = mpv -- "$@"
ext gif, flag t = mpv -- "$@"
#mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
#mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
#mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
#mime ^video, terminal, !X, has mpv = mpv -- "$@"
#mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
#mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
#mime ^video|audio, X, flag f = vlc -- "$@"
#-------------------------------------------
# Archives
#-------------------------------------------
#ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz = als -- "$@" | $PAGER
#ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip = als -- "$@" | $PAGER
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz = aunpack -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip = aunpack -- "$@"
#-------------------------------------------
# Graphs, meshes, point clouds
#-------------------------------------------
# Graphs / networks
ext gephi, X, flag f = gephi -- "$@"
ext graphml|gml|gexf|dot|dl|gv|gdf, X, flag f = gephi -- "$@"
ext graphml|gml|dot, X, flag f = cytoscape --network "$@"
ext graphml|gml|dot, X, flag f = socnetv "$@"
ext cys, X, flag f = cytoscape --session "$@"
# Point clouds (CloudCompare better than meshlab)
ext ptx|xyz|pts|las|laz, X, flag f = CloudCompare "$@"
ext ptx|xyz, X, flag f = meshlab "$@"
# Meshes (meshlab better than blender better than CloudCompare)
ext obj|off|ply|stl|3ds|qobj|vmi|tri|asc, X, flag f = meshlab "$@"
ext obj|ply|stl, X, flag f = blender --python-expr "import bpy, sys; bpy.ops.import_scene.obj(filepath=sys.argv[-1])" -- "$@"
ext obj|off|ply|stl, X, flag f = CloudCompare "$@"
#ext obj, X, flag f = blender -- "$@"
#-------------------------------------------
# Scientific data
#-------------------------------------------
# Geographic data (QGIS project file, ESRI shapefile, ...): qgis
ext qgz, X, flag f = qgis -- "$@"
ext shp, X, flag f = qgis -- "$@"
ext kml, X, flag f = qgis -- "$@"
# Molecules and proteins
ext pdb, X, flag f = env QT_QPA_PLATFORM=xcb pymol "$@"
ext pse, X, flag f = env QT_QPA_PLATFORM=xcb pymol "$@"
# CCP4 electron density map
ext mrc, X, flag f = chimera "$@"
ext mrc, X, flag f = env QT_QPA_PLATFORM=xcb pymol "$@"
# NetCDF
ext nc, X, flag f = ncview "$@"
#-------------------------------------------
# Unknown (text or not)
#-------------------------------------------
!ext xml|json|csv|tex|py|pl|rb|js|sh|php, flag t = $EDITOR -- "$@"
label pager, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $PAGER -- "$@"
#mime ^text, flag t = $EDITOR -- "$@"
#mime ^text, label pager = $PAGER -- "$@"
# !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
name tmp*, label editor = $EDITOR -- "$@" # bulkrename
ext 1 = man "$1"
name ^[mM]akefile$ = make