list - Compare numbers in a nested file -


example:

let list = [[23, '2'], [2, '3'], [55, '4'], [1, '5']]  

i'm trying numeric sort of list (using 1st field): list[indexnr][0]

i've found function in files:

function! mycompare(i1, i2)    return (a:i1 + 0) - (a:i2 + 0) endfunction 

how can adapt nested list let work above example?

you have give index params:

function! mycompare(i1, i2)    return a:i1[0] - a:i2[0] endfunction 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -