The vimscript allows list union via the +
operator, but the list subtraction doesn't come as nice as the union. Is there an easy way to filter a list by another list?
:echo [1, 2, 3] + [1, 10]
" [1, 2, 3, 1, 10]
:echo [1, 2, 3] - [1, 10]
" E730: using List as a String
" What I want: [2, 3]
I tried to write a call with filter()
and map()
but could not go very far.