Batteries included with Emacs (2020)
karthinks.com
karthinks.com
A few years back I got into Atom quite a bit since it checked all the boxes: extensible, open source, and it was very nice. Then VSCode killed it. And it seems more and more that VSCode is taking over, all the while inserting more proprietary code to the point where half the 'big' plugins don't work on Codium, only the proprietary MS distribution.
So I got back into Emacs but really worked on my environment. Stopped dabbling and started just forcing myself to use it. And it's honestly amazing. It checks off every box available in VSCode and more. And it's nice knowing that it'll always be there. I'm not against proprietary software per-se, but I definitely don't have a lot of trust in Microsoft.
We're very close to a world in which we don't have N implementations of finding the start of a C function or figuring out what parts of a Python buffer are keywords.
I love vim (err… Neovim), and this was great.
(Edit: Yes, this is a joke)
No, nvi or bust, man!
Others here seem to have taken this as tongue-in-cheek. On the first read I took it as "I think vim is ridiculous". I'm honestly curious to know which it is (or if both are inaccurate).
At any rate I didn't read your comment as being "and emacs user dunking on vim" (you mentioned emacs in a list of editors, but it wasn't obvious that you were coming from the emacs camp). A lot of people scoff at vim because it works so much differently than anything else they've used before (mostly due to modal editing). I guess that was the vibe I got from my first reading of your comment, but I'll just chaulk that up to there being no "tone of voice" when reading text.
Personally I am in both camps - I use both editors. and like both of them for different reasons.
(yeah, that model led to poor performance, but afaict that's a combination of (a) just JS things and (b) not putting any effort into the design)
> I definitely don't have a lot of trust in Microsoft.
Very wise, given the user-hostile stuff they've been doing in Windows recently...
This feels a bit self-contradictory, since one might argue a properly designed extension API must include process isolation, so naively-written extensions can't mess up the main loop. VS Code extensions are also in JS.
This is the same problem that, say, preemptive multitasking solves, and why Windows 3.1 crashed much more than '95 and XP.
Then, recently, I _really_ wanted to try org and thought "I'll force myself to use it". I started with Evil mode and Doom. I was blown away tbh. What I thought to be an "old" tool that would slow me down, is actually a massive booster (and fun!). My personal experience, of course.
Doom seemed right to me at the time because I just wanted to uncomment `;; org` in `init.el` , not learn a lot of keybindings and get started.
I think I'll start an "Emacs from scratch" someday too.
One of the reasons I haven't seen mentioned much is: I'm a touch typist, and I hate having to switch between mouse and keyboard! I have to take my attention off the screen. Slows me down. Disturbs my concentration.
With Emacs, I can work for hours without ever having to hunt for the mouse, or without even having a mouse plugged in. That's particularly nice for using my Ubuntu laptop on a lap desk, leaning back in my armchair. The best mouse is no mouse at all.
Yes, I know many IDEs have shortcut keys for some commands, but the basic assumption with GUI applications is that you have a mouse. Even if you learn the shortcuts, somehow you always end up having to use the mouse for some common task, e.g., to select a paragraph. That's why I never got to like a GUI IDE, despite having had to use Eclipse for years.
That said, being a programmer and not touch typing definitely sounds odd to me as well
I got carpal tunnels a few years back from emacs, which forced me to try https://ergoemacs.github.io/ . I like it a lot, it's more sensibly designed. I've found it a pain to install though...
the keys don't actually last all that long. they will sell you a new flex/key assembly for the left or the right side though - which is nice...oh yeah, and the function keys stop working pretty quick if you actually use them.
but its so much more comfortable and speedy
The reason should have been rather intuitive, had I considered it. Splitting the keyboard allows a more natural position, but it still needs to be relatively static. Unfortunately, at half the weight, each side had less resistance to moving, especially with the inner stands kicked up at an angle. That meant more frequent fiddling to readjust the positioning, and lots of time wasted trying to decide if it was in the wrong spot, or if I hadnt yet adjusted properly.
I touch-type, but still occasionally struggle with some things eg. using the right shift key instead of always preferring the left. I don't see much benefit in addressing this, since my typing speed is never the blocker with regard to my programming output.
1) I learned to type as a kid at the same time that I was getting into programming. So my typing style tends to optimize for quickly hitting numbers, operators, random punctuation characters, and editor movement/selection/command sequences every bit as much as ordinary letters. (And therefore, I tend to find obsessively staying near the home-row less useful.) I find that I type a little slower at pure linear prose, but a little faster at code than many classical touch-typist.
2) Since I was a self-taught typist who learned to type on a computer keyboard, rather than learned a formal touch typing method that was originally designed for typewriters, I've been comfortable since the beginning with backspace being available. It always used to annoy me whenever I had to take a typing class in school where they emphasized accuracy and dinged my typing speed an arbitrary constant amount for each typo. I can usually sense immediately by feel when I've hit the wrong key, smoothly hit backspace, hit the correct character, and then continue with almost no interruption to the flow of my typing. I usually don't even consciously think about those sorts of corrections.
I tried to write this without looking at the keyboard, while usually I look every now and then. Worked quite well. I guess it is about forcing the habbit of reassuring yourself of pressing the correct keys to stop. I made lots of typos, but removing and writing again, I could get rid of them.
I always gave up after about a week, I've tried it twice or three times during the last 25 years. Like always, good (fast) enough beats perfection. And I'm a mathematician and programmer because I'm lazy :D
scbrg snukes happily.
I have never, ever heard about it.
Edit: by touch typing I mean having your index fingers on fj and from there using ALL keys without ever leaving the starting position, and yes that includes shift, alt and control and special characters.
I know very few people who are really touch typists (I am a proficient one), and I don't believe for a second people are taught touch typings, it's a skill that requires consistent training.
And of course it's not a 'course'. 'Reading' and 'writing' weren't courses, but you learn them regardless. It's too basic to be a course. It's just stuff we learned.
Edit - the format for schooling here is for the first 6/7 years you have a single teacher all day long. That teacher teaches you every subject. And that included several trips to the computer lab per week. The next 6 years of schooling had 'courses' split up by teacher and time slots, but again, computer lab time in some of those courses. There was also a required course called 'CALM' (Career and life management I think) which included a very strong computer lab component. There were also CS-ish electives (equivalent to shop classes) where you learned CS, albeit at a very basic level. And this was during an era where most people didn't have computers at home... So computer labs were always open after school hours.
Edit 2 - Anyhow, a lil random. But being able to touch-type at a specific speed on a test program was required to pass CALM and it was required for high-school graduation. Some kids could pass and then forget it all, but in general the entire schooling system here involves computers enough that most people can touch-type.
Edit 3 - My partner had a similar educational upbringing, despite being born under communism. Hell, she can touch-type multiple keyboard layouts (for other languages) on a US keyboard despite not being technically inclined...
As with most things in my education, most people including myself just put in minimal effort, to get the grade (which touch typing didn’t really effect, as it was not part of any homework, quizzes, tests, etc.) and after a few years you never had to see it again.
Yes, we were taught that all throughout school... Is the US school system really that shit? I'm curious where your scepticism is coming from?
Like really, I didn't know a single kid in university who couldn't consistently type 60 wpm. 40 wpm was literally required to pass high school, pretty slow, but not something you can do staring at the keyboard punching keys one by one. The kids who were really good at it were touching 100wpm. I could get highs of 80-90.
I can count on one hand the amount of people I've met who can't touch-type...
I'd absolutely believe that a lot of us on HN grew up in the narrow slice of time when computers were novel enough that people thought they should teach typing specifically, before that time: too niche; after that time: it's assumed we already know
I told my teacher I don't need to touch type (I could already use a keyboard from tons of programming) so she said if I could beat her I could sit it out. I beat her and she kept up her end of the bargain.
However years later I wish I had just sucked up my pride and learnt it because I had to eventually anyway. It wasn't so useful for programming, but it's great for text (emails, etc.).
I find it interesting that in your view most people aren't touch typist. My experience (now in Australia) is that most people touch type. Although, there does seem to be a spectrum of purity. e.g. my fingers always remain on the home rows, but I use left shift for all capitals except Q, A, Z (when I'm using QWERTY).
Mine did (Europe). Junior high. Around the age of 13, I think. It's been a while. But only as part of a particular course, which I didn't take - I had picked another one. I don't remember which one included the touch typing, but apparently it was one which a lot of students attended.
I learned touch typing at home when I was 14 or 15, my mother changed careers and had to learn touch typing, so she borrowed a Scheidegger typewriter (those with the coloured keys) and a course book, and I thought "Why not?" and did about 15 minutes every day. I tried to be consistent and do it "right", and after three weeks I had it pat down (I should add that those who followed the school course were for the most part a bit sloppy, and most didn't really learn it even though they had the course for the whole semester).
Then when I did my mandatory military service we had to go through a touch type course as well. It wasn't even half as good as the Scheidegger course, but in any case I could touch type already so I didn't care.
For me it helped greatly to be able to touch type when I started working in programming - my mind would fly and I could keep up with my typing. I cringed when I watched over the shoulder of (equally young) colleagues who constantly had to break their concentration to hunt for keys to press, one at the time (of course as years went by those people got much faster, with the same method, and those particular problems disappeared for them).
And in my job I've always had to write a lot of documents, and of course touch typing helps greatly there.
I'd love to be able to type from muscle memory, but the keyboards keep changing!
There's a reason F and J have bumps on them, or why we have two shifts, etc.
For anyone interested into relearning how to type efficiently I want to recommend this free website full of tutorials and exercises: https://www.typingclub.com/
Actually that’s a regression. At one point some keyboards (Apple IIRC) put the bumps on D and K, which made it much easier to notice when your hands were misplaced.
It’s easier to notice that the wrong finger has the bump than noticing that no finger has the bump beneath it.
consider putting a photo of your keyboard next to your screen and painting the keyboard a nice uniform black.
your body-mind's intelligence will swiftly learn to position your hands and coordinate your/its fingers without adding things to unlearn later.
the photo of your keyboard near where you are focusing when looking at the screen makes a huge difference, one could start with just that.
I could probably put a gun to my head spend a month and learn it but I do not really feel it slowing down my programming (I spend more time thinking and drawing some skeletons) so I've never bothered.
However, I still type easily without looking at the keyboard, and I'm about as fast as the average typist, perhaps faster.
Could I speed up more? Possibly, but I don't feel that I'm slowed down by typing speed, and I find my way to type better when one uses a lot of special characters, as is common when doing programming and accessing Emacs keys.
¹I've tried mini-frame, and it's fine, but it's still just a utilitarian grid of text.
Modern Emacs can be (and mostly is) compiled with GTK support and features a GTK interface, but can be launched in text-mode with a command line argument. If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!
The two biggest Linux distros (Ubuntu and Fedora) are Wayland by default now. And the 'standard' Emacs distribution you install through the Software 'store' in both is GTK (which of course works). Wayland support isn't really a big deal anymore. I haven't come across any apps that don't work on Wayland.
cmd+shift+a opens a command palette with every possible command in the IDE. It matches as you type the name of an action, and every action has a keybinding shown to the right (if it exists).
Every relevant button generally has keyboard shortcuts right on them.
And pressing cmd+e opens a list of gui interactions you've made so you can repeat them (things like focusing buffers, clicking on a file in the project file tree, etc.)
Basically, if you know cmd+shift+a, you're golden for learning commands and key shortcuts.
In comparison, emacs/vim are pretty awful. I've done a few tutorials of each and while I could have spent more time learning them, JetBrains makes it stupid easy to start learning the editor.
If you are not familiar what a particular command does you can use C-h f <function-name> to open the help page.
I think Emacs is really easy to learn after you get a handle of the navigation keys. Which you might already be familiar with from shell.
I've told IntelliJ and Eclipse and VSCode to please stop popping up suggestions, and let me type Ctrl+space to summon them.
Aaaah. Much better.
(But getting out of the auto-paired thing could be improved. In IntelliJ, when entering Java code, I usually type cmd-shift-return to complete the statement, and that does what I want. It does different things in different situations, but it's easy to predict what it does.)
For learning a lot of cool stuff about implementing my best book is The Craft Of Text Editing
Still I hardly ever use mouse when using IDE's like Visual Studio C++ coding for example. It has shortcuts for everything.
I'm sure if I went back to Spacemacs now, I'd understand things a whole lot better, but as a new user, it was far too much to figure out at once.
So I went Vanilla, and haven't looked back. I do think that there should be some more articles out there like "so you've decided to try Emacs? Here's what to do beyond opening and saving documents". With a heavy emphasis on, as you said, incrementally adding to your configuration. Something like "here's why you split your config file into 2, with automatic changes going into one file, and manual going into another" followed by "here's use-package" and "if you want to X, here are Y packages that do it" with comparisons between each different way. But broken down into small chunks so things can be done incrementally.
I turned to VS Code + PyCharm for coding. And use Emacs for editing text only. And for that, it is excellent.
What I love about Emacs most is the macro recorder. Whenever I have to transform text, I record my steps in Emacs‘ macro recorder and replay the steps. That’s like magic. I wouldn‘t even bother writing a Python script for these one-off transformations.
You are in full control of how much tinkering you do, though. Strange to blame a tool for this.
Compare and contrast with Visual Studio Code, which has a much smoother onboarding experience.
Shout out to Prot who maintains it.
> Sometimes I wish I initially spent my time learning emacs. Vim has been great to me.
Try SpaceMacs, or even just Evil. I've found that Emacs (the text editor environment) and VIM (the language for interfacing with a text editor environment) skillsets are actually complimentary and together form a terrific text editor.One of the key things I found though is that I learned to compose tools outside of vi rather than rely on the editor functionality. This was applicable to much larger problem domains than just editing. The Unix philosophy of using lots of small well defined things to solve problems applies to editing text.
I still find myself reaching for Vim when I want to just write a simple script. Emacs, VS Code, etc. can just be too much sometimes.
It replaced vim on the cli for me.
I realised that if I'd started minimal I would have reinvented so many of the spacemacs wheels, but done it worse.
Spacemacs could do with being slightly more user friendly. It gives you a lot of friendliness already, but to prevent people from being frightened off by emacs' formidable reputation it really needs to "work" out of the box. For me that would be one click install and a reasonable suite of IDE-like features for working with a given language pre-configured. That would include scripting to install the command line tools that they shell out to, e.g. ag or rg.
I used to do this too. What stopped me was that I often use emacs as a terminal multiplexer with vterm, and it becomes super difficult to control vim if you have evil-mode capturing those same inputs. In the end oh-my-zsh (more crappy bloat like spacemacs which I love to bits) has an alias called "e" which will open a file for editing in your current emacs.
(If only it worked through docker! Or maybe it does and I just don't understand TRAMP well enough yet.)
My first serious Emacs engagement happened in 1996, with XEmacs. Then it became my editor of choice for basically two decades. I can confidently say that I can open your Emacs setup and manage my way around it (unless you happen to be an evil-mode infidel, that is).
The only reason I have not tried is I seem to spend most of my time thinking about the change, and the time saved is easily wiped out by the time taked to re-write the line 5 times.
The thing is with Emacs, you can really optimize every key stroke if you want, but usually I'm too busy using it to program so I optimize the workflow only time to time.
I didn't know about SelectiveUndo. Nice.
I think that Org-mode is now the fourth piece of software on my never-gonna-give-you-up list, after VIM, GNU coreutils, and Anki. I seem to add one per decade.
What kills me about emacs is the startup time. Breaks my flow when I'm jumping around and need to edit something quickly.
Though I'll admit that doom provides a very nice environment for when I want to play around with some lisp.
alias ec="emacsclient -n"
in my shell.)emacs --daemon
emacsclient <fie>
emacs --daemon=<name>
emacsclient -s <name>
Useful for when you have different contexts and want to separate them more cleanly. systemctl --user enable emacs.service # For next login
systemctl --user start emacs.service # launches it just this once
This means I never have to even THINK "I should boot the editor", because it's already ready.Add a keyboard shortcut for emacsclient and you're golden
But, yeah. I use it for the start up time/vim compatibility out of the box.
also, there's zile.
I appreciate the tip about zile though. That looks cool.
The maintainer of Doom responded with a good list of improvements that he uses in his distribution to achieve fast startup. If you transplant all of them into your configuration, your startup time would probably be 1-2 sec.
For me Emacs fulfills the same purpose as Vim, but mostly in exactly the opposite way of how I want it. Some people prefer that, I don't. It's a great program, but not my cup of tea and so I don't use it. Vim does everything I need without annoying or distracting me, which is rare enough.
Discoverability problem? You don't say?
Power comes from being able to customize - add a easy shortcut to show outline, add another to back to non-outlined. Then use these to jump around code.
This works even better with languages with varying form and spelling. Finnish Android autocomplete gives mostly annoying and mispelled suggestions, but in Emacs you can use your own writings as the sublime storage of words.
Actually, your question made me realize that the interesting part of vim is the modal editing interface, while the interesting part of emacs is everything but the text editing bits. So, focus on those.
Does that help, or have you already tried this?
https://www.youtube.com/playlist?list=PLGP2UnPoZ7HzLGU2cyK1M...
https://github.com/noctuid/evil-guide
https://www.spacemacs.org/doc/VIMUSERS.html
Best of luck!
I did implement all kinds of funky customisations at first, but in the last years I stuck mostly to what comes with Emacs, and customize over writing Elisp. I do some work in IntelliJ and Xcode out of necessity, but there's nothing quite as productive for me as vanilla Emacs and ansi-term. It's all just text - and mastering how to deal with text doesn't take that long, and is fairly universal.
One of my favourite and most trivial habits is to use forward/backward search extensively for navigating around a file.
I'm sure vim and emacs were great tools back when monochrome monitors were all that were available. But with modern UI IDEs and what not, I only use vim when need to make fast and dirty changes directly on the server. I do find all of things that can be done in emacs/vim quite impressive, but I'm also quite happy that it is not the tool I have to use because nothing else is available.
I do find myself getting environments backwards in my head though when flipping back and forth quickly. Like typing :wq in my IDE, or cmd-s in vim when prompts my terminal to save my session.
I know X can export over a network connection, but text mode Emacs is much simpler and does not require X.
It held up surprisingly well. The Emacs terminal display system dates from the days of low-baud terminal sessions and so decouples screen updates from the editing input. I.e., it's smart enough not to try to fully update the screen on every keystroke when the terminal connection is slow -- not unlike dropping video frames to keep up. So you can type ahead with some lag and know that it will bring the screen up-to-date as efficiently as possible whenever it can.
I do always have a spacemacs window open, but I only use it for magit.
I can recommend it to anyone that tried emacs but didn't like it.
What specific features of vscode would you like to see in a terminal editor?
In fact, in VIM, everything _is_ a shortcut.
Other than that, most VIM plugins are documented very well.
So to me, the "win" of vstudio is the tiny command pallete that is used & the shortcuts are displayed in menus. (& everyone mentions the difficult hill to climb to learn emacs or vim by comparison).
The thing which will never work in terminal is ctrl-c and ctrl-v. (Macos covers this nicely by using cmd-... tho). It's a shame.
I actually use le editor in terminal, but am rather cramped using it. I consider learning vim or emacs once every few years... and go... nah, no thanks.
Eg. There are a few comments above about region undo. In vstudio it sounds ugly, but it's trivially easy. Press and hold undo (ctrl-z) and let key repeat until the block appears as you want. Select it, copy. Press and hold redo. Select area. Paste.
Tastes are different.
If you enable cua-mode in Emacs, C-c and C-v work perfectly fine as copy and paste. Even in the terminal.
> There are a few comments above about region undo. In vstudio it sounds ugly, but it's trivially easy. Press and hold undo (ctrl-z) and let key repeat until the block appears as you want. Select it, copy. Press and hold redo. Select area. Paste.
That works in practically every editor. The entire point of region undo is that it's faster and more convenient than doing it manually.