Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun kill-ring-save-or-yank (&optional arg)
- "Kills region if you marked anything, yanks if you didn't"
- (interactive)
- (cond ((use-region-p)
- (call-interactively 'kill-ring-save))
- ((eq last-command 'yank)
- (call-interactively 'yank-pop))
- (t
- (call-interactively 'yank))))
- (global-set-key (kbd "M-w") 'kill-ring-save-or-yank) ;; change "M-w" to something else if you prefer it. "M-" means "Alt+", "C-" means "Ctrl+", "s-" means "Win+"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement