Fork me on GitHub
#emacs
<
2017-12-13
>
New To Clojure18:12:56

Is it possible to jump to previous position of cursor somehow (and to previous of previous of previous too)? For example, I switched to definition of a symbol or used incremental search and want to go back a few times.

daveliepmann11:12:52

Did you jump to definition using CIDER's M-.? If so I recommend: `M-, runs the command cider-pop-back (found in cider-mode-map), which is an alias for ‘xref-pop-marker-stack’ in ‘cider-util.el’.`

New To Clojure14:12:47

@U05092LD5 That's exactly what I'm doing. Thank you a lot, will use M-,.

chris18:12:57

that's what the jump-list is for in evil

chris18:12:14

if you aren't using evil you can pop marks, I think?

New To Clojure19:12:36

@chris pop-global-mark is a bit crude. It works for switching back to previous buffer but doesn't accurately remember previous positions of cursor in the same buffer. Thank you, it's better than nothing so I will find uses for that.

eggsyntax20:12:12

@ghsgd2 if you're using evil mode, I suggest evil-jump-backward. Typically bound to C-o, I believe.

eggsyntax20:12:44

Theoretically C-i takes you back forward, but it doesn't work for me.

chris20:12:05

C-i doesn't work because of some obscure emacs stuff

chris20:12:10

you can get it to work with a hack

chris20:12:26

(keyboard-translate ?\C-i ?\H-i) (global-set-key [?\H-i] 'evil-jump-forward)

chris20:12:45

those two lines will reenable C-i

chris20:12:24

basically, it routes it through the Hyper keymap (which nothing uses because no one really has a Hyper key) and maps something in the hyper keymap to jump forward

chris20:12:56

I don't remember why that's necessary in the first place though

chris20:12:24

or if you're on spacemacs you can just use dotspacemacs-distinguish-gui-tab t in the init function

New To Clojure20:12:56

@eggsyntax, @chris Thank you! I think it's time for me to learn evil mode. 🙂

eggsyntax20:12:23

I'm certainly a fan. But I came from vim, so it was a no-brainer for me.

adamvh21:12:37

i find the lisp manipulation a little more awkward in spacemacs' lisp mode, but maybe that's just because my paredit muscle memory got really deep

adamvh21:12:53

in particular spacemacs seems to lack an equivalent to C-M-d (go down one sexp) which often leaves me feeling lost and just hjkl'ing like a pleb