Questions tagged [list]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
4answers
248 views

How to get all distinct words within a set of lines?

I would like to extract a list of distinct words from a set of lines. Is there a way of doing this ? Say for example I have lines that look like this: [ [(isPhysicallySettledFxFwd, NO,"Y"),(...
0
votes
1answer
54 views

Are there any built-in functions to search sorted list?

Are there any built-in functions to search sorted list? Such as binary_search, lower_bound, upper_bound, etc.
1
vote
1answer
56 views

Is there a Set datatype in VimScript?

I am aware of lists and dictionaries in vim. But are sets supported in VIM to store only unique values? Or do I just have to use a dictionary with some dummy value?
2
votes
2answers
57 views

Can I substitute the value of enter/return?

I am looking to insert list items to-buy > apple > milk > but I would like to insert a constant string (" > ") on each newline is there a way to do this?
2
votes
2answers
55 views

Make Ctrl-] give a list of matches to choose from instead of taking me to the first match

When the cursor is over a word that has multiple matches according to ctags, the Ctrl-] command on one machine I use gives me a list of matches to choose from, while on another it just populates the ...
1
vote
2answers
610 views

Filter dict items using list of keys

Give the following dictionary: let mydict = {'foo': {'a': 1, 'b': 2}, 'bar': {'c': 3, 'd': 4}} And a list of keys: let myfilter = ['foo', 'asdf'] How would one do a concise "left outer join (if ...
1
vote
2answers
154 views

Using get with environment variable namespace

I want to use get with the environment variable namespace, so instead of this in the global namespace: let vim_data_dir = get(g:, 'vim_data_dir', "default value if not set") Something like this, in ...