Remix.run Logo
▲ rmunn 3 hours ago

The two things about Emacs I would love if I used it (tried twice, bounced HARD off the keyboard controls both times. I hate modifer+key control schemes — give me modal editing any day — and I don't even have RSI!) are magit and org-mode. I've never tried magit so I don't know if lazygit is a decent substitute. But for org-mode in Neovim, there's https://github.com/nvim-neorg/neorg. I'm sure it's only a partial, half-broken implementation of the real org-mode, but it covers the parts that I need most, structured note taking.

If you're a diehard modal-editing aficionado like me and think that Emacs is a great IDE but it's a shame about its editor (and its keyboard scheme), maybe give neorg a try. Might well make you shift away from notes.txt files.

And yes, I know I could just use `evil` in Emacs. Maybe someday I'll overcome my decades of learned resistance to running Emacs, but every time I see the Emacs control scheme, I wince and I'm reminded why I don't use it. Having some key combos be "hold down the Control key while you press two keys" (like `C-x C-s` to save a file) while other key combos are "hold down the Control key while you press one key, then release it before pressing the second key" (like `C-x s` to save all files) is just not going to fit into my brain. Maybe that's intuitive for some people, but it just doesn't work for me. And so I bounce off Emacs before ever giving it a real chance.

▲flaunf221 2 hours ago | parent | next [-]

Keyboard control schemes annoy me a lot, because most of them can be described as "draft of a potentially good idea that became holy book and engineering was forgotten".

For example - let's put "go all the way to the right" on the left button. And "go all the way to the left on the combo of modifier with right button". I'm talking about 0 and $ (Shift+4) for vi. It's not consistent, it's not ergonomic or easy to input when properly touch typing. It's almost an accidental control scheme because it was based on no longer existing keyboard keycap labels. And in this case where you can't even exit vi without first reading a manual, half an hour reduction in learning time that you get from remembering that `i` is Insert will not compensate for hundreds or thousands hours using later when you will be pressing button not by looking at keyboard but by muscle memory.

▲rmunn an hour ago | parent | next [-]

Huh, I never noticed that 0 is on the right side of the keyboard, even though obviously I type it every day so I knew that at some level. Because I think of the vi keybindings by their meaning, not their location. `y` is yank, `d` is delete (and copy to the clipboard, so basically cut, but the mnemonic is delete), and `0` is go to column 0. And `$` means end of string in regex, so that's what it means in vi. (And `^` is the vi shortcut for "go to first non-whitespace column", which is close enough to the regex meaning that I find it easy to remember as well).

Yeah, if keyboard positioning matters to your brain then you're going to be really annoyed by 0, a key far to the right, meaning go to the left. But the only vi keystrokes that are assigned by keyboard position rather than meaning are the h/j/k/l navigation keys. Everything else has a meaning-based mnemonic, and until I read your post I hadn't ever thought about their position. I want to press 0, my touch-typing class from my teenage years has drilled that key's location into my hindbrain, so my fingers reach up and press it without thinking about its location at all. The only thing that went through my concious mind was "I want to go to column 0" and then boom, I had typed it.

▲flaunf221 5 minutes ago | parent [-]

> Everything else has a meaning-based mnemonic, and until I read your post I hadn't ever thought about their position

My point is that position is the primary thing that's important for an editor when used for a long time. Your hands and fingers move in physical space, not over alphabet. They get tired and maybe get repetitive strain injuries over real movement.

Mnemomics way of setting up keyboard layout (or rather typewriter) would be to put everything in alphabet order. But we quickly realized that it's not a good way. `d` is where it is because according to (imperfect) research it's a common letter and so in QWERTY layout this letter should be on your home row.

Putting A-something on `a` because the word starts with `a` is not a long term design. Considerations should be based on usage. How often is this used? Put it closer to home row. Is it designed to be often used with another command? If often, those two probably shouldn't be on single finger. And so on.

There is argument for easier start - except that I said already - modal editors are unusable without reading docs first, so that argument doesn't really hold.

▲msdz an hour ago | parent | prev | next [-]

Have you heard of/tried using Helix [0]?

It’s a modal editor, so the basic vi/vim motions are of course there almost by necessity, but then it does a drastic shift to actions that were indeed engineered and thought-through intentionally, instead of being made up long ago and then accepted as gospel (love the analogy, by the way).

It’s now my favorite editor by far (not just because of how you use it to shuffle text around, but that is a big part of it), and has solved many of the gripes I had had with trying not to learn the basics, but getting really “at home” with standard vi/vim/neovim controls.

Your example would be <g-h> and <g-l> instead of 0 and $, which I find highly intuitive: Reuse the known left/right motion for a character, and prepend it with a “goto” to signify the whole line.

[0] https://helix-editor.com, also see default keymap: https://docs.helix-editor.com/keymap.html

▲precompute an hour ago | parent | prev [-]

This is fixable if you introduce another abstraction layer: a small split kb :)

0/$ doesn't matter when they're both one layer down.

▲tmtvl 3 hours ago | parent | prev | next [-]

For modal editing there's also meow, god mode, and devil. Personally I quite dislike modal editing because of how you have to work very, very slowly and smash every key to make sure you don't accidentally do something like delete half the file, save, and quit; but I do have escape bound to god-local-mode for those rare times I need a long chain of chords. M-x some-command is usually good enough for me when I can't be bothered to memorise the chord, though.

