Example:
let list = [['aen', '2'], ['ben', '3'], ['Aen', '4'], ['Ben', '5']]
sort(list, 1)
Output:
let list = [['aen', '2'], ['Aen', '4'], ['ben', '3'], ['Ben', '5']]
Expected output:
let list = [['Aen', '4'], ['aen', '2'], ['Ben', '5'], ['ben', '3']]
In python that would be easy to do but it seems not te be possible to use the python sorted() command with a vim list.
How can I sort the list as expected?
UPDATE:
Maybe a solution would be:
for i in range(0,len(list)-1)
let @b= join(list[i], "|||")
endfor
This would put all the lines in a register but how can I sort the lines in a register?
EDIT: Found a solution with the help of python (within Vim Function)
python3 << endpython
import vim
list2 = vim.eval('list')
list3 = sorted(list2, key=lambda v: (v[0].upper(), v[0].islower()))
vim.command("let list= %s"% list3)
endpython
echo list --> [['Aen', '4'], ['aen', '2'], ['Ben', '5'], ['ben', '3']]