diff options
author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-04-20 15:23:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-20 15:23:28 -0400 |
commit | 0f15142033a10c20d464b313ea19e66f81a9234e (patch) | |
tree | 7dc53b1cbcd79aad08500d68f3762d86e199d5bc /init.el | |
parent | Merge `rfc/7/use-package` branch to `stable` branch (diff) | |
parent | Highlight current line (diff) | |
download | mmosmacs-0f15142033a10c20d464b313ea19e66f81a9234e.tar.gz mmosmacs-0f15142033a10c20d464b313ea19e66f81a9234e.tar.bz2 mmosmacs-0f15142033a10c20d464b313ea19e66f81a9234e.zip |
PR #11: Merge `rfc/9/improve-editor` branch to `stable` branch
Diffstat (limited to 'init.el')
-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. |