File tree 4 files changed +32
-24
lines changed
4 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ The variant is updated:
45
45
46
46
However, be advised that the plugin using nvim-web-devicons may have cached the icons.
47
47
48
+ ### Case Sensitivity
49
+
50
+ Filename icons e.g. ` "Dockerfile" ` are case insensitively matched.
51
+
52
+ Extension icons e.g. ` "lua" ` are case sensitive.
53
+
48
54
### Setup
49
55
50
56
This adds all the highlight groups for the devicons
Original file line number Diff line number Diff line change @@ -353,6 +353,27 @@ local function get_highlight_ctermfg(icon_data)
353
353
return nvim_get_hl_by_name (get_highlight_name (icon_data ), false ).foreground
354
354
end
355
355
356
+ --- Change all keys in a table to lowercase
357
+ --- Remove entry when lowercase entry already exists
358
+ --- @param t table
359
+ local function lowercase_keys (t )
360
+ if not t then
361
+ return
362
+ end
363
+
364
+ for k , v in pairs (t ) do
365
+ if type (k ) == " string" then
366
+ local lower_k = k :lower ()
367
+ if lower_k ~= k then
368
+ if not t [lower_k ] then
369
+ t [lower_k ] = v
370
+ end
371
+ t [k ] = nil
372
+ end
373
+ end
374
+ end
375
+ end
376
+
356
377
local loaded = false
357
378
358
379
function M .has_loaded ()
@@ -396,6 +417,11 @@ function M.setup(opts)
396
417
local user_desktop_environment_icons = user_icons .override_by_desktop_environment
397
418
local user_window_manager_icons = user_icons .override_by_window_manager
398
419
420
+ -- filename matches are case insensitive
421
+ lowercase_keys (icons_by_filename )
422
+ lowercase_keys (user_icons .override )
423
+ lowercase_keys (user_icons .override_by_filename )
424
+
399
425
icons = vim .tbl_extend (
400
426
" force" ,
401
427
icons ,
Original file line number Diff line number Diff line change @@ -275,12 +275,6 @@ local icons_by_filename = {
275
275
cterm_color = " 28" ,
276
276
name = " Vimrc" ,
277
277
},
278
- [" R" ] = {
279
- icon = " " ,
280
- color = " #2266ba" ,
281
- cterm_color = " 25" ,
282
- name = " R" ,
283
- },
284
278
[" avif" ] = {
285
279
icon = " " ,
286
280
color = " #a074c4" ,
@@ -833,12 +827,6 @@ local icons_by_filename = {
833
827
cterm_color = " 77" ,
834
828
name = " Qt" ,
835
829
},
836
- [" r" ] = {
837
- icon = " " ,
838
- color = " #2266ba" ,
839
- cterm_color = " 25" ,
840
- name = " R" ,
841
- },
842
830
[" rakefile" ] = {
843
831
icon = " " ,
844
832
color = " #701516" ,
Original file line number Diff line number Diff line change @@ -275,12 +275,6 @@ local icons_by_filename = {
275
275
cterm_color = " 22" ,
276
276
name = " Vimrc" ,
277
277
},
278
- [" R" ] = {
279
- icon = " " ,
280
- color = " #1a4c8c" ,
281
- cterm_color = " 25" ,
282
- name = " R" ,
283
- },
284
278
[" avif" ] = {
285
279
icon = " " ,
286
280
color = " #6b4d83" ,
@@ -833,12 +827,6 @@ local icons_by_filename = {
833
827
cterm_color = " 28" ,
834
828
name = " Qt" ,
835
829
},
836
- [" r" ] = {
837
- icon = " " ,
838
- color = " #1a4c8c" ,
839
- cterm_color = " 25" ,
840
- name = " R" ,
841
- },
842
830
[" rakefile" ] = {
843
831
icon = " " ,
844
832
color = " #701516" ,
You can’t perform that action at this time.
0 commit comments