I am working on Python files and jump to beginning section to fix some imports and come back to point I am working on.
I want to use
Bookmark, when I make a change on beginning of the file and come-back to the latest line I am working on. I was using
ctrl+u+space, but I need to press multiple times to get back to latest point.
For following condition if possible:
- When I jump to beginning of the buffer, also automatically I want to add a bookmark to the latest line I am working on.
- Afterwards I made some changes on the
importsection, I want to get back to the latest bookmark (which is the right before I jumped), with a keybinding without entering its name into
Jump to bookmark:.
(global-set-key "\C-x\ ," 'beginning-of-buffer); (defadvice bookmark-jump (after bookmark-jump activate) (let ((latest (bookmark-get-bookmark bookmark))) (setq bookmark-alist (delq latest bookmark-alist)) (add-to-list 'bookmark-alist latest)))
1 | import hello 2 | import world ... 20 | import python ... 1000| line_I_am_working_on = 100
I am on line 1000. Than I pressed
Ctrl+x+, to jump to beginning of the buffer. Than I go to line-20 by pressing line-down (
Ctrl+p) and make a change. As final step I want to jump back to line 1000.