          (select-window (funcall selector)))
        (setq arg (if (plusp arg) (1- arg) (1+ arg))))))
 (define-key ctl-x-4-map (kbd "t") 'transpose-windows)
-
 ; http://www.emacswiki.org/emacs/ToggleWindowSplit
 (defun window-toggle-split-direction ()
   "Switch window split from horizontally to vertically, or vice versa.

	     '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

; Basic stuff
(menu-bar-mode -1)
(global-auto-revert-mode t)
(xterm-mouse-mode)
(setq visible-bell 1)

(ffap-bindings)

; Shortcuts
(fset 'gb 'recompile)

; Golang stuff
(defun my-go-mode-hook ()
  (add-hook 'before-save-hook 'gofmt-before-save)
  (if (not (string-match "go" compile-command))
      (set (make-local-variable 'compile-command)
	   "go build -v && go test -v && go vet"))
  (local-set-key (kbd "M-.") 'godef-jump))
(add-hook 'go-mode-hook 'my-go-mode-hook)

; http://www.emacswiki.org/emacs/TransposeWindows
(defun transpose-windows (arg)
   "Transpose the buffers shown in two windows."

    (replace-match "\\1" nil nil)))
(global-set-key (kbd "M-\\") 'delete-horizontal-space-across-lines)


;; LANGUAGE CONFIGURATION

; Callow
(add-to-list 'auto-mode-alist '("\\.clw\\'" . clojure-mode))

; Golang autocomplete
; https://github.com/nsf/gocode/tree/master/emacs-company
(require 'company)                                   ; load company mode
(require 'company-go)                                ; load company mode go backend
(setq company-tooltip-limit 20)                      ; bigger popup window
