I would like, by default, to sort in ascending order when sorting by name but descending when sorting by size and mtime (I've never ever wanted to find the smallest or oldest file, only the biggest and newest). Can this be set separately for each sort method?
You can specify sorting order in 'sort' option with + or -. In sorting dialog you can press h to toggle ordering.
Yes, but that only affects the initial sorting, right? What I'm after is a setting by which I wouldn't have to change the order every time.
To be more concrete: I mainly/only use three different sort orders:
- iname, ascending
- mtime, descending
- size, also descending.
If I switch from name to time, I will have to change the order every time, would I not?
Yes, correct. Maybe you want a command to toggle sorting instead. Based on this question:
" toggle between sorting: by name <--> by size <--> by mtime
\ :if &sort == '-size,+name'
\ | set sort=-mtime
\ | echo 'Sorted by modification date'
\ |elseif &sort == '+name'
\ | set sort=-size
\ | echo 'Sorted by size'
\ | set sort=+name
\ | echo 'Sorted by name'
nnoremap <silent> ,S :togglesort<cr>
Or you could have several mappings for each sorting that you want to use, the examples of set sort are above.