Questions tagged [filesystem]

For questions regarding searching and navigating the filesystem.

Related Vim features include:

89 questions
38
votes
4 answers

How can I make Vim autoread a file while it doesn't have focus?

I'm using VIm for all kinds of things (or gVim in this case), including monitoring output written to a file; I use autoread to make Vim reread the file, which it does whenever I switch the keyboard focus to it. Is there any way to make Vim update…
falstro
  • 483
  • 4
  • 6
9
votes
1 answer

How do I open a file using `gf` in case-insensitive manner?

I want to open Test.txt file when I put the cursor on the word test.txt and type gf. Is it possible?
npcode
  • 191
  • 2
9
votes
4 answers

Can I use some file-tree selector which exists on graphical IDEs?

It is normally on the left side, and it enables a fast switching between files in a complex directory hierarchy.
peterh
  • 1,147
  • 3
  • 16
  • 35
8
votes
1 answer

Open a file at the given line using the colon notation

I'm often using grep to search for patterns and then opening the file with vim. For example I've the following result in my shell: interactions/BlockInteraction.js:38: .concat(this.prompt.postRender({}, '',…
krampstudio
  • 1,245
  • 2
  • 9
  • 7
4
votes
1 answer

Is there an elegant way to determine if a file exists in/under runtimepath?

I wonder if there is an elegant way to determine if a specific file exists in/under one of the entries of &rtp. Currently, I use the following construct: let s:found_ = 0 for s:dir_ in split(&rtp, ',') let s:file_ = s:dir_ .…
René Nyffenegger
  • 2,105
  • 20
  • 36
3
votes
3 answers

How to `cd` / explore the directory containing the current file?

Sometimes I gf to a file in a totally different directory and want to check out that new directory. Is there a way to quickly exit vim and cd into the directory containing the current buffer?
ChocolateOverflow
  • 677
  • 1
  • 6
  • 15
3
votes
1 answer

How to refresh the oldfiles list without restarting Vim?

:browse oldfiles is useful for quickly navigating to a file I've worked on recently. Sometimes though, I want to suspend vim and do some grep or ack search and find a new file that I'm interested in (let's call it sneaky.h). If I open a fresh…
Greg Nisbet
  • 1,839
  • 14
  • 27
3
votes
1 answer

How do I open the last n files I was working on in vim?

I know that the :oldfiles command will show you a history of the files you last had open; but how do I open the last n files in one command...for instance, say I want to open files 0-n in the :oldfiles list, is there a way to do that?
leeand00
  • 3,555
  • 5
  • 24
  • 40
3
votes
1 answer

gf: can I get next file that matches?

I use gf to open "filename.h" from line like: #include "filename.h" in some C\C++ file. Sometimes there is more than one "filename.h" that gf command can find in path. But gf gets me to the first file it finds - sometimes that's not what I want. Is…
2
votes
1 answer

Choose file with browser to :read into buffer

I want to :r[ead] a file into current buffer, and the file should be picked with the browser (that opens automatically e.g. when trying to :e[dit] a directory. :e ~/.vim/ opens a file browser in the ~/.vim/ directory, but :r ~/.vim/ just complains…
lindhe
  • 477
  • 4
  • 15
2
votes
1 answer

Make findfile() always return full path

While I was answering another question, I noticed an odd behaviour in the functions finddir() and findfile(). According to the help page, both of these functions will return the full path to the first match unless the match is found in a directory…
EvergreenTree
  • 8,180
  • 2
  • 37
  • 59
2
votes
0 answers

Closing the file handle while keeping buffer open

I have a workflow where I edit a .org file using jceb/vim-orgmode which is located in my iCloud directory. I then have an app on my phone which also syncs and uses the same .org file. The problem is that iCloud will only sync the file when there are…
2
votes
2 answers

Is there a quick way to open a file anywhere within a directory hierarchy?

I am working with a new old code base where virtually all the interesting source files are three levels deep in the directory hierarchy. It's about 1.3M lines of code in more than 2000 .cpp files. The project Makefile is set up so that when a…
Greg Hewgill
  • 311
  • 1
  • 8
1
vote
1 answer

How to expand if it has an @ in the path?

I'm using arch linux and nvim. Everything is up to date. I have a dir path /home/user/name@web_address.com/144_p/data-dir-2/data_structure_here gf does not open the dir structure becasue @ is present. So instead in .vimrc I tried this :nnoremap gO…
Kes
  • 663
  • 1
  • 8
  • 18
1
vote
2 answers

Allowing file bookmarks

I work with vim netranger for file management. The version I use doesn't have a bookmark feature for files. That means to be able to quickly navigate to a common files by a defined keyboard shortcut. Do you know of an external plugin that does?
eyal karni
  • 1,106
  • 9
  • 33
1
2