This repository has been archived by the owner on Nov 19, 2019. It is now read-only.
forked from chachi/emacs-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-global-bindings.el
51 lines (43 loc) · 1.59 KB
/
my-global-bindings.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
51
;;; package --- Summary
;;; Commentary:
;;; All of the bindings for global modes (usually)
(require 'auto-complete)
(require 'auto-complete-config)
(require 'unit-test)
(require 'yasnippet)
;;; Code:
;; Typing "yes" or "no" takes too long---use "y" or "n"
(fset 'yes-or-no-p 'y-or-n-p)
;; make option key meta | C-x-C-m = M-x
(setq mac-command-modifier 'meta)
(global-set-key "\C-c\C-m" 'execute-extended-command)
(defun toggle-fullscreen (&optional f)
(interactive)
(let ((current-value (frame-parameter nil 'fullscreen)))
(set-frame-parameter nil 'fullscreen
(if (equal 'fullboth current-value)
(if (boundp 'old-fullscreen) old-fullscreen nil)
(progn (setq old-fullscreen current-value)
'fullboth)))))
;;;;;;;;;;;;;;;;
;;; Function Keys
(define-key global-map [f2] 'eshell) ;; Use multi-term, alternatively
(define-key global-map [f5] 'linum-mode)
(define-key global-map [f6] 'compile)
(define-key global-map [f7] 'recompile)
(define-key global-map [f8] 'next-error)
(define-key global-map [f9] 'run-unit-tests)
(define-key global-map [f11] 'toggle-fullscreen)
;;;;;;;;;;;;;;;;
;;; Auto-complete
;;; Note: Not set up, but would be useful
(add-to-list 'ac-dictionary-directories
"~/.emacs.d/emacs-config/plugins/auto-complete/dict/")
(ac-config-default)
(ac-set-trigger-key "TAB")
(setq ac-auto-start nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(global-set-key "\C-x\C-r" 'revert-buffer)
(provide 'my-global-bindings)
;;; my-global-bindings.el ends here