diff options
| -rw-r--r-- | init.el | 106 |
1 files changed, 106 insertions, 0 deletions
| @@ -59,6 +59,112 @@ | |||
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | ;; --------------------------------------------------------------------- | 61 | ;; --------------------------------------------------------------------- |
| 62 | ;;; Text Editor | ||
| 63 | ;; ------------ | ||
| 64 | ;; These tweaks are meant to make the text editor more convenient. | ||
| 65 | ;; --------------------------------------------------------------------- | ||
| 66 | |||
| 67 | ;; --------------------------------- | ||
| 68 | ;; Line and column numbers | ||
| 69 | ;; ----------------------- | ||
| 70 | ;; It helps to know where you are | ||
| 71 | ;; --------------------------------- | ||
| 72 | |||
| 73 | (column-number-mode) | ||
| 74 | (global-display-line-numbers-mode t) | ||
| 75 | |||
| 76 | |||
| 77 | ;; --------------------------------- | ||
| 78 | ;; Highlight stuff | ||
| 79 | ;; --------------- | ||
| 80 | ;; Sometimes it's hard to find | ||
| 81 | ;; things. Highlighting makes it a | ||
| 82 | ;; little easier. | ||
| 83 | ;; --------------------------------- | ||
| 84 | |||
| 85 | ;; Highlight current line | ||
| 86 | (when window-system (add-hook 'prog-mode-hook 'hl-line-mode)) | ||
| 87 | |||
| 88 | |||
| 89 | ;; --------------------------------- | ||
| 90 | ;; Scrolling | ||
| 91 | ;; --------- | ||
| 92 | ;; This makes the scrolling behavior | ||
| 93 | ;; smoother and easier to follow. | ||
| 94 | ;; --------------------------------- | ||
| 95 | |||
| 96 | ;; Small scroll margin makes it | ||
| 97 | ;; easier to see when to stop when | ||
| 98 | ;; scrolling fast. | ||
| 99 | (setq scroll-margin 2) | ||
| 100 | |||
| 101 | ;; Make mouse scroll smoother | ||
| 102 | (setq mouse-wheel-scroll-amount '(2) | ||
| 103 | mouse-wheel-progressive-speed nil | ||
| 104 | mouse-wheel-follow-mouse t) | ||
| 105 | |||
| 106 | ;; Prevent jumpy scrolling | ||
| 107 | (setq scroll-conservatively 10 | ||
| 108 | auto-window-vscroll nil | ||
| 109 | scroll-preserve-screen-position t) | ||
| 110 | |||
| 111 | ;; Move point to beginning/end of | ||
| 112 | ;; buffer if attempting to scroll | ||
| 113 | ;; when already at the beginning/end | ||
| 114 | ;; of buffer | ||
| 115 | (setq scroll-error-top-bottom t) | ||
| 116 | |||
| 117 | |||
| 118 | ;; --------------------------------- | ||
| 119 | ;; Whitespace | ||
| 120 | ;; ---------- | ||
| 121 | ;; Spaces, tabs, indentation, | ||
| 122 | ;; newlines, and text-wrapping. | ||
| 123 | ;; --------------------------------- | ||
| 124 | |||
| 125 | ;; Show stray whitespace | ||
| 126 | (setq-default show-trailing-whitespace t | ||
| 127 | indicate-empty-lines t | ||
| 128 | indicate-buffer-boundaries 'left) | ||
| 129 | |||
| 130 | ;; Make files end with newline | ||
| 131 | (setq-default require-final-newline t) | ||
| 132 | |||
| 133 | ;; Sentences end with ONE space | ||
| 134 | (setq-default sentence-end-double-space nil) | ||
| 135 | |||
| 136 | ;; Use spaces for indentation | ||
| 137 | (setq-default indent-tabs-mode nil | ||
| 138 | tab-width 2) | ||
| 139 | |||
| 140 | ;; Wrap words at buffer edge | ||
| 141 | (global-visual-line-mode) | ||
| 142 | |||
| 143 | |||
| 144 | ;; --------------------------------- | ||
| 145 | ;; Delimiters | ||
| 146 | ;; ---------- | ||
| 147 | ;; Parentheses, brackets, and other | ||
| 148 | ;; open-close type things | ||
| 149 | ;; --------------------------------- | ||
| 150 | |||
| 151 | ;; Auto-close delimiters | ||
| 152 | (electric-pair-mode) | ||
| 153 | |||
| 154 | |||
| 155 | ;; --------------------------------- | ||
| 156 | ;; Type over selected text | ||
| 157 | ;; ----------------------- | ||
| 158 | ;; Typing over selected text should | ||
| 159 | ;; delete the selected text | ||
| 160 | ;; --------------------------------- | ||
| 161 | |||
| 162 | (delete-selection-mode t) | ||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | ;; --------------------------------------------------------------------- | ||
| 62 | ;;; File Management | 168 | ;;; File Management |
| 63 | ;; ---------------- | 169 | ;; ---------------- |
| 64 | ;; Everything to do with file or directory management goes here. | 170 | ;; Everything to do with file or directory management goes here. |