summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authoroskar <[email protected]>2024-05-22 19:45:16 +0200
committeroskar <[email protected]>2024-05-22 19:45:16 +0200
commite15ea0314ec24b96a926e7f0db69f3963438fbce (patch)
tree49b6d32a7bb8887d16ec795773909ae0c866cba8 /emacs
parentde01077bfb714d824830108f6659a0608f4c3654 (diff)
fixed .emacs to emacs
Diffstat (limited to 'emacs')
-rw-r--r--emacs6
1 files changed, 6 insertions, 0 deletions
diff --git a/emacs b/emacs
index a99359d..4b400ee 100644
--- a/emacs
+++ b/emacs
@@ -25,3 +25,9 @@
(setq c-basic-offset 4) ; Tab width (but for C?)
(find-file "/home/oskar/doc/how2emacs.txt")
(switch-to-buffer "*scratch*")
+
+(defun lmid ()
+ ;;Move cursor to the middle of the current line
+ (interactive)
+ (let ((line-length (- (line-end-position) (line-beginning-position))))
+ (goto-char (+ (line-beginning-position) (/ line-length 2)))))