Emacs: Save Cursor Position

By Xah Lee. Date: . Last updated: .

You can save the cursor position for every file you opened. So, next time you open the file, the cursor will be at the position you last opened it.

Put this in your Emacs Init File:

;; remember cursor position
(if (version< emacs-version "25.0")
    (progn
      (require 'saveplace)
      (setq-default save-place t))
  (save-place-mode 1))
save-place-file
Variable. Name of the file that records save-place-alist value. By default its ~/.emacs.d/places

saveplace.el is written by Karl Fogel since 1993. Karl is also the author of Emacs Bookmark Feature. Thanks Karl.

Emacs, Restore Things

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Init

Init Basics

Keys

Font

Text Editing

Completion

File

Restore Things

Backup/AutoSave

Line

Appearance

Misc

Advanced Init Tips

packages