Skip to content

Instantly share code, notes, and snippets.

@Osse
Forked from dahu/gist:0e454b3951ac843b58ae
Last active August 29, 2015 14:02
Show Gist options
  • Save Osse/360eac164e328a97c919 to your computer and use it in GitHub Desktop.
Save Osse/360eac164e328a97c919 to your computer and use it in GitHub Desktop.
function! Freqs2(list)
let freqs = {}
call map(copy(a:list), 'extend(freqs, { v:val : 0 })')
" for line in getline(1, '$')
" call map(freqs, 'v:val + ( line =~ ''\<'' . v:key . ''\>'' )')
" endfor
call map(getline(1, '$'), 'map(freqs, "v:val + (''" . v:val . "'' =~ ''\\<'' . v:key . ''\\>'' )")')
return freqs
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment