Live data from Hacker News

Editing Code in Emacs

redpenguin101.github.io

61–64 of 64 posts

Re: Editing Code in Emacs

#61

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…

> fast scrolling works also

Grokking efficient navigation within Emacs buffers completely removed the necessity for scrolling for me - most of the time it's all about finding specific content - using consult-line, imenu, various jump methods, ex-commands, etc. - there are so many different tools in Emacs to rapidly move around, it makes scrolling feel like useless fiddling, not efficiency.

Mouse is nice for operations that don't require exact precisioning - like resizing windows in your WM, or another cool albeit pretty rare and gimmicky use for it is setting mouse clicks for multiple-cursor selection - feels like shooting lasers in a video-game, i.e.,

    (global-set-key (kbd "C-s-") 'mc/add-cursor-on-click)
   
Selecting regions of text with mouse? Why, if vim-navigation lets me quickly grab: anything between things - parens, brackets, quotes, etc.; anything including those things; anything up to the char; including the char; until some text; backwards up to the text, etc.

With expreg (expand-region) I can quickly expand and contract my selection - it's so smart - it first selects the word, then line, then sentence, then paragraph - similarly it expands/contracts structurally for code, it understands org-mode, yaml, markdown and Lisp structure. After developing the muscle memory for these things, selecting and moving text with the mouse feels so crude and annoyingly inaccurate. Makes me feel sorry for the vscode kiddos to be honest.

Re: Editing Code in Emacs

#62

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.

I use an app like Terminus or Prompt to access a remote server. I have a keyboard and a mouse for my iPad Pro.

Re: Editing Code in Emacs

#63
This is a much better alternative to using evil-mode, kudos. It's absolutely right that losing access to the "lingua franca" of emacs keybinds makes the whole thing kind of pointless, unless you rebind everything, of course.

Re: Editing Code in Emacs

#64

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 documen…

> I'm not a fan of modal interfaces I'm assuming you're using Emacs (otherwise why would you be commenting in this thread, right?). It's weird to hear that from an Emacs user - it's inherently a modal editor - keycords are modal, isearch is modal, repeat-mode is modal, transients are all modals with states. Evil-mode only adds some consistent "language" and structure to deal with modality, there's nothing much to it.…

Ack. Forgot to respond to this. Yes, valid point. I guess when you swim in the sea of modal interfaces you're used to you don't see them. It's entirely possible the reason I like emacs more than vi is I just used emacs a lot more. Also, I like that emacs starts in a mode where it prints out what you type in. I know some versions of vim did this too, but now it seems sort of random so I always hit escape i any time i start vi. Also, I do appreciate vi's keystrokes. They seem to be better thought out than emacs'. I'm sure you can modify bindings in vim by now. Not sure what you mean by C-c C-c in emacs. That's not bound to anything on my system. Are you talking about (overwrite-mode)?

Not sure I understand why vi navigation is better. I always thought emacs' arrow keys were better than escape-h,j,k or l. Much of the time I just use emacs' equivalent of leaping, ctrl-s and ctrl-r to search forward and back.

Post reply on HN