有Firefox插件可使用vim编辑文本框吗?

时间:2020-03-05 18:56:49  来源:igfitidea点击:

或者"如何使用文本框内的gVim在Firefox中回答有关SO的问题?"

解决方案

回答

一种方法是使用vimperator扩展程序,它的功能远远超出期望。

回答

全部是文字!

从扩展页面:

At the bottom right corner of any edit
  box, a little edit button will appear.
  Click it. If this is the first time
  you've used "It's All Text!" then you
  will be asked to set your preferences,
  most importantly the editor.
  
  The web page will pop up in your
  selected editor. When you save it,
  it'll refresh in the web page. Wait
  for the magic yellow glow that means
  that the radiation has taken effect!

回答

也许是"全部是文本"扩展名?

http://addons.mozilla.org/zh-CN/firefox/addon/4125

回答

Vimperator使Firefox的行为与VIM非常相似:

Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor. It has similar key bindings, and you could call it a modal web browser, as key bindings differ according to which mode you are in.

将光标放在文本框中后,单击Ctrl-I在编辑器中打开,默认为gvim。

回答

全部是文字!将让我们使用所需的任何编辑器。要使用vim,需要一个小的shell脚本在终端中打开它:

#!/bin/sh
exec xterm -e /usr/bin/vim "$@"

如果我们有GVim,显然不需要外壳,脚本。

回答

ViewSourceWith是另一个值得一看的插件。它不仅支持编辑框和文本。例如,我们可以将其配置为在GIMP中打开图像。

我发现有用的另一个功能是,它可以弹出一个对话框,显示该页面上使用的所有js和css脚本。然后,我们可以选择在首选编辑器中查看/编辑文件。

为了回答关于SO的问题,我们可能还需要获取Vim Markdown语法文件。

回答

我们也可以使用ViewSourceWith插件来实现相同的目的。只需右键单击任何文本输入,我们就可以使用Vim对其进行编辑。

回答

正如其他人所说,
作为Vi /(g)Vim用户,我们可能需要查看Vimperator插件,该插件还提供我们所要求的内容:
在文本框中,单击<C-i>以启动外部编辑器。
(可以在_vimperatorrc中定义:set editor = gvim -f)

回答

在撰写本文时,它是实验性的,但jV扩展看起来不错。要引用该页面:

此扩展使所有html文本区域变成Vi [m]的精简版本。它是模态的,支持无限撤消,具有注册支持,搜索,可视模式以及各种移动和编辑命令。

回答

如果我们使用vimperator并安装了markdown语法文件,那么.vimperatorrc的有用行是:

au LocationChange .* :set editor="gvim -f"
au LocationChange stackoverflow\.com :set editor="gvim -f -c 'set ft=mkd'"

当我们在stackoverflow.com上时,这将告诉vim对markdown进行语法高亮显示,但是当我们位于任何其他站点时,则不会这样做。 Wikipedia / mediawiki等也有类似的技巧。

回答

有一种实验性方法可以使用嵌入式编辑器将真正的vim直接嵌入到firefox中,尽管它需要mozplugger并且只能在Linux上运行。

回答

在Windows(我使用Vista)中使用Vimperator时,我们可能需要双击gvim.exe的路径以将其用作外部编辑器。单次转义对我不起作用,因为Vimperator将其转义两次。例如:

:set editor="C:\\Program\ Files\ (x86)\\Vim\\vim72\\gvim.exe" -f

然后,在文本框中使用Ctrl + I,它将打开gvim进行编辑。保存并退出时,它将更新文本框。

回答

Mac用户的提示:如果要在vim中使用"全部文字",最简单的方法是使用http://code.google.com/p/macvim/。将"所有文本"指向随.app一起提供的mvim脚本(我们可以将该脚本放置在任何位置,我选择/ usr / bin /,以便可以从命令行加载mvim)