12 ms·
Here's what grinds my gears: That the cursor follows the visible buffer. It would be nice to be able to scroll to another part of a file and then just start typ
by rusk 8y ago
Here's what grinds my gears: That the cursor follows the visible buffer. It would be nice to be able to scroll to another part of a file and then just start typing and be back where I was ...
I mean I could understand if this was an efficiency thing to do with scaling to large files due to a kind of a tiling memory model or something, but emacs doesn't even do that!
It's not a huge deal I've learned to get used to using Ctrl+U-Space to get back to where I was.
I read somewhere that somebody tried to implement what I'm talking about but never really got around to trying it cause it seems a little half-baked.
- rcthompson 8y agoNow I kind of want to try my hand at implementing this. I imagine an implementation would add a buffer-local variable holding the position of the point as of the last non-scrolling operation. This would be updated in post-command-hook, but only if the last command was not a scrolling command (which would probably have to be defined as a list of "blacklisted" commands that shouldn't change the point). This hook would also hide the cursor if the desired position of the point is off-screen and show it otherwise. Finally, a pre-command-hook would set the real point to the saved position unless the command about to be executed is a scrolling command or a mouse interaction (which should move the point to somewhere on-screen).
- hollerith 8y agoI've seen an implementation, but don't remember its name or how to find it again. If I remember, I'll send an email to the address on your resumue.
- rudolfwinestock 8y agoThe cursor stays in the viewport because, deep down, Emacs still thinks that it's outputting to a 1970s-era ASCII terminal. See this https://www.facebook.com/notes/daniel-colascione/buttery-smooth-emacs/10155313440066102/ https://www.facebook.com/notes/daniel-colascione/buttery-smo... “Internally, Emacs still belives it’s a text program, and we pretend Xt is a text terminal, and we pretend GTK is an Xt toolkit. It’s a fractal of delusion.” For years, James Gosling, author of the first version of Emacs that ran on Unix (the ancestor of GNU Emacs), has been begging people to stop using Emacs. Emacs is in a race, not against Vim, but against VS Code and Atom for which editor can be more easily customized. In the long run, it doesn't look good for Emacs.
- jonathanstrange 8y agoFor me as a daily Emacs user this sounds like another "editor war" rant. I neither find Emacs hard to customize nor do I think it has any substantial limitations other than the ones that are based on my own lack of knowledge. It's always fair to compare it to Vim, but I don't think it makes much sense to compare it in general to VS Code or Atom. One major reason for me to use Emacs and not newer software is that it is not only cross-platform but also gives some confidence that I will be able to use it in twenty years from now on a new platform. The same could be said about Vim. In comparison to these two, newer editors sometimes appear too ephemeral and fragile to me. (Then again, I used to use BBedit on the Mac and just found out that it's still around! What a nice surprise!)
- jhall1468 8y agoBoth Atom and VSCode are multiplatform and can run on any platform emacs can. Hell there's a version of it that runs in-browser. Both have commercial backing and the platform is built ok Chrome. Hard to imagine a world where any of that adds up to ephemeral.
- wyuenho 8y agoWhat does Ctrl+U-Space do if you don't mind me asking? Is that some magic that you've bound? Mind sharing?
- gkya 8y agoIt's C-u <Space> in Emacs lingo; it pops the mark ring. Some actions like C-<Space>, M-< and M-> push the position of the point to the mark ring before moving it, and when you pop the mark ring, you jump to the position that was pushed most recently.
- jackewiehose 8y ago> Some actions [...] push the position of the point to the mark ring before moving it Notably C-s and C-r (incremental search forward/backward). That in combination with C-space is the way to navigate in emacs like a pro :-) (btw: its C-u C-space. C-u space inserts 4 whitespace)
- gkya 8y agoTIL! I didn't know search pushed marks, thanks!
- noufalibrahim 8y agoThere are scroll-other-window and scroll-other-window-down which are usually bound to M-PgUp and M-PgDown. You can use these to scroll the other window (perhaps another buffer) while the cursor stays in the current one at the same position.
- rusk 8y agoYes I’ve been doing this as well
- hydandata 8y agoNot your desired behavior precisely, but Emacs does support recursive edits https://www.emacswiki.org/emacs/RecursiveEditPreservingWindowConfig https://www.emacswiki.org/emacs/RecursiveEditPreservingWindo...
- hollerith 8y agoAlthough I've been using Emacs daily since 1991, I can't imagine how the code behind your link helps or how starting a recursive editing session helps with the problem you are replying to.
- floren 8y agoAcme does this, and I love it, but most people's response to seeing Acme is "what the hell? No syntax highlighting? No autocomplete?" You can also easily create a second "view" into a file with the Zerox command, which is a nice way to look at two parts of a file at once. It's the best thing I've found for managing large numbers of buffers at once, though, and with things like acmego (go fmt + add missing imports on save) and Go guru integration (jump straight to function definition) it suits my needs pretty well.
- gkya 8y ago> You can also easily create a second "view" into a file with the Zerox command, which is a nice way to look at two parts of a file at once. Emacs has this too. You can look at a buffer from different windows, or clone-indirect-buffer in order to edit multiple parts of it simultaneously.
- floren 8y agoYou're right, it's been so long since I used emacs I forgot it's a thing. Vim does it too, I think, but I only use vim to quickly edit a file.
- rusk 8y agoJust about every other editor does this. That's why I miss it!
- jackewiehose 8y agoC-x 4 c (clone-indirect-buffer-other-window) comes in handy
- RHSeeger 8y agoI use a bit of code that binds a key combo to "go back to where I was last editing", which lets me move around the file, look for something, copy it, and them go back to where I was last actually working in the file.
- dreamcompiler 8y agoA thousand time this. I love Emacs, but the fact that SCROLLING MOVES THE CURSOR drives me crazy.