▲precompute 3 hours ago | parent | prev [-]

You should try using evil again. I use it full-time and 90% of my non-web-browsing work is in Emacs (the other 9% is in the terminal). It's very stable and IMO more full-featured than plain vim. In time you'll pick up some native emacs shortcuts to simplify your life but you'll still have modal editing everywhere. Best of both worlds.

▲rmunn 3 hours ago | parent | next [-]

Emacs is definitely more full-featured than plain vim. But for me, I wouldn't be switching to it from plain vim, I'd be switching to it from a LazyVim setup. Which I've barely had to configure: it's an IDE straight out of the box. And to get that IDE setup back in Emacs, I'd have to learn which Emacs plugins do what, reconfigure several plugins' default keystrokes to match what LazyVim did because those are in my muscle memory now... it's a big effort. I won't rule out doing it someday, but for now it costs too much in lost productivity while I'm trying to get work done. Maybe sometime when I'm on vacation, and the temporarily-lost productivity doesn't cost as much.

But NeoVim has made writing plugins so much easier, even things like editing Lisp are getting not too bad. https://github.com/Olical/conjure has been a pretty decent substitute for SLIME, there's a paredit implementation that works well, and so on. So the need to switch is lower and lower, and the cost of switching stays high-ish, and so I haven't done it yet. Someday, as I said, I'll give it a shot.

P.S. I would be remiss in recommending LazyVim if I didn't at least once mention the really, really good https://lazyvim-ambitious-devs.phillips.codes/ book, which you can read online entirely for free. It's an excellent resource to learn LazyVim and what it adds to a vanilla NeoVim installation.

▲tecoholic 2 hours ago | parent | next [-]

Let me share 2 words - Doom Emacs, Spacemacs.

▲precompute an hour ago | parent | prev [-]

You're right. Using vanilla emacs as an IDE means configuring evil, eglot and window management. You can use doom/spacemacs but they hinder future customizability because you'll be fighting against your config and doom's upstream changes.

Conjure looks great but IMO it's not a 1:1 substitute for tight coupling between editor functionality and internal tooling. If neovim gets 80% of the way to a productive coding setup then emacs helps hone that last 20%.

▲ 3 hours ago | parent | prev | next [-]
[deleted]
▲precompute an hour ago | parent | prev [-]

I wrote the following in response to a comment that was deleted before I could post my reply.

> Do you have any examples of these Emacs shortcuts that simplify your life?

> I tried using Emacs with Evil but I was just using it as a somewhat laggier Vim.

Learning how to use prefix arguments and writing interactive functions have been very useful. Whenever I want functionality that's just a little different than what Emacs provides, I can always write a function and bind it.

Emacs also comes with regional undo/redo and has great undo tree visualization plugins.

Another feature I've come to appreciate recently is the built-in per-frame and per-window tabs. I moved from using separate frames to using tabs. Tabs inside tabs lets you visit many files at once while keeping visual clutter to a minimum. (In Emacs parlance, a "frame" is the window your WM handles, and a "window" is a visible child of that frame)

Also, outline-minor-mode is really nice for annotating files with headings. You can define custom regexp and sidestep collaboration restrictions and quirky formatting.

The calc is super-useful.

file-local variables are useful. directory-local variables are incredible, they set up custom environments for all folders at the same level / below them. Imagine doing a (let) but over a directory structure.

Vim has default C-p completion. Emacs has hippy-expand, which IMO is better. Some glue around hippie-expand can also make it work with a drop-down completion interface like corfu.

Some examples:

In tab-bar-mode the tab nav functions don't wrap around. So I wrote a small wrapper around the tab nav functions. It's about 10 lines of elisp and handles forward, backward and tab creation. For neovim this would've been much more difficult. In emacs it involves basic functions: interactive, let and cond.

I have a small package that opens new scratch buffers and inherits the major-mode of the buffer it was invoked from. Very useful to write temporary code. One shortcut and it always works.

I have a function that opens all dired selected files in a new tab/frame. Great for organization. Basically you open dired, mark files and run the commands, and they're open in a new tab, and all marks are unmarked. So you can very quickly structure a project for work.

Another function that moves forward/backward to the next logical file. Saves me a trip to find-file / dired.

I have a monorepo that I code in and it has different folders for different languages / folders. Because it's a monorepo, file completion shows ALL files in the monorepo. And running a LSP server also starts at the monorepo root, which is not ideal. With directory-local variables, I can set a custom file (like .gitignore) to denote a repo root. So emacs (and LSP servers via Eglot) will consider the presence of that file the repo root and make it work like an independent repo. ((nil . ((project-vc-extra-root-markers . (".gitignore")))))

(I've been using Emacs longer than I used vim, so my experience is skewed. I also used it as a laggy vim (Doom Emacs) for the first few years, and then moved to a custom config, which helped me really understand what was happening under the hood)

Perhaps there is a vim plugin for each one of these; but I certainly wouldn't be able to do ALL of these by myself in vim! Also because many of these are built-in emacs functions, they're guaranteed to be supported for a very long time.