简体   繁体   English

Emacs保存缓冲区键绑定?

[英]Emacs Save Buffer Keybinding?

Is there an alternative to Cx Cs for saving in Emacs? 是否有Cx Cs的替代方案可以保存在Emacs中? My VT520 terminal uses Cs for scroll lock and gives weird behavior. 我的VT520终端使用Cs进行滚动锁定,并给出了奇怪的行为。 Alternatively can I reprogram it or reprogram the VT520 to another keybinding. 或者,我可以重新编程它还是将VT520重新编程为另一个键绑定。

you could run it manually with Mx save-buffer . 您可以使用Mx save-buffer手动运行它。 But I would try to fix your terminal, as you also miss search-forward if you don't have Cs , which is one of the preferred commands to navigate buffers among emacs users. 但是我会尝试修复您的终端,因为如果您没有Cs ,那么您也会错过search-forward ,这是在emacs用户之间导航缓冲区的首选命令之一。

I disable XON/XOFF in my .bashrc (should work for any shell, though maybe not every terminal): 我在我的.bashrc中禁用了XON / XOFF(应该对任何shell都有效,尽管可能不是每个终端都可以):

# this stops C-s from freezing the terminal
if [ "$TERM" != "dumb" ] ; then
    stty -ixon
fi

You can define your own key bindings in Emacs for any command. 您可以在Emacs中为任何命令定义自己的键绑定。 For instance, to make CTRL+x CTRL+z an additional key binding for save-buffers , put the following in your .emacs file: 例如,要将CTRL + x CTRL + z用作save-buffers的附加键绑定,请将以下内容放入.emacs文件中:

(global-set-key (kbd "C-x C-z") 'save-buffers)

Just be careful which keybindings you choose: some modes might overwrite them. 请小心选择哪种键绑定:某些模式可能会覆盖它们。

See also here for more details. 有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM