Skip to content

Commit

Permalink
conf-key-binding.el: 配置常用的键盘快捷键
Browse files Browse the repository at this point in the history
  • Loading branch information
mofaph committed May 28, 2012
1 parent 5b9ac8b commit 74478bd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions conf-key-binding.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
;; 分离 C-m C-i C-[,只能在图形下工作
;; 摘自 http://blog.nguyenvq.com/2011/02/24/875/
;; Translate the problematic keys to the function key Hyper
(when (eq window-system 'x)
(keyboard-translate ?\C-i ?\H-i)
(keyboard-translate ?\C-m ?\H-m)
(keyboard-translate ?\C-[ ?\H-[)
(global-set-key [?\H-m] 'set-mark-command)
(global-set-key [?\H-i] 'align))

(global-set-key (kbd "C-x C-z") 'execute-extended-command)
(global-set-key (kbd "C-x t") 'untabify)
(global-set-key (kbd "C-,") 'point-to-register)
(global-set-key (kbd "C-.") 'jump-to-register)
(global-set-key (kbd "C-\\") 'delete-trailing-whitespace)

;; 用 Ctl 加上鼠标滚轮操作来设置字体大小
(cond
((eq system-type 'gnu/linux)
(global-set-key (kbd "<C-mouse-4>") 'text-scale-increase)
(global-set-key (kbd "<C-mouse-5>") 'text-scale-decrease))
((eq system-type 'windows-nt)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)))

;;; 第三方扩展或者自定义的扩展的键绑定

;; key command file
;; =================================================
;; C-x C-\ goto-last-change init-goto-last-change
;; f11 toggle-fullscreen conf-fullscreen
;; C-x C-b ibuffer conf-ibuffer
;; C-x C-f ido-find-file conf-ido

(provide 'conf-key-binding)
1 change: 1 addition & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
(require 'conf-auto-revert)
(require 'conf-hl-line)
(require 'conf-winner)
(require 'conf-key-binding)

;; using el-get to manage all other third party packages
(require 'conf-el-get)
Expand Down

0 comments on commit 74478bd

Please sign in to comment.