When I enter visual mode, :'<,'>sort allows me to sort alphabetically the lines I have selected, obviously starting from the left most characters on a line going to the right.Is it possible to reverse this, so I sort alphabetically with the right most characters to the left?
How to sort lines by the right most characters?
visual mode;alignment;sort
If you can use the rev command, you could reverse each line, sort and reverse again, using external commands in a pipe:%!rev | sort | revThis can be done entirely in Vimscript, but it's way more verbose:function! RTLSort() range     reversing function for use with map()    function! Rev(k, str)         the first argument from map() is an index, so it's ignored.        return join(reverse(split(a:str, '\zs')), '')    endfunction    let l:Rev = function(Rev)    let l:lines = getline(a:firstline, a:lastline)    call setline(a:firstline, map(sort(map(l:lines, l:Rev)), l:Rev))endfunctionThen, something like::%call RTLSort():3,9 call RTLSort()