8

What I want to achieve is this. I open a bunch of files, edit them and quit Emacs. then tomorrow I open one the files and I want Emacs to jump to the last edited position on that file. How can I achieve this ?

Drew
  • 75,699
  • 9
  • 109
  • 225
milad zahedi
  • 205
  • 1
  • 5

1 Answers1

8

The built-in library saveplace.el contains a commentary that states:

;; Automatically save place in files, so that visiting them later
;; (even during a different Emacs session) automatically moves point
;; to the saved position, when the file is first found.  Uses the
;; value of buffer-local variable save-place to determine whether to
;; save position or not.

In recent versions of Emacs, the minor-mode save-place-mode is auto-loaded. Thus, all that is needed is the following one-liner in the .emacs / init.el file:

(save-place-mode 1)

For additional information, see the emacswiki page:

https://www.emacswiki.org/emacs/SavePlace

lawlist
  • 18,826
  • 5
  • 37
  • 118