summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
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)))))