使用vim打开文件
Tofloor
poster avatar
mengzhuozhuo
deepin
2020-09-10 07:50
Author
我想设置vim为打开.cpp文件的默认应用
Reply Favorite View the author
All Replies
Fredoong
deepin
2020-09-10 09:02
#1
可是正宗的vim是基于文本的编辑器,必须打开某终端模拟器才有文本界面,才能启动它啊。
Reply View the author
mengzhuozhuo
deepin
2020-09-10 17:04
#2
winterfive 发表于 2020-9-10 01:02
可是正宗的vim是基于文本的编辑器,必须打开某终端模拟器才有文本界面,才能启动它啊。 ...

用Ubuntu就可以,双击文件就会自动打开终端vim
Reply View the author
Fredoong
deepin
2020-09-10 18:51
#3
https://bbs.deepin.org/post/201675
用Ubuntu就可以,双击文件就会自动打开终端vim

真的吗?我想看看截图。
Reply View the author
走钢丝
deepin
2020-09-10 19:03
#4
自己做个 desktop 放到 ~/.local/share/applications 中不就行了。
Reply View the author
mengzhuozhuo
deepin
2020-09-11 00:29
#5
winterfive 发表于 2020-9-10 10:51
真的吗?我想看看截图。

Ubuntu已经换成deepin 了
Reply View the author
mengzhuozhuo
deepin
2020-09-11 00:30
#6
lidanger 发表于 2020-9-10 11:03
自己做个 desktop 放到 ~/.local/share/applications 中不就行了。

我之前是放到桌面了,今天晚上试一下你说的这个
Reply View the author
mengzhuozhuo
deepin
2020-09-11 01:04
#7
https://bbs.deepin.org/post/201675
自己做个 desktop 放到 ~/.local/share/applications 中不就行了。

还是不行,是不是我的desktop文件写的不对啊
能帮我看一下吗
[Desktop Entry]
Type=Application
Name=Vim
GenericName=Text Editor
Icon=/home/zhuo/Pictures/icon/vim-logo.png
Exec=/usr/bin/vim %F
Terminal=true
Categories=Utility;TextEditor;


Reply View the author
走钢丝
deepin
2020-09-11 01:09
#8
https://bbs.deepin.org/post/201675
还是不行,是不是我的desktop文件写的不对啊
能帮我看一下吗
[Desktop Entry]

MimeType 呢?

不知道咋写,可以参考系统里原有的同类程序啊。比如深度编辑器,右键发送到桌面,打开参考参考。
Reply View the author
lon
deepin
2020-09-11 01:21
#9
乌班调用的是一个gui
Reply View the author
走钢丝
deepin
2020-09-11 01:37
#10
https://bbs.deepin.org/post/201675
MimeType 呢?

不知道咋写,可以参考系统里原有的同类程序啊。比如深度编辑器,右键发送到桌面,打开参 ...

刚加了 txt 和 cpp 的 mimetype 试了下是可以的。

不加其实也可以,不过设置打开方式时找起来麻烦。
Reply View the author
mengzhuozhuo
deepin
2020-09-11 03:06
#11
https://bbs.deepin.org/post/201675
MimeType 呢?

不知道咋写,可以参考系统里原有的同类程序啊。比如深度编辑器,右键发送到桌面,打开参 ...

加上这个就可以了,谢谢
Reply View the author
mengzhuozhuo
deepin
2020-09-11 03:08
#12
https://bbs.deepin.org/post/201675
真的吗?我想看看截图。

deepin也可以了

Reply View the author
Fredoong
deepin
2020-09-11 05:50
#13

怎么设置的,方法分享一下。
Reply View the author
73******01@qq.com
deepin
2020-09-11 07:03
#14
用gvim呗
Reply View the author
mengzhuozhuo
deepin
2020-09-11 07:30
#15
https://bbs.deepin.org/post/201675
怎么设置的,方法分享一下。

在.local/share/applications/ 下创建一个vim.desktop
内容为:
[Desktop Entry]
Type=Application
Name=Vim
GenericName=Text Editor
Icon=/home/zhuo/Pictures/icon/vim-logo.png    # 图标的位置
Exec=/usr/bin/vim %F
Terminal=true
Categories=Utility;TextEditor;
MimeType=text/plain;inode/directory;



Reply View the author
Feng Yu
deepin
2020-09-11 07:46
#16
装gvim就行了,右键就可以使用gvim打开
Reply View the author