Skip to content

Instantly share code, notes, and snippets.



Forked from ftrain/.emacs
Created Feb 1, 2016
What would you like to do?
a nice .emacs for when you are on a terminal. Respects scroll wheel events. Very useful when run inside of tmux and combined with this tmuxconf:
;; .emacs
;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)
;; enable visual feedback on selections
(setq transient-mark-mode t)
;; default to better frame titles
(setq frame-title-format
(concat "%b - emacs@" (system-name)))
;; default to unified diffs
(setq diff-switches "-u")
;; always end a file with a newline
;(setq require-final-newline 'query)
;;; uncomment for CJK utf-8 support for non-Asian users
;; (require 'un-define)
(require 'xt-mouse)
(require 'mouse)
(xterm-mouse-mode t)
(defun track-mouse (e))
(setq mouse-wheel-follow-mouse 't)
(defvar alternating-scroll-down-next t)
(defvar alternating-scroll-up-next t)
(defun alternating-scroll-down-line ()
(interactive "@")
(when alternating-scroll-down-next
; (run-hook-with-args 'window-scroll-functions )
(setq alternating-scroll-down-next (not alternating-scroll-down-next)))
(defun alternating-scroll-up-line ()
(interactive "@")
(when alternating-scroll-up-next
; (run-hook-with-args 'window-scroll-functions)
(setq alternating-scroll-up-next (not alternating-scroll-up-next)))
(global-set-key (kbd "<mouse-4>") 'alternating-scroll-down-line)
(global-set-key (kbd "<mouse-5>") 'alternating-scroll-up-line)
;; Compile to JS on every save.
(add-hook 'after-save-hook
'(lambda ()
(when (string-match "\\.coffee$" buffer-file-name)
(setq package-archives '(("gnu" . "")
("marmalade" . "")
("melpa" . "")))
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment