Questions tagged [list]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

How do I put the List returned from a 'heredoc' (:h Let-HereDocs) into a Dictionary in Vim? How do I also make this work in Neovim?

In :help let-heredoc it explains that one can set a variable to a 'heredoc' where each line of the heredoc becomes an entry in a list as follows: let text =<< trim END if ok echo 'done' ...
0
votes
2answers
51 views

How to import a list?

I have a file (myWords.txt) which contains one word on each line : Word 1 Word 2 --- --- Word 3000 With this file, I create a list : function! MyFunction() let start = reltime() exe ...
-1
votes
1answer
29 views

Check items of a list

I have this list : let myList1 = ["short-term"] And I want to get this second list with my first : let myList2 = ["short", "term"] using for elem in myList1 let myList2 = [] code ??????...
1
vote
1answer
46 views

Buffer list per window

How could I get something like a buffer/argument list or a filter for individual windows, with a chosen subset of the buffers? So I could have a window just for header files in C (files ending in .h)...
5
votes
4answers
346 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
69 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
89 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
61 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
686 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
181 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 ...