-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymap.el
42 lines (35 loc) · 1.72 KB
/
keymap.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
(define-key local-function-key-map [kp-delete] [4])
(global-set-key (kbd "s-o") 'other-window)
(global-set-key (kbd "s-b") 'ido-switch-buffer)
(global-set-key (kbd "s--") 'kill-this-buffer)
(global-set-key (kbd "s-_") 'kill-buffer-and-window)
(global-set-key (kbd "s-1") 'delete-other-windows)
(global-set-key (kbd "s-2") 'split-window-vertically)
(global-set-key (kbd "s-3") 'split-window-horizontally)
(global-set-key (kbd "s-0") 'delete-window)
(global-set-key (kbd "<C-tab>") 'next-buffer)
(global-set-key (kbd "<C-S-tab>") 'previous-buffer)
(global-set-key (kbd "<C-M-backspace>") 'backward-kill-sexp)
(global-set-key (kbd "C-M-(") 'delete-pair)
(global-set-key (kbd "<s-backspace>") (lambda () (interactive) (kill-line 0)))
(global-set-key (kbd "s-T") 'projectile-find-file-in-known-projects)
(global-set-key (kbd "s-t") 'helm-projectile)
(global-set-key (kbd "s-<") 'edit-emacs-conf)
(global-set-key (kbd "C-x a r") 'align-regexp)
(global-set-key (kbd "M-[") 'align)
(defmacro allow-line-as-region-for-function (orig-function)
`(defun ,(intern (concat (symbol-name orig-function) "-or-line"))
()
,(format "Like `%s', but acts on the current line if mark is not active."
orig-function)
(interactive)
(if mark-active
(call-interactively (function ,orig-function))
(save-excursion
;; define a region (temporarily) -- so any C-u prefixes etc. are preserved. \
(beginning-of-line)
(set-mark (point))
(end-of-line)
(call-interactively (function ,orig-function))))))
(allow-line-as-region-for-function comment-or-uncomment-region)
(global-set-key [(super /)] 'comment-or-uncomment-region-or-line)