简体   繁体   English

在Mac上使用XQuartz打开远程服务器上安装的emacs时,将Meta更改为选项键

[英]Change Meta to option key when using XQuartz on mac to open emacs installed on remote server

My problem is like this: Firstly, I login into a remote server through ssh -Y using the Terminal.app on Mac. 我的问题是这样的:首先,我使用Mac上的Terminal.app通过ssh -Y登录远程服务器。 Then open the emacs installed on that remote server by typing 然后键入以打开该远程服务器上安装的emacs

emacs

Because of I add the option -Y when using ssh, the emacs is opened in the XQuartz installed on Mac. 因为我在使用ssh时添加选项-Y,所以emacs在Mac上安装的XQuartz中打开。

At this time, the problem comes: the option key is not treated as Meta and only the ESC key is treated as Meta. 此时,问题出现了:选项键不被视为Meta,只有ESC键被视为Meta。 But I want to use the option key as Meta. 但我想使用选项键作为Meta。

How can I solve it? 我该如何解决?

Take a look at http://www.emacswiki.org/emacs/MetaKeyProblems 请查看http://www.emacswiki.org/emacs/MetaKeyProblems

specifically this part. 特别是这一部分。

You can then run emacs from X11 windows (Applications/Utilities/X11.app) with the option/alt key as the meta key. 然后,您可以使用选项/ alt键作为元键从X11窗口(Applications / Utilities / X11.app)运行emacs。 Furthermore, you may use the xmodmap command to remap the command key to Control only under X11. 此外,您可以使用xmodmap命令将命令键重新映射到仅在X11下的Control。 This has the advantage of allowing the command key to behave expectedly with other Mac applications. 这样做的好处是允许命令键与其他Mac应用程序一起预期运行。 xmodmap can also ensure that the Alt/Option key is set to be the Meta key in emacs. xmodmap还可以确保将Alt / Option键设置为emacs中的Meta键。 You can do this with the following ~/.xmodmap file (the lines starting with exclamation points are comments and can be omitted): 您可以使用以下〜/ .xmodmap文件执行此操作(以感叹号开头的行是注释,可以省略):

! undo any meta keys already set
 clear Mod1
 ! keycodes 63 and 71 are the left and right COMMAND buttons adjacent to the spacebar; set them to be control keys
 keycode 63=Control_L
 keycode 71=Control_R
 ! keycodes 66 and 69 are the option/alt keys; assign them as Meta keys
 keycode 66=Meta_L
 keycode 69=Meta_R
 ! now tell X11 that the Meta keys act as the Mod1 (meta) modier key; that is, when they are pressed with KEY, it is the same as hitting M-KEY
 add Mod1 = Meta_L Meta_R
 ! tell X11 that the Control keys are Control modifiers, so when pressed with u (for example) it is the same as hitting C-u
 add Control = Control_L Control_R

Use the above file with the command 将以上文件与命令一起使用

xmodmap ~/.xmodmap

before starting emacs (for instance, from /etc/bashrc if you use the login shell option to xterm, ie xterm -ls in X11/Application/Customize for terminal). 在启动emacs之前(例如,如果您使用xterm的登录shell选项,则来自/ etc / bashrc,即X11中的xterm -ls /终端的Application / Customize)。

暂无
暂无

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

相关问题 psql-Mac试图连接安装在远程服务器中虚拟机中的Ubuntu系统中的postgreSQL - psql - Mac trying to connect postgreSQL in Ubuntu system installed in a virtual machine in remote server 使用 PHP 页面在远程 linux 服务器上执行安装的软件命令 - Execute an installed software command on a remote linux server using a PHP page 在远程服务器上以图形模式运行emacs - Running emacs in graphics mode on remote server 使用元移位键的快捷方式在emacs中不起作用 - Shortcut with meta-shift key doesn't work in emacs 试图将使用X11的基于Linux的开源C ++项目移植到OSX中。 我已经安装了XQuartz:现在呢? - Trying to port a linux-based open source C++ project that uses X11 into OSX. I've installed XQuartz: now what? 在远程服务器上启动 Docker 容器时用户/组权限更改 - User/group permissions change when launching Docker container on remote server 失去焦点时更改Emacs窗口外观 - Change Emacs window appearance when it loses focus 如何在不使用sudoers nopasswd选项的情况下将BASH脚本自动提升到远程服务器上的root用户? - How can a BASH script automatically elevate to root on a remote server, without using sudoers nopasswd option? 在远程计算机上运行emacs make install时出错 - Error when running emacs make install on remote machine Build, deploy and run a Flutter app for iOS from Android Studio on a Linux computer using a remote Mac with an Xcode server or an SSH server? - Build, deploy and run a Flutter app for iOS from Android Studio on a Linux computer using a remote Mac with an Xcode server or an SSH server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM