This repository has been archived by the owner on Nov 19, 2019. It is now read-only.
forked from chachi/emacs-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-moving.el
74 lines (67 loc) · 2.49 KB
/
my-moving.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;;; package --- Summary
;;; Commentary:
;;; Moving around files and buffers
(require 'uniquify)
(require 'workgroups)
;;; Code:
;;;;;;;;;;;;;;;;
;;; Window Movement
(global-set-key "\C-xa" 'windmove-left)
(global-set-key "\C-xs" 'windmove-down)
(global-set-key "\C-xw" 'windmove-up)
(global-set-key "\C-xd" 'windmove-right)
(global-set-key (kbd "M-<left>") 'windmove-left)
(global-set-key (kbd "M-<down>") 'windmove-down)
(global-set-key (kbd "M-<up>") 'windmove-up)
(global-set-key (kbd "M-<right>") 'windmove-right)
(defun move-cursor-next-pane ()
"Move cursor to the next pane."
(interactive)
(other-window 1))
(defun move-cursor-previous-pane ()
"Move cursor to the previous pane."
(interactive)
(other-window -1))
;;; Just like in Chrome! Woo
(global-set-key (kbd "<C-S-iso-lefttab>") 'move-cursor-previous-pane)
(global-set-key (kbd "<C-tab>") 'move-cursor-next-pane)
;;; Save your windows, if you want
(workgroups-mode 1)
(setq wg-prefix-key (kbd "C-z"))
(setq uniquify-buffer-name-style 'forward)
;;;;;;;;;;;;;;;;
;;; Frame Movement
;; Put scroll bar on the right side
(set-scroll-bar-mode 'right)
(set-scroll-bar-mode nil)
;; Remove graphical toolbar (if version 21 or higher)
(tool-bar-mode 0)
;; don't show tooltips
(tooltip-mode 0)
;; use mouse wheel to scroll
(mouse-wheel-mode t)
;; Scroll one line at a time
(setq scroll-step 1)
;; Default: scroll with middle, page-up with left click, page down with right
;; Scroll with left mouse button
;; This only works with the plain scroll bar, not the Xaw3d variety
(global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
;; Page down with middle button
(global-set-key [vertical-scroll-bar mouse-2] 'scroll-bar-scroll-up)
(global-set-key [vertical-scroll-bar drag-mouse-2] 'scroll-bar-scroll-up)
(global-unset-key [vertical-scroll-bar down-mouse-2])
;; Page up with right button
(global-set-key [vertical-scroll-bar mouse-3] 'scroll-bar-scroll-down)
(global-set-key [vertical-scroll-bar drag-mouse-3] 'scroll-bar-scroll-down)
(global-set-key [?\C-,] (lambda () (interactive) (scroll-up 1)))
(global-set-key [?\C-.] (lambda () (interactive) (scroll-down 1)))
(global-set-key [end] 'end-of-buffer)
(global-set-key [home] 'beginning-of-buffer)
(global-set-key [C-right] 'forward-word)
(global-set-key [C-left] 'backward-word)
;; Scroll faster, colors won't appear correctly right away
(setq lazy-lock-defer-on-scrolling t)
(setq lazy-lock-continuity-time 0.3)
;; Don't insert new lines when scrolling
(setq next-line-add-newlines nil)
(provide 'my-moving)