Questions tagged [multiple-files]

Questions about the use of vim for handling several files at the same time.

Filter by
Sorted by
Tagged with
4
votes
2answers
345 views

Open multiple files in custom split layout

I want to open three files file1.txt file2.txt file3.txt in vertical and horizontal split combination, like this: +-------------------------------+ | | | | file1.txt | ...
17
votes
2answers
5k views

How can I run a function or macro across a folder of files?

Let's say I have a function, named StripWhitespace. I can run it on a single file by opening the file and running :StripWhitespace. How can I automatically run that function against a folder of ...
13
votes
6answers
6k views

How to open multiple files matching a wildcard expression?

I want to edit several files matching a glob expression. For example, to edit all git config files in child directories, I can do this in the shell: vim */.git/config At the Vim : command line, I ...
70
votes
2answers
22k views

Open filename under cursor like gf, but in a new tab (or split)?

The normal mode command gf go to a file with the path the cursor currently is at. But it does so in the current window, replacing the current text. That means you need to navigate back explicitly ...
12
votes
3answers
2k views

Efficient way to find & open files deep in a project tree?

Without plugins like ctrlp and NERDTree, what would be the most efficient way to find and open files deep in a project tree? Setting the path to **/* results in useless files in .git and other ...
11
votes
5answers
2k views

Navigating multiple files

If I open vim with multiple files on the command line, for example vim debug.log* which loads debug.log, debug.log.1 and debug.log.2, can I navigate between them, assign them to multiple windows (:...
18
votes
4answers
5k views

Is there a way to reliably go back and forth in file history

I would like to go to the file I just edited last and next kind of like MRU plugins do. :bnext and :bprev works sometimes, but more often than not I just end up in some obscure file I don't remember ...
7
votes
3answers
6k views

Open multiple files in tabs from Explore mode

While navigating file system in :Explore mode, is it possible to select and open multiple files, each in a new tab? Edit: I ended up using a function proposed by Jair López, because it works pretty ...
7
votes
1answer
4k views

Why vim cannot expand wildcards from the external command?

The following command works as expected within vim: :args `find . -type f` as well as this one (with wildcard): :args `find . -name \*.inc` However when I run the following: :args `find . -type f -...
6
votes
2answers
3k views

How to avoid "Avoid E173 (n more file(s) to edit)?"

So, when I open multiple files, but don't visit the all of them (or the last one), and I try to :quit neovim yells at me that I have to edit those files. No I don't! Stop giving me this error : ) It ...
6
votes
1answer
506 views

How to set manually the alternate file

Reading the documentation about alternate file, I thought I could manipulate # like a global variable, but it's not the case. I was thinking doing something like let &#='/path/to/alternate/file' ...
5
votes
2answers
2k views

Gvim how to open several files in different buffers from MS Windows explorer

On MS Windows using gVim, is it possible to select several files from the explorer and open them in the same instance of gVim in different buffers? At the moment if I select 3 different files on ...
4
votes
2answers
535 views

Open markdown filename under cursor like gf, and jump to the section?

I have the file /path/a.md which has many sections as follows: # abc this this the content of section abc # def this this the content of section abc ## defg this this the content of subsection defg ...