-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeys.el
51 lines (40 loc) · 1.65 KB
/
keys.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;; settings related to keybindings
; use alt+F4 for closing emacs on Windows too
; in gnome/kde/mate/... it works out of the box
(global-set-key [M-f4] 'save-buffers-kill-emacs)
; ignore ctrl+win on Windows too
; combination is used on Windows for switching between virtual desktops
(global-set-key (kbd "<C-lwindow>") 'ignore)
; on Linux, apps seems to be mapped directly to M-x
(global-set-key (kbd "<apps>") 'ignore)
; https://www.emacswiki.org/emacs/CuaMode
(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) ;; Standard Windows behaviour
;; open context menu on right click
(when (display-graphic-p)
(context-menu-mode))
; use alt+arrow to switch window
(windmove-default-keybindings 'meta)
;; ctrl-+ and ctrl-- like other applications
(global-set-key (kbd "C-+") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
; Use C-, for custom key bindings
(global-set-key (kbd "C-, C-t") 'tab-new)
(global-set-key (kbd "C-, C-w") 'tab-close)
(global-set-key (kbd "C-, C-c") 'compile)
(global-set-key (kbd "C-, C-g") 'goto-line)
(global-set-key (kbd "C-, C-f") (lambda ()
(interactive)
(let (last-nonmenu-event)
(menu-find-file-existing))))
(defun fek-open-file ()
(interactive)
(let (last-nonmenu-event)
(menu-find-file-existing)))
(global-set-key (kbd "C-, C-f") 'fek-open-file)
;; ctrl-c for stopping compilation, but only when buffer has focus
(defun my-kill-compilation ()
(local-set-key (kbd "C-c C-c") 'kill-compilation))
(add-hook 'compilation-mode-hook #'my-kill-compilation)