Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize emacs to support ctrl+c,v,x and replace text region etc

Tags:

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.

like image 265
hookenz Avatar asked Jan 21 '23 11:01

hookenz


1 Answers

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 exists by default in emacs.

like image 164
0xAX Avatar answered Jan 30 '23 23:01

0xAX