File tree 4 files changed +15
-3
lines changed
4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ require("oil").setup({
216
216
-- Sort file names in a more intuitive order for humans. Is less performant,
217
217
-- so you may want to set to false if you work with large directories.
218
218
natural_order = true ,
219
+ -- Sort file and directory names case insensitive
220
+ case_insensitive = false ,
219
221
sort = {
220
222
-- sort order can be "asc" or "desc"
221
223
-- see :help oil-columns to see which columns are sortable
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ CONFIG *oil-confi
106
106
-- Sort file names in a more intuitive order for humans. Is less performant,
107
107
-- so you may want to set to false if you work with large directories.
108
108
natural_order = true,
109
+ -- Sort file and directory names case insensitive
110
+ case_insensitive = false,
109
111
sort = {
110
112
-- sort order can be "asc" or "desc"
111
113
-- see :help oil-columns to see which columns are sortable
Original file line number Diff line number Diff line change @@ -300,11 +300,17 @@ M.register("name", {
300
300
end ,
301
301
302
302
get_sort_value = function (entry )
303
+ local sort_value = entry [FIELD_NAME ]
304
+
303
305
if config .view_options .natural_order then
304
- return entry [FIELD_NAME ]:gsub (" %d+" , pad_number )
305
- else
306
- return entry [FIELD_NAME ]
306
+ sort_value = sort_value :gsub (" %d+" , pad_number )
307
307
end
308
+
309
+ if config .view_options .case_insensitive then
310
+ sort_value = sort_value :lower ()
311
+ end
312
+
313
+ return sort_value
308
314
end ,
309
315
})
310
316
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ local default_config = {
91
91
-- Sort file names in a more intuitive order for humans. Is less performant,
92
92
-- so you may want to set to false if you work with large directories.
93
93
natural_order = true ,
94
+ -- Sort file and directory names case insensitive
95
+ case_insensitive = false ,
94
96
sort = {
95
97
-- sort order can be "asc" or "desc"
96
98
-- see :help oil-columns to see which columns are sortable
You can’t perform that action at this time.
0 commit comments