Live data from Hacker News

Editing Code in Emacs

redpenguin101.github.io

51–60 of 64 posts

Re: Editing Code in Emacs

#51

My favorite way to move around in Emacs, and to move text around, is via avy-mode: https://github.com/abo-abo/avy . If you have not experienced avy-mode, give it a try, I think you will wonder how you ever got along without it.

I haven't tried Avy, but I gave ace-jump mode a shot. Maybe I didn't give it enough time, but it just never felt fast for me. The problem is the eye -> hand -> eye feedback loop latency. If I want to jump to a given place, I need invoke ace-jump, wait to read what letter ace jump assigns my destination, press that letter, read the new letter, and repeat until the destination becomes unambitious. It just feels slower…

Just as an idea: you could try a more complicated setup where physical key positioning matches the movement direction, so Q would always be upper-left. Then at least the first jump you'd be able to do without reading, though then for the final jump you'd still need to react to feedback (or for jumping to an arbitrary area on the screen you could use a fixed "grid" that could also allow doing the first jump blindly)

Re: Editing Code in Emacs

#52

In my opinion there's no reason to stick to the "old school" / classic emacs controls. They're archaic at this point. I am an experienced emacs user and I still use CUA mode, arrow keys, and I wrote a package which completely overhauls built-in "word jumping" commands (called bbww on melpa.) You don't need to worry about upholding traditional emacs orthodoxy

Disagree with this just because it makes everything else easier. The more you stick to common key bindings, the more intuitive various packages will be. Eg navigating lines vs blocks in a magit diff block is C-n and N respectively. Copying a full hash is M-w. All these bindings are intuitive “overlays” on conventional bindings. Emacs shines when packages combine to form a whole greater than the sum of its parts. Chan…

> Changing basic key bindings is the quickest way to vitiate that symbiosis.

Unless you change those as well

> All to say: learning emacs movement keys pays off.

It can also cost you RSI, so not worth it

Re: Editing Code in Emacs

#53
> A note on defaults. A problem with customised setups is that they mean you can’t pick up your friend’s Emacs setup and use it

> can be mitigated by sticking with the ‘language’ of the system

No? You're still going to be mistaken a lot of the time to the point of making your experience unpleasant. And how often do you really pick up your friend's Emacs setup for this to outweigh the other 99% of your time?

> Emacs has pretty clear (if arguably not very good) conventions

Indeed, so it's a waste of productivity and ergonomics to rely on it

Re: Editing Code in Emacs

#54
I am going to sound like a mouse-using Luddite but I configure .emacs with a one line addition to allow a mouse click to reposition the cursor and fast scrolling works also.

I have been using Emacs for 40 years, and decades ago, before ground based fiber, it was a 2 satellite bounce ping time between my office in San Diego and the 38 data collection sites around the world for a DARPA project and the mouse click in Emacs saved a ton of time.

In the present time, I use Emacs on remote servers and local editing, either using my iPad Pro, and Apple Mouse, and a Studio monitor, or a MacBook - on both environments I find occasional mouse clicks or fast scrolls using mouse or Apple trackpad still saves time even in zero latency environments.

Re: Editing Code in Emacs

#55

I am going to sound like a mouse-using Luddite but I configure .emacs with a one line addition to allow a mouse click to reposition the cursor and fast scrolling works also. I have been using Emacs for 40 years, and decades ago, before ground based fiber, it was a 2 satellite bounce ping time between my office in San Diego and the 38 data collection sites around the world for a DARPA project and the mouse click in Em…

Tramp isn't an option? I know people say it's slow (it is) and synchronous (yes, it is) but I'd rather pay a high latency cost only upon saving than a moderate one ALL THE TIME.

Re: Editing Code in Emacs

#56

I am going to sound like a mouse-using Luddite but I configure .emacs with a one line addition to allow a mouse click to reposition the cursor and fast scrolling works also. I have been using Emacs for 40 years, and decades ago, before ground based fiber, it was a 2 satellite bounce ping time between my office in San Diego and the 38 data collection sites around the world for a DARPA project and the mouse click in Em…

Tramp isn't an option? I know people say it's slow (it is) and synchronous (yes, it is) but I'd rather pay a high latency cost only upon saving than a moderate one ALL THE TIME.

It is an option. You are talking with an old man (me!) and I just usually like simple Emacs setups, also using mosh and ssh and tmux.

Re: Editing Code in Emacs

#57

I am going to sound like a mouse-using Luddite but I configure .emacs with a one line addition to allow a mouse click to reposition the cursor and fast scrolling works also. I have been using Emacs for 40 years, and decades ago, before ground based fiber, it was a 2 satellite bounce ping time between my office in San Diego and the 38 data collection sites around the world for a DARPA project and the mouse click in Em…

How do you go about editing via ipad, I'm just getting into this whole world, and am finding it difficult to figure out a system.

Re: Editing Code in Emacs

#58
post #53

> A note on defaults. A problem with customised setups is that they mean you can’t pick up your friend’s Emacs setup and use it > can be mitigated by sticking with the ‘language’ of the system No? You're still going to be mistaken a lot of the time to the point of making your experience unpleasant. And how often do you really pick up your friend's Emacs setup for this to outweigh the other 99% of your time? > Emacs h…

If I couldn't give Emacs incredibly specialized behavior, I wouldn't even use it.

Re: Editing Code in Emacs

#59
post #52

Earlier quoted context omitted.

Disagree with this just because it makes everything else easier. The more you stick to common key bindings, the more intuitive various packages will be. Eg navigating lines vs blocks in a magit diff block is C-n and N respectively. Copying a full hash is M-w. All these bindings are intuitive “overlays” on conventional bindings. Emacs shines when packages combine to form a whole greater than the sum of its parts. Chan…

> Changing basic key bindings is the quickest way to vitiate that symbiosis. Unless you change those as well > All to say: learning emacs movement keys pays off. It can also cost you RSI, so not worth it

I've found it crucial to have Control mapped to the keys immediately next to and on both sides of the spacebar. Thumbs are stronger than pinkies for modifying keypresses.

Re: Editing Code in Emacs

#60
post #52

Earlier quoted context omitted.

> Changing basic key bindings is the quickest way to vitiate that symbiosis. Unless you change those as well > All to say: learning emacs movement keys pays off. It can also cost you RSI, so not worth it

I've found it crucial to have Control mapped to the keys immediately next to and on both sides of the spacebar. Thumbs are stronger than pinkies for modifying keypresses.

Yes, that's a good idea since Control is the most common keybinding modifiers, so helps in other apps as well (likewise, using Cmd on a Mac would be preferable to using the literal Control)
Post reply on HN