Starter Kit Bindings

This is part of the Emacs Starter Kit.

Starter Kit Bindings

Key Bindings.

Align your code in a pretty way

(global-set-key (kbd "M-a") 'align-regexp)

Completion that uses many different methods to find options

(global-set-key (kbd "M-/") 'hippie-expand)

Font size

(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)

Use regex searches by default   nottangle

(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "C-r") 'isearch-backward-regexp)

File finding

(global-set-key (kbd "C-o")     'find-file)
(global-set-key (kbd "C-x r")   'recentf-ido-find-file)
(global-set-key (kbd "C-x C-r") 'recentf-ido-find-file)

Buffer handling

(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "M-r")     'revert-buffer)
(global-set-key (kbd "C-x C-k") 'kill-this-buffer)

Window switching (C-x o goes to the next window)

;;(windmove-default-keybindings) ;; Shift+direction
(global-set-key (kbd "<C-tab>") 'other-window)

Window rotation

(global-set-key (kbd "<s-tab>") 'sk-toggle-window-split)

Line operations

(global-set-key (kbd "C-l")   'goto-line)
(global-set-key (kbd "C-x ^") 'join-line)
(defun backward-kill-line (arg)
  "Kill chars backward until encountering the end of a line."
  (interactive "p")
  (kill-line 0))
(global-set-key (kbd "C-u") 'backward-kill-line)
(defun move-line-up ()
  (interactive)
  (transpose-lines 1)
  (forward-line -2))
(defun move-line-down ()
  (interactive)
  (forward-line 1)
  (transpose-lines 1)
  (forward-line -1))
(global-set-key (kbd "M-<up>")   'move-line-up)
(global-set-key (kbd "M-<down>") 'move-line-down)
(global-set-key (kbd "RET")      'reindent-then-newline-and-indent)

Activate occur easily inside isearch

(define-key isearch-mode-map (kbd "C-o")
  (lambda () (interactive)
    (let ((case-fold-search isearch-case-fold-search))
      (occur (if isearch-regexp
                 isearch-string
               (regexp-quote isearch-string))))))

Undo/redo

(defalias 'redo 'undo-tree-redo)
(global-set-key (kbd "C-z") 'undo)
(global-set-key (kbd "C-&") 'redo)

Smex

(global-set-key (kbd "M-x") 'smex)

Buffer compilation

(global-set-key (kbd "C-c c") 'compile)

Toggling fullscreen

(global-set-key [f11] 'sk-toggle-fullscreen)

Multi-term

(global-set-key (kbd "M-m") 'multi-term)
File under version control - commit 135971e - 2014-11-29