从vim键界开始st会失败

发布于 2025-01-19 05:57:34 字数 574 浏览 3 评论 0原文

我使用 vim 作为 LaTeX 的编辑器,并使用 bib 文件作为引文。 我想编写一个函数,用 vim 在终端中打开当前使用的 bib 文件,终端本身在 .bib 文件上运行 vim 并让我编辑它。

在 bash 脚本中,我使用行

st -t bibfile_edit_terminal_floating -e nvim $BIBFILE_PATH &

,其中 $BIBFILE_PATH 是文件的路径(这是正确且有效的) 。

当我从终端运行该行时,它会打开一个 st 作为单独的进程,并在 st 中按照我的需要在 vim 中打开文件。 如果我从 vim / nvim 调用同一行作为脚本中的命令,该命令将打开一个终端一瞬间,然后再次关闭。

我不知道发生了什么事。

如果我使用行

st -t bibfile_edit_terminal_floating -e nvim $BIBFILE_PATH (结尾处没有&符号),文件会在终端中打开,就像我想要的那样,但我无法在等待时编辑我的原始文档为了完成该过程,这不是我想要的。

请帮忙!

I am using vim as an editor for LaTeX and I use bib-files for my citations.
I want to write a function with which vim opens the currently used bib-file in a terminal which itself runs vim on the .bib-file and lets me edit it.

In the bash script I am using the line

st -t bibfile_edit_terminal_floating -e nvim $BIBFILE_PATH &

where $BIBFILE_PATH is the path of the file (which is correct and works).

When I run the line from a terminal, it opens a st as a separate process and in st opens the file in vim as I want it.
If I call the same line from vim / nvim as a command in a script, the command opens a terminal for a split second and then closes again.

I don't know what is going on.

If I use the line

st -t bibfile_edit_terminal_floating -e nvim $BIBFILE_PATH (without the ampersand at the ending), the file opens in a terminal like I want it but I cannot edit my original document as it waits for the process to finish, which is not what I want.

Please help!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文