Skip to content

Instantly share code, notes, and snippets.

@dsummersl
Created January 19, 2013 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsummersl/4570550 to your computer and use it in GitHub Desktop.
Save dsummersl/4570550 to your computer and use it in GitHub Desktop.
let list = ['1','10','2']
let fn = { }
function fn.compare(a,b) dict
return str2nr(a:a) < str2nr(a:b)
endfunction
return sort(a:list,fn.compare,fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment