I'm new to command line and using vim.
Suppose you’re editing a file named exampleFile.txt
using vim editor. How do you switch to another file named exampleFile2.txt
without exiting vim? What command do you use? Thanks.
Asked
Active
Viewed 165 times
0

kelp99
- 71
- 2
- 9
-
4`:e exampleFile2.txt` – jeremysprofile Jun 18 '18 at 20:42
-
1You can use `:! vi other_file` and will return to the first when finished. Be very carefully, you can go wrong: `vi a.txt` (edit) `!vi b.txt` (edit and want something from file a.txt) `vi a.txt` (edit). After `:wq` in a.txt and `:wq` in b.txt you return to an old version of `a.txt`. Saving this file will overwrite your last edits. – Walter A Jun 18 '18 at 22:07
-
See ':help hidden' and use ctrl-6 to jump back – SergioAraujo Jul 01 '18 at 19:30