Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News

Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News
  1. Home
  2. /Story
  3. /Editing Code in Emacs
  1. Home
  2. /Story
  3. /Editing Code in Emacs
Nov 23, 2025 at 9:59 AM EST

Editing Code in Emacs

redpenguin101
45 points
2 comments

Mood

informative

Sentiment

positive

Category

tech_discussion

Key topics

Emacs

Code Editing

Productivity

Discussion Activity

Moderate engagement

First comment

4h

Peak period

8

Hour 5

Avg / period

4.5

Comment distribution36 data points
Loading chart...

Based on 36 loaded comments

Key moments

  1. 01Story posted

    Nov 23, 2025 at 9:59 AM EST

    16h ago

    Step 01
  2. 02First comment

    Nov 23, 2025 at 1:42 PM EST

    4h after posting

    Step 02
  3. 03Peak activity

    8 comments in Hour 5

    Hottest window of the conversation

    Step 03
  4. 04Latest activity

    Nov 23, 2025 at 8:59 PM EST

    5h ago

    Step 04

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (2 comments)
Showing 36 comments
emil-lp
13h ago
3 replies
I've used Emacs for 20 years and I never learnt to navigate in a file except backwards and forwards search.

Is there still hope for me?

I think my biggest issue is that I am a slow coder and I never feel in a hurry.

lvass
11h ago
Just type C-h t (help-with-tutorial) and work your way through it.
brabel
11h ago
You really only need a few shortcuts to feel comfortable. The ones in the basic tutorial are pretty much all I use, but I also enable god-mode to avoid having to keep Ctrl pressed as that hurts.
redpenguin101
11h ago
If your workflow feels comfortable there's really no need to change it in my opinion. The reason I do this is to avoid the frustrating feeling that I'm spending all my time moving around in the text file rather than actually making the program. It's less about speed and more about feeling good while programming.
final_aeon
13h ago
1 reply
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

nothrabannosir
12h ago
1 reply
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. Changing basic key bindings is the quickest way to vitiate that symbiosis.

Unfortunately.

And while they may be old school, traditional, and orthodox, they are by no means idiosyncratic. They’re widely supported: readline , bash, everywhere on macos, even modern browsers. Eg you can actually paste in bash: try killing something with C-w or C-k, and paste it back using C-y. Or transpose arguments using C-M-t. Navigate suggestions in Firefox using C-n and C-p. Bash even supports undo using C-/.

All to say: learning emacs movement keys pays off.

v9v
12h ago
1 reply
[delayed]
brabel
11h ago
1 reply
The op is probably on Mac where emacs movements use Ctrl but FF and other apps use Cmd key, so they always work as there’s no conflict.
sbrother
10h ago
Honestly being able to use emacs movements everywhere is one of the reasons I stay on MacOS.
OhMeadhbh
13h ago
1 reply
Meh. I'm not a fan of modal interfaces. But if it works for you, then knock yourself out. I appreciate the write-up here. I'll give it a try to see if I can see what the author is talking about. The overwhelming majority of code I write now is in snippets inside text documents (think Knuthian Literate Programming) so I don't know how that would work w/ the author's modal setup. But they went to the trouble of documenting it, and it seems sort of like what `vi` people are always yammering about. Seems a decent idea to try to understand it.
iLemming
9h ago
[delayed]
mystifyingpoi
12h ago
2 replies
I really like this, it's a bit hardcore, but for someone that really cares about efficiency (whether it is worth it or not - debatable), this is great.

Though I have one minor nit against one point, that I've seen basically in every similar article:

> This means no arrow keys and no mouse

I use Neovim daily, and there is no denying that 98% of the time, using mouse is less efficient than doing a fancy search or jump. But for the remaining 2%, it's provably true that mouse is better - like, selecting an arbitrary block of code (without {} or any keyword to hang on). So I always recommend leaving the mouse enabled. Just use it when it makes sense.

magackame
12h ago
2 replies
How using a mouse and incurring a context switch is better than just mashing j/k a couple of times in worst case scenario?
vinceguidry
12h ago
1 reply
When you're not editing lisp.
skydhash
10h ago
v, then t/T or f/F if staying on the same line, j and k if it’s within a couple line, / or ? for anything else. With the repetition commands ./,/n/N if I do not land at the correct place.
trelane
9h ago
If you're moving in emacs using per-line/character commands, you're definitely not using emacs as efficiently as you could be.
redpenguin101
11h ago
> But for the remaining 2%, it's provably true that mouse is better

This is definitely true. The thing is that using the mouse is a habit, and until you break it, people find themselves instinctively using it in situations where it would be better to use the keyboard. So the 'hard' mouse disable is more of a 'going cold-turkey' type thing to try and break the habit. I agree that once it's broken it makes sense to relax this.

dustfinger
12h ago
4 replies
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.
skydhash
10h ago
1 reply
I have it installed and have the main commands bound to convenient keys. But I’m so used to moving via words, paragraphs and isearch that the only time I remember it is when targeting symbols.
mark_h
7h ago
About my only usage is to augment my isearch. I frequently use isearch to navigate to a place on screen, but sometimes there are so many matches it would take a lot of repeated "C-s" to get there. I have "C-'" bound to avy-isearch (from within isearch), which instantly turns that into one or two keystrokes to filter down.

(or I could pick up the mouse, I know, but that's not why we're here)

Buttons840
9h ago
3 replies
I was excited for avy until I realized its purpose is only to move the cursor to a place visible on the screen. It does nothing a mouse can't do with one click.

