bev*_*bev 19 command-line emacs
我有几个脚本可以启动与特定项目相关的所有应用程序和文件。但是,它会启动多个 emacs 实例,而不是简单地使当前的 emacs 打开请求的文件。我宁愿当前的 emacs 只是在新缓冲区中打开项目文本文件。
任何想法我怎么能做到这一点?
gee*_*aur 24
M-x server-start
在 Emacs 会话中,然后用于emacsclient -n file1 file2 ...
将文件添加到现有 Emacs。您可能还想使用其他选项,例如-c
在新窗口(框架)中打开文件。
放入(server-start)
你的.emacs
档案。
将此添加到 ~/.bashrc
alias myedit='emacsclient --alternate-editor="" --no-wait $*' #quotes intentionaly left blank
Run Code Online (Sandbox Code Playgroud)
然后myedit
用作您的编辑器。您将不得不使用该-c
选项来打开一个窗口。
所以你可以这样做:
myedit -c a-file
run-script #that uses myedit
Run Code Online (Sandbox Code Playgroud)
或者
run-script #that uses myedit
myedit -c
Run Code Online (Sandbox Code Playgroud)