在emacs中移动箭头选择 [英] Shift arrow selection in emacs

查看:185
本文介绍了在emacs中移动箭头选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GNU Emacs 23.2.1

我的init.el

 (cua-模式1)
(瞬态标记模式1)
(setq shift-select-mode t)
(global-linum-mode 1)
(show-paren-mode 1)
(桌面保存模式1)

所以,而不是选择我得到2C on Shift =>,2D on Shift< =等。
如何解决?



PS

cat -v对于Shift< =

^ [[1; 2D

cat -v for Shift =>

^ [[1; 2C



如何正确地映射这些键到左移,右移对应?



PPS

抱歉。我忘了我也在使用屏幕。

  den @ playground:〜/ .emacs.den $ echo $ TERM 
screen

解决方案:

 (define -key input-decode-map\e [1; 2D[S-left])
(define-key input-decode-map\e [1; 2C[S-right])
(define-key input-decode-map\e [1; 2B[S-down])
(define-key input-decode-map\e [1; 2A
(define-key input-decode-map\e [1; 2F[S-end])
(define-key input-decode-map\ e [1; 2H[S-home])


解决方案

 (define-key input-decode-map\e [1; 2D[S-left])
(define-key input-decode-map\e [1; 2C [S-right])


I'm using GNU Emacs 23.2.1
my init.el

(cua-mode 1)               
(transient-mark-mode 1)    
(setq shift-select-mode t) 
(global-linum-mode 1)      
(show-paren-mode 1)        
(desktop-save-mode 1)      

So, instead of selection I get 2C on Shift =>, 2D on Shift <=, etc. How to solve this?

P.S.
cat -v for Shift <=
^[[1;2D
cat -v for Shift =>
^[[1;2C

How I can map properly those keys to shift-left, shift-right corresponding?

P.P.S.
Sorry. I've forgot. I'm also using screen.

den@playground:~/.emacs.den$ echo $TERM  
screen  

Solution:

(define-key input-decode-map "\e[1;2D" [S-left])  
(define-key input-decode-map "\e[1;2C" [S-right])  
(define-key input-decode-map "\e[1;2B" [S-down])  
(define-key input-decode-map "\e[1;2A" [S-up])  
(define-key input-decode-map "\e[1;2F" [S-end])  
(define-key input-decode-map "\e[1;2H" [S-home])

解决方案

This means emacs and your terminal do not agree on what the various key codes mean. there are more advanced ways to configure terminals (terminal specific files), but to get you started, try adding something like this to your emacs init file:

(define-key input-decode-map "\e[1;2D" [S-left])
(define-key input-decode-map "\e[1;2C" [S-right])

这篇关于在emacs中移动箭头选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