nautilus 将文件打开到新的 gvim 缓冲区中吗?

发布于 2024-08-03 14:40:34 字数 107 浏览 1 评论 0原文

有没有办法配置 nautilus 在新缓冲区中将文件打开到现有的 gvim 进程中,而不是加载新的 gvim 实例?我知道我可以将文件拖放到 gvim 中,但如果我可以双击文件来打开它,那就更方便了。

Is there a way to configure nautilus to open a file into an existing gvim process in a new buffer instead of loading a new instance of gvim? I know I can drag and drop the file into gvim, but it would be convenient if I could just double-click a file to open it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

许仙没带伞 2024-08-10 14:40:34

在终端中

cd ~/.local/share/applications
vi gvim-tab.desktop

复制粘贴此代码:

[Desktop Entry]
Encoding=UTF-8
Name=GVim Text Editor (Tabs)
Comment=Edit text files in a new tab
Exec=gvim --remote-tab %F
Terminal=false
Type=Application
Icon=/usr/share/pixmaps/vim.svg
Categories=Application;Utility;TextEditor;
StartupNotify=true
MimeType=text/plain;
NoDisplay=true

在 Nautilus 中,

Right-Click in a text file
Open With
Open with a another application
Select "GVim Text Editor (Tabs)"

已完成

In a Terminal

cd ~/.local/share/applications
vi gvim-tab.desktop

Copy Paste this code :

[Desktop Entry]
Encoding=UTF-8
Name=GVim Text Editor (Tabs)
Comment=Edit text files in a new tab
Exec=gvim --remote-tab %F
Terminal=false
Type=Application
Icon=/usr/share/pixmaps/vim.svg
Categories=Application;Utility;TextEditor;
StartupNotify=true
MimeType=text/plain;
NoDisplay=true

In Nautilus

Right-Click in a text file
Open With
Open with a another application
Select "GVim Text Editor (Tabs)"

It's done

情独悲 2024-08-10 14:40:34

您实际上只是想使用 --remote-tab-silent 选项启动 gVim。来自 手册:-

                            *--remote-tab-silent*
   --remote-tab-silent
   Like --remote-silent but open each file in a new tabpage.

也只需查看 --remote -silent 如果您不想要新选项卡并想要创建新缓冲区。

You're really just wanting to launch gVim with the --remote-tab-silent option. From the manual:-

                            *--remote-tab-silent*
   --remote-tab-silent
   Like --remote-silent but open each file in a new tabpage.

Also just check out --remote-silent if you're not wanting a new tab and want to create a new buffer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文