如何使用 vim 或 emacs 等编辑器在网络浏览器(例如 Firefox)中打开文件? [英] How to open files in web browsers (e.g Firefox) within editors like vim or emacs?

查看:24
本文介绍了如何使用 vim 或 emacs 等编辑器在网络浏览器(例如 Firefox)中打开文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 vim 或 emacs 等编辑器在浏览器(例如 Firefox)中打开文件?Notepad++ 通过按 Ctrl+Shift+Alt+X (Firefox) 在浏览器中打开文件.有没有办法在 gVim 或 Emacs 中做到这一点?

How to open files in browsers (e.g Firefox) within editors like vim or emacs? Notepad++ open files in browsers by pressing Ctrl+Shift+Alt+X (Firefox). Is there a way to do this in gVim or Emacs?

推荐答案

browse-url-of-file 是一个交互式编译的 Lisp 函数`browse-url.el'.

browse-url-of-file is an interactive compiled Lisp function in `browse-url.el'.

绑定到<HTML><在浏览器中加载这个缓冲区>, C-cC-z诉

It is bound to <menu-bar> <HTML> <Load this Buffer in Browser>, C-c C-z v.

(browse-url-of-file &optional file)

要求 WWW 浏览器显示文件.
如果文件为零或被调用,则显示当前缓冲区的文件交互地.将文件名转换为具有函数的 URLbrowse-url-file-url.使用 URL 将 URL 传递给浏览器browse-url 函数然后运行 ​​browse-url-of-file-hook.

Ask a WWW browser to display file.
Display the current buffer's file if file is nil or if called interactively. Turn the filename into a URL with function browse-url-file-url. Pass the URL to a browser using the browse-url function then run browse-url-of-file-hook.

这篇关于如何使用 vim 或 emacs 等编辑器在网络浏览器(例如 Firefox)中打开文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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