Results 1 to 8 of 8
I have some files in some directory and some other in some other directory..
Is there a way to open files these as if all of them are present in ...
- 10-04-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 19
Directories and files in vim
I have some files in some directory and some other in some other directory..
Is there a way to open files these as if all of them are present in the same directory..
I mean say 2 files are in ~/Desktop/folder1
2 files are in home/user
i opened terminal and am in home/user
But i need to open the files from folder1 without doing cd to the folder1 directory..
- 10-04-2007 #2
Yes. Use the file's path. For instance, say you have 2 directories called "dirA" and "dirB", each with a file in them. From your root directory (in this case it's /home/) you can access either file by giving it's path:
This example uses both files from inside your home directory without having to change directories.Code:cat /dirA/file1 /dirB/file2
Registered Linux user #270181
TechieMoe's Tech Rants
- 10-04-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 19
hii
I dont want them to get printed on terminal ...
I want to open the files on after the other in vim without cding to other directory...
- 10-04-2007 #4Registered Linux user #270181
TechieMoe's Tech Rants
- 10-04-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 19
yeah
let me in home/user/folder1 in terminal ...
i want to open files in terminal(in vim) in /home/user/folder2 without changing directory in terminal..
- 10-04-2007 #6Just Joined!
- Join Date
- Sep 2007
- Posts
- 19
I am asking whether can we link files in one directory to another directory..
- 10-04-2007 #7
Ok. You can't tell vim to open the file in "/home/user/folder2/somefile"? Are you getting an error of some sort? You shouldn't have to do any weird directory changing from inside of vim.
I'm going to leave this one to someone more familiar with vim. Perhaps there's something obvious here that I'm just not seeing.Registered Linux user #270181
TechieMoe's Tech Rants
- 10-04-2007 #8Just Joined!
- Join Date
- Dec 2005
- Posts
- 96
I want to open the files on after the other in vim without cding to other directory...This will open 2 files (text.txt and text2.txt) for you in vim one after another.Code:$ vim ~/Documents/text.txt ~/Desktop/folder1/text2.txt


Reply With Quote
