~sanchayanmaity/dotfiles

ref: ed70d5a6308bca152a9d15f749cc4ee8fa1a05b4 dotfiles/ranger/.config/ranger/devicons.py -rw-r--r-- 4.6 KiB
ed70d5a6Sanchayan Maity nvim: Update packer 11 months ago
                                                                                
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#!/usr/bin/python
# coding=UTF-8
# These glyphs, and the mapping of file extensions to glyphs
# has been copied from the vimscript code that is present in
# https://github.com/ryanoasis/vim-devicons

# all those glyphs will show as weird squares if you don't have the correct patched font
# My advice is to use NerdFonts which can be found here:
# https://github.com/ryanoasis/nerd-fonts
file_node_extensions = {
    "7z": "",
    "ai": "",
    "apk": "",
    "avi": "",
    "bat": "",
    "bmp": "",
    "bz2": "",
    "c": "",
    "c++": "",
    "cab": "",
    "cc": "",
    "clj": "",
    "cljc": "",
    "cljs": "",
    "coffee": "",
    "conf": "",
    "cp": "",
    "cpio": "",
    "cpp": "",
    "css": "",
    "cxx": "",
    "d": "",
    "dart": "",
    "db": "",
    "deb": "",
    "diff": "",
    "dump": "",
    "edn": "",
    "ejs": "",
    "epub": "",
    "erl": "",
    "f#": "",
    "fish": "",
    "flac": "",
    "flv": "",
    "fs": "",
    "fsi": "",
    "fsscript": "",
    "fsx": "",
    "gem": "",
    "gif": "",
    "go": "",
    "gz": "",
    "gzip": "",
    "hbs": "",
    "hrl": "",
    "hs": "",
    "htm": "",
    "html": "",
    "ico": "",
    "ini": "",
    "java": "",
    "jl": "",
    "jpeg": "",
    "jpg": "",
    "js": "",
    "json": "",
    "jsx": "",
    "less": "",
    "lha": "",
    "lhs": "",
    "log": "",
    "lua": "",
    "lzh": "",
    "lzma": "",
    "markdown": "",
    "md": "",
    "mkv": "",
    "ml": "λ",
    "mli": "λ",
    "mov": "",
    "mp3": "",
    "mp4": "",
    "mpeg": "",
    "mpg": "",
    "mustache": "",
    "ogg": "",
    "pdf": "",
    "php": "",
    "pl": "",
    "pm": "",
    "png": "",
    "psb": "",
    "psd": "",
    "py": "",
    "pyc": "",
    "pyd": "",
    "pyo": "",
    "rar": "",
    "rb": "",
    "rc": "",
    "rlib": "",
    "rpm": "",
    "rs": "",
    "rss": "",
    "scala": "",
    "scss": "",
    "sh": "",
    "slim": "",
    "sln": "",
    "sql": "",
    "styl": "",
    "suo": "",
    "t": "",
    "tar": "",
    "tgz": "",
    "ts": "",
    "twig": "",
    "vim": "",
    "vimrc": "",
    "wav": "",
    "xml": "",
    "xul": "",
    "xz": "",
    "yml": "",
    "zip": "",
}

dir_node_exact_matches = {
    # English
    ".git": "",
    "Desktop": "",
    "Documents": "",
    "Downloads": "",
    "Dropbox": "",
    "Music": "",
    "Pictures": "",
    "Public": "",
    "Templates": "",
    "Videos": "",
    # French
    "Bureau": "",
    "Documents": "",
    "Images": "",
    "Musique": "",
    "Publique": "",
    "Téléchargements": "",
    "Vidéos": "",
    # Portuguese
    "Documentos": "",
    "Imagens": "",
    "Modelos": "",
    "Música": "",
    "Público": "",
    "Vídeos": "",
    "Área de trabalho": "",
    # Italian
    "Documenti": "",
    "Immagini": "",
    "Modelli": "",
    "Musica": "",
    "Pubblici": "",
    "Scaricati": "",
    "Scrivania": "",
    "Video": "",
    # German
    "Bilder": "",
    "Dokumente": "",
    "Musik": "",
    "Schreibtisch": "",
    "Vorlagen": "",
    "Öffentlich": "",
}

file_node_exact_matches = {
    ".Xdefaults": "",
    ".Xresources": "",
    ".bashprofile": "",
    ".bashrc": "",
    ".dmrc": "",
    ".ds_store": "",
    ".fasd": "",
    ".gitconfig": "",
    ".gitignore": "",
    ".jack-settings": "",
    ".mime.types": "",
    ".nvidia-settings-rc": "",
    ".pam_environment": "",
    ".profile": "",
    ".recently-used": "",
    ".selected_editor": "",
    ".vimrc": "",
    ".xinputrc": "",
    "config": "",
    "dropbox": "",
    "exact-match-case-sensitive-1.txt": "X1",
    "exact-match-case-sensitive-2": "X2",
    "favicon.ico": "",
    "gruntfile.coffee": "",
    "gruntfile.js": "",
    "gruntfile.ls": "",
    "gulpfile.coffee": "",
    "gulpfile.js": "",
    "gulpfile.ls": "",
    "ini": "",
    "ledger": "",
    "license": "",
    "mimeapps.list": "",
    "node_modules": "",
    "procfile": "",
    "react.jsx": "",
    "user-dirs.dirs": "",
}


def devicon(file):
    if file.is_directory:
        return dir_node_exact_matches.get(file.relative_path, "")
    return file_node_exact_matches.get(
        file.relative_path, file_node_extensions.get(file.extension, "")
    )