(This is my understanding at least; I'm open to correction.)

I'm a lover of Vim bindings, and so I appreciate keyboard controls, but where Vim enables working with files and text in a general and powerful way, avy enables avoiding one click with the mouse. I don't use Vim to avoid the mouse, I use it so I can hack some Vim macros together when I'm editing text on a text-level. Vim (or Emacs) is an eternal tool that can do big things, avy just positions my cursor.

lvass
9h ago
1 reply
Definitely not it's purpose. Avy can be used to select a word, line, or region. One action is move to it. But it can also, in it's own words, copy, yank, zap to, transpose, teleport, kill, mark, ispell and even org-refile.

https://karthinks.com/software/avy-can-do-anything/

Buttons840
8h ago
1 reply
I've bounced off that blog post in the past, because it makes it appear the first setup to doing something in avy is to position all my files and "windows" (a "window" in Emacs terminology is an editing pane inside Emacs) in some clever way, and after I got all that setup, and the windows are all looking at just the right parts of the files, then I can move a paragraph from one window to another with just a few special keystrokes.

I feel like moving from a large monitor to a small monitor would limit the usefulness of avy; it's weird that the physical size of a monitor would limit a tool like this.

I almost never use windows. I almost never look at more than one file at once that fills my entire screen. Can avy still do things for me?

dustfinger
8h ago
I would agree that the usefulness is reduced if you have tight vertical space constraints (3 lines of text).
jlouis
9h ago
1 reply
It's really a selector or a filter. It's power comes from combining it with other tools.
dustfinger
8h ago
Can you elaborate. I just use it by itself and think it is wonderful, but I am curious for some examples of using it with other tools.
dustfinger
9h ago
Don't underestimate the advantage of being able to move the cursor anywhere in a few clicks without having to take your hands off the keyboard. It is much faster. Also, you can save your elbows the pain of constantly reaching over for the mouse.

avy does more than just jump the cursor to a specific place. It also allows you search for, copy and move text round without needing to move your cursor to that text. It is extremely easy to use and very efficient.

globular-toast
11h ago
I don't think this was the first package to use the tree idea, but `avy-goto-char-timer` is amazing and is new since the first time I tried it. After activating goto with a key press you type as many characters as you like to get where you want. Often you can get straight there if it's something unique, but if not then it goes to the tree. It's amazing how quick you get at typing "def" or something to get to a Python function definition, for example.

What I love about functionality like this is it's completely generic. It's just text. I don't need any lsp support to get me "go to def" or something. I can open a file in a language I've never seen before and use the exact same interface I'm used to to navigate around.

quotemstr
5h ago
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 than navigating by sexp or whatever.

Maybe if I combine it with eye tracking so I can limit letter assignment to the foveated region I can reduce the cycle count and make this style of navigation win.

floathub
8h ago
1 reply
I used Emacs for several years before I discovered "project" (it's built in). If you're navigating dired trees or similar to find files or grep for strings in groups of files, this is like magic:

C-x p f (find any file in the current "project", e.g. git repo)

C-x p v (grep the whole project super fast)

It's embarrassing how long it took me to realize it was there all along. :-)

JanisErdmanis
6h ago
I am consistently using `m` for marking relevant files/directories in the dired mode and then `A` to find a regex among all included files. It does not seem that I miss anything by not relying on such a project approach.
jmclnx
13h ago
Seems to be an intro to a kind of but lite weight vi mode. I tend to like the regular mode in Emacs.

Maybe a bit OT, but I think I saw here a week or more ago a post about magit, I am toying with using it, but seems to be a rather big package. Plus I wonder why dash is needed:

https://emacsdocs.org/docs/magit/Installing-from-the-Git-Rep...

In anycase to avoid downloading additional packages I may use Melpa

https://emacsdocs.org/docs/magit/Installing-from-Melpa

rickstanley
12h ago
Thanks for sharing. I've been off editor hopping for quite some time, nowadays I just use some pre-defined configuration like Doom Emacs, occasionally I try to build some environment, with AI help, from "scratch" for fun and curiosity.

I really like Emacs' flexibility + evil-mode and reactivity, recently I searched for something similar and found Lem: https://github.com/lem-project/lem, looks promising, I'll try it out and compare with Emacs when I have the chance and time.

nine_k
13h ago
In short: turn Emacs navigation into Vim-like navigation, make the editing modal, and thus make navigation hyper-efficient. (If you like the idea, I would suggest taking a look at evil-mode if you come from Vim, or god-mode and devil-mode if you already are used to Emacs.)

A few useful pieces of advice beside that, too. The workflow the author describes is not how I prefer to do things, but the author mentions a number of important capabilities to be aware of: operating at sexp level, subword motion, etc. Narrowing and folding, which I like to use, are not mentioned.

No mention of LSPs or compilers, but these are their own large topic.

tacker2000
9h ago
You can also use a great vim “integration” in emacs by using doom emacs.
eichin
12h ago
Hmm, would be interesting to see a "race" between this and isearch; from the examples, it looks like this has an advantage only if you have lots of similar strings, so "the one you're looking at" vs. "typing more letters of the word" is an advantage? (externally timed, see The Humane Interface for details on how self-reporting doesn't actually work to measure this kind of thing)
View full discussion on Hacker News
ID: 46024032Type: storyLast synced: 11/23/2025, 6:44:07 PM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.

Read ArticleView on HN

Not

Hacker News!

AI-observed conversations & context

Daily AI-observed summaries, trends, and audience signals pulled from Hacker News so you can see the conversation before it hits your feed.

LiveBeta

Explore

  • Home
  • Jobs radar
  • Tech pulse
  • Startups
  • Trends

Resources

  • Visit Hacker News
  • HN API
  • Modal cronjobs
  • Meta Llama

Briefings

Inbox recaps on the loudest debates & under-the-radar launches.

Connect

© 2025 Not Hacker News! — independent Hacker News companion.

Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.