收录日期:2020/10/23 11:13:52 时间:2010-09-07 04:10:23 标签:emacs

I used to have emacs set up the way I liked it until I lost my emacs configuration file.

How do I customize emacs so that it supports CTRL+x,c,v keys as in windows (cut, copy paste) and also when you paste, the highlighted region is replaced?

I'd also like the delete key to behave so that if a region is highlighted it will delete the region. It currently just deletes the character to the right cursor.

You can use CUA mode for CTRL+x,c,v. - http://www.emacswiki.org/emacs/CuaMode

Write in your .emacs:

(cua-mode t)
    (setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
    (transient-mark-mode 1)               ;; No region when it is not highlighted
    (setq cua-keep-region-after-copy t) 

If you use Emacs 23.1 and higher, cua by default in emacs.