1 ;; This file is for some global key binding
3 ;;----------------------------------------------------------------------------
4 ;; super prefix binding for elscreen TAB/Windows operation
6 (setq mac-command-modifier 'super) ; make cmd key do Meta
8 ;; super key for elscreen tabs
9 (global-set-key (kbd "<s-return>") 'toggle-frame-fullscreen)
10 (global-set-key (kbd "s-t") 'elscreen-create)
11 (global-set-key (kbd "s-n") 'elscreen-next)
12 (global-set-key (kbd "s-p") 'elscreen-previous)
13 ;;(global-set-key (kbd "s-k") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
14 ;;(global-set-key (kbd "s-d") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
17 (global-set-key (kbd "s-`") (lambda () (interactive) (elscreen-goto 0)))
18 (global-set-key (kbd "s-1") (lambda () (interactive) (elscreen-goto 1)))
19 (global-set-key (kbd "s-2") (lambda () (interactive) (elscreen-goto 2)))
20 (global-set-key (kbd "s-3") (lambda () (interactive) (elscreen-goto 3)))
21 (global-set-key (kbd "s-4") (lambda () (interactive) (elscreen-goto 4)))
22 (global-set-key (kbd "s-5") (lambda () (interactive) (elscreen-goto 5)))
23 (global-set-key (kbd "s-6") (lambda () (interactive) (elscreen-goto 6)))
24 (global-set-key (kbd "s-7") (lambda () (interactive) (elscreen-goto 7)))
25 (global-set-key (kbd "s-8") (lambda () (interactive) (elscreen-goto 8)))
27 ;; super key for windows
28 (global-set-key (kbd "s-l") 'split-window-below)
29 (global-set-key (kbd "s-h") 'split-window-right)
30 (global-set-key (kbd "s-i") 'other-window)
31 (global-set-key (kbd "s-j") 'delete-other-windows)
33 (global-set-key (kbd "s-k") (lambda () (interactive)
41 ;(global-set-key (kbd "M-g M-w") 'other-window)
43 ;;----------------------------------------------------------------------------
44 ;; C-o prefix binding for some File/Buffer switching/openning
46 (global-unset-key "\C-o")
47 ;;(global-set-key (kbd "C-o C-o") 'keyboard-quit);; same as C-g to quit
48 ;;; c-o c-o swith to normal mode
49 (global-set-key (kbd "C-o C-o") 'evil-normal-state)
50 ;;(global-set-key (kbd "C-o C-o") 'fiplr-find-file)
51 (global-set-key (kbd "C-o C-f") 'ido-find-file)
52 (global-set-key (kbd "C-o C-n") 'recentf-ido-find-file)
53 (global-set-key (kbd "C-o C-j") 'ido-switch-buffer)
54 ;(global-set-key (kbd "C-o C-j") 'ido-find-file)
57 (global-set-key (kbd "C-o C-g") 'ggtags-find-file)
58 (global-set-key (kbd "C-o C-t") 'ggtags-find-tag-dwim)
60 (global-set-key (kbd "M-g M-g") 'magit-status)
63 (defun recentf-ido-find-file ()
64 "Find a recent file using Ido."
66 (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
71 ;;----------------------------------------------------------------------------
72 ;; M-g prefix binding for some commands
77 (provide 'init-key-binding)