Questions tagged [filesystem]

questions regarding searching and navigating the filesystem

Filter by
Sorted by
Tagged with
5
votes
3answers
919 views

How do I open file under cursor, when the filename has a trailing dot?

There is a file with name ./folderA/folderB/file.. And there is text: ./folderA/folderB/file.:abcdefg When I move the cursor on letter B and type <c-w>f, it says E447: Can't find file "./...
2
votes
1answer
253 views

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 ...
40
votes
2answers
32k views

What are the differences between :wq<cr> :x<cr> and ZZ when exiting vim?

Vi and Vim, as all of you know, have many synonyms. There are three ways I know of to save the file and exit Vim and Vi. These are :wq <cr>, :x <cr> and ZZ. I have heard that these are ...
5
votes
3answers
4k views

Read file from vimscript variable

I can run this snippit of code within a vimscript block: 0read /home/user/.vim/bundle/vim-lorum/lorums/lorum.js As expected, it puts the contents of "lorum.js" into the current buffer But, I need ...
7
votes
1answer
493 views

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(...
17
votes
1answer
789 views

Filename Completion for Remote Files

My friend showed me a cool trick on Emacs some days ago where he could just open a file on a remote server and I instantly thought "there should be a way to do that in vim too" and it was true. I ...
-4
votes
4answers
2k views

How to change the directory to save a file

Currently all I have to do is type vim file_name and it will make that file in the current directory (usually user because that is where the command line start at if you don't use the cd command). It ...
5
votes
2answers
1k 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
1answer
110 views

How do I get filename completion to ignore a leading `=`?

Occasionally, when writing shell scripts and such, I have entries of the form: foo=/bar/baz To get filename completion (<C-x> <C-f>) to work, I have to put a space after the =, and then ...
1
vote
1answer
113 views

netrw: have the cursor placed on previous cwd name when going up dir

In a netrw listing, when I press - key to go up a directory, I would like the cursor placed on the line corresponding to the dir I have just left (exactly how happens on some file managers, e.g. Nemo)....
2
votes
1answer
442 views

spf13-vim - Error with neosnippet plugin when editing a file

I installed spf13-vim on OS X and when I started do edit a file I get the following errors: Error detected while processing function neosnippet#init#_initialize Cannot create directory: /Users/.../....
6
votes
1answer
1k views

How do I open a file that starts with an exclamation mark using filename completion

In gvim, I want to open a file that starts with an exclamationmark, say, for example, !this_is_my_file_whose_name_is_rather_long.txt. So, I type :e !this followed by pressing the tabulator. Gvim ...
30
votes
4answers
6k views

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 ...
4
votes
1answer
72 views

What does number+enter do in Explore?

as we know that we can use Vim to browse a directory. My question is what does number + Enter do on a file list? I thought it equivalent to number + j + Enter, however, after I enter into a file, ...
10
votes
2answers
2k views

How can I make ctrlp do better filename matching?

My project has these files: $ find . -type f -and -name 'peop*' ./app/assets/stylesheets/admin/sections/people.css.sass ./app/controllers/admin/people_controller.rb As I got tired of typing :e app/...
10
votes
5answers
2k views

How do I make vim look in a set of directories for a file, if it doesn't exist in the current directory?

When I want to edit my zshrc, I just type: vim .zshrc Without specifying the full path (~/.zshrc), if I am in a different directory, this will instead start a new file. This is very annoying, since ...
4
votes
2answers
151 views

Can the path include negative entries (exceptions to a wildcard)?

Is there a way to exclude specific files and directories from Vim's path? I was hoping a syntax like this would work: set path+=./**,!./ignoredirectory,!./ignoredirectory2,!./ignorefile.txt I would ...
38
votes
5answers
20k views

How to diff and merge two directories?

I know that Vim's diff mode (vimdiff) allows us to compare the contents of two (or more) files. But it is possible to compare content of multiple files across directories in order to merge two ...
6
votes
1answer
74 views

Tab to complete filenames with :find at an arbitrary depth

Notes: I have set path=$PWD/** in my .vimrc I am using Vim 7.3 Often times, I am sitting with Vim open at the root of my project and I enter :find somef<Tab> to find and open a file at an ...
8
votes
3answers
1k views

Make :edit {file} use current directory during :Explore

I often use :Ex or :Sex to explore the filesystem from an opened file directory, or just invoke vim passing a directory to start exploring the filesystem and then opening a file. In any case, while ...
7
votes
2answers
819 views

Creating tags between markdown files similar to :h

One of the first things you learn in vimtutor is to follow links in the vim help files with Ctrl-]. I'm interested in creating my own tags/linking system in arbitrary files. For the sake of this ...
5
votes
2answers
96 views

How can I go into a directory in filename completion?

Consider a directory structure like this: topdir/ file1 file2 foo/ bar1 bar2 Say I want to open some file in foo/ in a new tab. I would first write :tabe topdir/, and then keep hitting ...
34
votes
6answers
3k views

Applying settings to a directory tree only

At my work we use a standard ts of 2; my personal preference is 4, which is what I use for my hobby projects, and this other project we inherited has the convention of ts=8. There are also some other ...
9
votes
4answers
119 views

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.

1
2