fix conflict
[dotfiles.git] / emacs.d / config / init-key-binding.el
1 ;; This  file is for some global key binding
2
3 ;;----------------------------------------------------------------------------
4 ;; super prefix binding for elscreen TAB/Windows operation
5 ;
6 (setq mac-command-modifier 'super) ; make cmd key do Meta
7
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))))
15 ;; C-c C-d
16
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)))
26
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)
32
33 (global-set-key (kbd "s-k") (lambda () (interactive)
34                               (split-window-right)
35                               (other-window 1)
36                               (ido-find-file)))
37                                 
38                               
39
40
41 ;(global-set-key (kbd "M-g M-w") 'other-window)
42
43 ;;----------------------------------------------------------------------------
44 ;; C-o prefix binding for some File/Buffer switching/openning
45 ;;
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)
55
56
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)
59
60 (global-set-key (kbd "M-g M-g") 'magit-status)
61
62
63 (defun recentf-ido-find-file ()
64   "Find a recent file using Ido."
65   (interactive)
66   (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
67     (when file
68       (find-file file))))
69
70
71 ;;----------------------------------------------------------------------------
72 ;; M-g prefix binding for some commands
73 ;;
74
75
76
77 (provide 'init-key-binding)