emacs.d

My Emacs configuration files.
git clone git://soucy.cc/emacs.d.git
Log | Files | Refs | README

key-bindings.el (2397B)


      1 ;;
      2 ;; CUSTOM KEY BINDINGS
      3 ;;
      4 ;; Bind Dynamic Abbreviations to C-<tab> key instead of M-/
      5 (global-set-key (kbd "C-<tab>") 'dabbrev-expand)
      6 (define-key minibuffer-local-map (kbd "C-<tab>") 'dabbrev-expand)
      7 
      8 ;; Move Current Line Up or Down
      9 (global-set-key [(control shift up)]  'move-line-up)
     10 (global-set-key [(control shift down)]  'move-line-down)
     11 
     12 ;; Adjusting interactively the font size
     13 (global-set-key (kbd "C-+") 'text-scale-increase)
     14 (global-set-key (kbd "C--") 'text-scale-decrease)
     15 
     16 ;; Duplicate a line
     17 (global-set-key (kbd "M-RET") 'duplicate-line)
     18 
     19 ;; Duplicate a line and comment the first
     20 (global-set-key (kbd "C-c y") (lambda()(interactive)(duplicate-line t)))
     21 
     22 ;; Compress a few lines into one
     23 (global-set-key (kbd "M-é") 'top-join-line)
     24 
     25 ;; Commands to navigate Brackets
     26 (global-set-key (kbd "<home>") 'backward-open-bracket)
     27 (global-set-key (kbd "<end>") 'forward-close-bracket)
     28 
     29 ;; Search file by name with dired
     30 (global-set-key (kbd "M-<f1>") 'find-name-dired)
     31 
     32 ;; Delete trailing white space or extra empty lines
     33 (global-set-key (kbd "C-x SPC") 'delete-trailing-whitespace)
     34 
     35 ;; Remap dired-up-directory
     36 (global-set-key (kbd "M-<up>") 'dired-up-directory)
     37 
     38 ;; Make CTRL-Z Undo
     39 (global-set-key (kbd "C-z") 'undo)
     40 
     41 ;; Make CTRL-S-z Redo
     42 (defalias 'redo 'undo-tree-redo)
     43 (global-set-key (kbd "C-S-z") 'redo)
     44 
     45 ;; Moving faster between windows
     46 (global-set-key (kbd "C-c <up>") 'windmove-up)
     47 (global-set-key (kbd "C-c <right>") 'windmove-right)
     48 (global-set-key (kbd "C-c <down>") 'windmove-down)
     49 (global-set-key (kbd "C-c <left>") 'windmove-left)
     50 
     51 ;; ace-window shortcuts
     52 (global-set-key (kbd "C-# d") 'ace-delete-window)
     53 (global-set-key (kbd "C-# s") 'ace-swap-window)
     54 (global-set-key (kbd "C-# M") 'ace-maximize-window)
     55 (global-set-key (kbd "C-# w") 'ace-select-window)
     56 
     57 ;; highlight-symbol key bindings
     58 (global-set-key (kbd "C-<f3>") 'highlight-symbol)
     59 (global-set-key (kbd "<f3>") 'highlight-symbol-next)
     60 (global-set-key (kbd "S-<f3>") 'highlight-symbol-prev)
     61 (global-set-key (kbd "M-<f3>") 'highlight-symbol-query-replace)
     62 
     63 ;; Org-Mode
     64 (global-set-key (kbd "C-c C-;") 'org-time-stamp-inactive)
     65 
     66 ;; On Mac OS X disable the right ALT key modification
     67 (if (eq system-type 'darwin)
     68     (setq ns-right-alternate-modifier nil)
     69 )
     70 ;; Expand region
     71 (global-set-key (kbd "C-=") 'er/expand-region)
     72 
     73 ;; Select HTML attribute value
     74 (global-set-key (kbd "C-c C-a v") 'ejemba/select-html-value)