Skip to main content
21 votes
Accepted

Includes in vimrc?

Unlike :source, :runtime doesn't need an absolute path to work. It is much better than :source for building portable setups. See :help :runtime. In the following example, we tell Vim to look for a ...
romainl's user avatar
  • 41.2k
7 votes
Accepted

What is an included file in vim?

First I did a :helpgrep included files, then went through the most promising matches until I found: From :help included-search: 6. Include file searches *include-search* *definition-search* ...
run_the_race's user avatar
6 votes

Includes in vimrc?

The answer should depend on what you want to scatter in several files. There are a few different ways to have a configuration in several files. Note: the difference between runtime and source has been ...
Luc Hermitte's user avatar
  • 17.5k
5 votes

Includes in vimrc?

@romainl's answer is the best practice. But as an additional example I have these lines in my vimrc which might interest you. I use them to source a local vimrc which I don't keep in my dotfiles ...
statox's user avatar
  • 50.1k
3 votes

Includes in vimrc?

Yes, or even just so somefile. See :help so.
user3224237's user avatar
3 votes

How to populate a drop-down list for <C-x><C-i> completion?

You could use dictionary completion to do this. Basically it completes what you type from a file (as you want). By default it is mapped to i_ctrl-x_ctrl-k and the dictionary file can be set using set ...
Octaviour's user avatar
  • 982
2 votes
Accepted

"Hard-include" in vim script

Version 8.2.935 introduced a flatten() function (and version 8.2.937 fixed a bug in that function). With this function you can also write let s:asciiart = flatten(["", "", ...
Jürgen Krämer's user avatar
2 votes
Accepted

How do I make include find more than one match per line?

Is this the usual function of include? Yes, the search for includes a) is done in one pass only, and b) only searches for one filename on each line. Is there a way to check for includes more than ...
romainl's user avatar
  • 41.2k
2 votes

"Hard-include" in vim script

If you can guarantee your original format, you can use split(system(command), ',\s\+') But CSV (as in the self-answer) is probably cleanest. Alternatively, have the outputs on their own lines and ...
D. Ben Knoble's user avatar
  • 26.6k
1 vote

How to search standard library files in languages without include expressions?

Include search is done in the current and included files. If your language doesn't let you explicitly include a file, then all Vim can do is search in the current file, which makes using include ...
romainl's user avatar
  • 41.2k
1 vote
Accepted

Includeexpr + substitute not behaving as I would expect

Vim is separating out the @ when extracting the filename. Why? Per :h gf... [Vim] uses the 'isfname' option to find out which characters are supposed to be in a file name. You can demonstrate ...
B Layer's user avatar
  • 20k
1 vote

"Hard-include" in vim script

As an alternative, you can use :h eval(). For example: let s:asciiart = eval('["", "", ' . trim(system("command args")) . ', "", ""]') Note that system() output includes extra newline(s), so you ...
Matt's user avatar
  • 20.9k
1 vote

When editing a ruby file with includes/requires how can I open the file containing the method I am on?

Use either [d or [i. :help include-search is a built-in but sadly overlooked feature.
romainl's user avatar
  • 41.2k

Only top scored, non community-wiki answers of a minimum length are eligible