An underscore/lodash-like library for Vim.
Functions implemented are listed below. See the source for more details:
- _#map() : Perform a mapping on the dictionary.
- _#max() : Return the maximum value of a list or dictionary.
- _#memoize() : Wrap a function with a memoization storage mechanism.
- _#min() : Give the minimum value of a list or dictionary.
- _#once() : Returns a function that will only execute once (per buffer/window, etc).
- _#throttle() : Returns a function that will only execute once per period of time.
- _#reduce() : Reduce a list down to one value using an arbitrary reducing function.
- _#sort() : Sort a list (supports arbitrary sort methods)
- _#sum() : Add up all the elements in a list.
- _#uniq() : Return the unique elements in a list.
Drop into your plugins folder, use vundle, or pathogen.
I used vimunit for testing. If you have it installed, you can run all the tests like so:
../vimunit/vutest.sh autoload/vus/test.vim
Vim Version 7.2+. '+python' support is also required.