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: https://gist.github.com/ftrain/8443744
;; .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) | |
(xterm-mouse-mode) | |
(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 ) | |
(scroll-down-line)) | |
(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) | |
(scroll-up-line)) | |
(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) | |
(coffee-compile-file)))) | |
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") | |
("marmalade" . "http://marmalade-repo.org/packages/") | |
("melpa" . "http://melpa.milkbox.net/packages/"))) | |
(package-initialize) | |
;(elpy-enable) | |
(put 'downcase-region 'disabled nil) | |
(put 'upcase-region 'disabled nil) |
This comment has been minimized.
This comment has been minimized.
I use cua mode. With C-RET you can start a visual selection. (=cua-set-rectangle-mark) |
This comment has been minimized.
This comment has been minimized.
@louwers, do you mean for mouse-drag selection? |
This comment has been minimized.
This comment has been minimized.
Thank you, it saved my time. And how to scroll quickly if I have a file with many lines like more than 1000 lines. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Any ideas on how to get real-time visual selection feedback, which vim has?