我从thunar(文件管理器)用命令“vim”打开文本,就像从thunar命令“feh”打开图片一样,几乎所有应用程序都被破坏了。
不想打开xterm,cd到那个路径,如果只需双击就可以vi那个文件。
有解决方案吗?
arch + openbox + thunar + xterm
有一个更简单的解决方案: 右键单击 - >使用其他应用程序打开 - >使用自定义命令并输入“ xterm -e vim ”。
这来自我的一个QQ好友,实际上与evnu的相似。 谢谢@evnu。
I open text with command "vim" from thunar(A file manager) just as open picture with command "feh" from thunar, and almost all applications broken.
Don't want open xterm, cd to that path and vi that file if can just double-click.
Is there a solution?
arch + openbox + thunar + xterm
There is a simpler solution: right click -> open with other application -> use a custom command and input "xterm -e vim".
This from one of my QQ friends, actually similar with evnu's. Thanks @evnu.
最满意答案
你可以使用ArchLinux Wiki中描述的Xdg来做到这一点。 对于GUI应用程序,可以使用left-click -> Properties -> Open With将文件类型直接与应用程序关联。 如果要使用程序运行xterm,可以将MimeType与命令关联,如下所示:
转到~/.local/share/applications 。 在那里,添加一个文件,描述如何启动应用程序并将其另存为my-application.desktop或类似文件:
[Desktop Entry] Encoding=UTF-8 Type=Application NoDisplay=true Name=vim Exec=/usr/bin/xterm -name vim -e /usr/bin/vim MimeType=text/plain现在您必须编辑defaults.list文件。 在那里,添加要与新条目关联的MimeType的条目:
[Default Applications] text/plain=`my-application.desktop`重启后,当您单击纯文本文件时,thunar应该能够使用vim启动xterm。
You can do that using Xdg as described in the ArchLinux Wiki. For GUI applications, a filetype can be associated directly with an application by using left-click -> Properties -> Open With. If you want to run a xterm with a program, you can associate a MimeType with a command to run like this:
Go to ~/.local/share/applications. There, add a file describing how to start your application and save it as my-application.desktop or similar:
[Desktop Entry] Encoding=UTF-8 Type=Application NoDisplay=true Name=vim Exec=/usr/bin/xterm -name vim -e /usr/bin/vim MimeType=text/plainNow you have to edit the file defaults.list. There, add an entry for the MimeType you want to associate with your new entry:
[Default Applications] text/plain=`my-application.desktop`After a restart, thunar should be able to start xterm with vim when you click plain textfiles.
更多推荐
发布评论