如何使用 vim 或 emacs 等编辑器在网络浏览器(例如 Firefox)中打开文件? [英] How to open files in web browsers (e.g Firefox) within editors like vim or emacs?
问题描述
如何使用 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'.
绑定到
, 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屋!