如何从 Vim 中打开文件? [英] How do you open a file from within Vim?

查看:30
本文介绍了如何从 Vim 中打开文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何从终端 (vim fileName) 在 Vim 中打开文件.当我已经在 Vim 中时,我无法弄清楚如何打开文件.

I know how to open a file in Vim from a terminal (vim fileName). What I can't figure out is how to open a file when I'm already within Vim.

我尝试了 :r fileName,但这似乎是将文件读入(或追加)到我打开的未保存的缓冲区中.它创建了一个新文件,因为当我尝试用 :w 编写它时,它要求输入文件名.

I tried :r fileName, but that appears to read (or append) the file into the unsaved buffer I have open. It creates a new file, because when I try to write it with :w, it asks for a filename.

推荐答案

:e

:Ex <目录>

允许您从给定目录浏览文件.

lets you browse for the file from the given directory.

:Ex 自己会打开密码.

:更新

将创建一个空缓冲区.

这篇关于如何从 Vim 中打开文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