Yes, correct. Maybe you want a command to toggle sorting instead. Based on this question:
" toggle between sorting: by name <--> by size <--> by mtime
command! togglesort
\ :if &sort == '-size,+name'
\ | set sort=-mtime
\ | echo 'Sorted by modification date'
\ |elseif &sort == '+name'
\ | set sort=-size
\ | echo 'Sorted by size'
\ |else
\ | set sort=+name
\ | echo 'Sorted by name'
\ |endif
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.