diff options
author | jbjjbjjbj <julianteule@gmail.com> | 2016-12-19 15:36:16 +0100 |
---|---|---|
committer | jbjjbjjbj <julianteule@gmail.com> | 2016-12-19 15:36:16 +0100 |
commit | c66460605d1a88f68d41b8e0045ca28a5284ae98 (patch) | |
tree | 9ae0e807f5ce50bf14642b2a7f652b247e11861e | |
parent | c3b5f650a65007c31f392af1a4eb92e2d068465f (diff) |
More emacs
-rw-r--r-- | .emacs | 51 |
1 files changed, 47 insertions, 4 deletions
@@ -5,14 +5,13 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ansi-color-faces-vector - [default default default italic underline success warning error]) + [default default default italic underline success warning error]) '(ansi-color-names-vector - ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"]) + ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"]) '(custom-enabled-themes (quote (tsdh-dark))) '(global-auto-revert-mode t) - '(indent-tabs-mode nil) '(js-indent-level 2) - '(package-selected-packages (quote (neotree))) + '(package-selected-packages (quote (auto-complete neotree))) '(tab-stop-list (quote (2))) '(tab-width 2) '(xterm-mouse-mode t)) @@ -50,5 +49,49 @@ (global-unset-key "\C-z") (global-set-key "\C-z" 'advertised-undo) +(global-set-key [mouse-5] + (lambda () (interactive) (next-line 3))) + +(global-set-key [mouse-4] + (lambda () (interactive) (previous-line 3))) + + (setq-default tab-width 2) + + +;; scroll one line at a time (less "jumpy" than defaults) + + (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time + + (setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling + + (setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse + + (setq scroll-step 1) ;; keyboard scroll one line at a time + + +(defun copy-line (arg) + "Copy lines (as many as prefix argument) in the kill ring" + (interactive "p") + (kill-ring-save (line-beginning-position) + (line-beginning-position (+ 1 arg))) + (message "%d line%s copied" arg (if (= 1 arg) "" "s"))) + + +(global-set-key "\C-c\C-k" 'copy-line) + + +(defun revert-all-buffers () + "Refreshes all open buffers from their respective files" + (interactive) + (let* ((list (buffer-list)) + (buffer (car list))) + (while buffer + (when (and (buffer-file-name buffer) + (not (buffer-modified-p buffer))) + (set-buffer buffer) + (revert-buffer t t t)) + (setq list (cdr list)) + (setq buffer (car list)))) + (message "Refreshed open files")) |