Skip to content

Instantly share code, notes, and snippets.

@slimane
Created April 10, 2014 01:35
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 slimane/10335914 to your computer and use it in GitHub Desktop.
Save slimane/10335914 to your computer and use it in GitHub Desktop.
function! Aif(a, ope, b)
let a = a:a
let ope = a:ope
let b = a:b
execute 'return ' . a . ope . b . ' ? ' . a . ' :' . b
endfunction
function! Bigger(a, b)
return Aif(a:a, '>', a:b)
endfunction
function! Smaller(a, b)
return Aif(a:a, '<', a:b)
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment