I was quite content with Emacs, especially with Markdown and Org modes. But then I started to develop a web application, and it became obvious, that a standard Emacs sucks in many ways:
- Switching between buffers, the order of the buffers always changes
- Moving through the text and editing files
The answer to the first issue can be a fuzzy finder, regarding the second issue the answer is called modal editing which is impemented in Vim, notably. Emacs has several advantages, though:
- Highly intellectual editing, most of all I like editing links and tables in Org and Markdown modes
- Very good 'monolythic' modes for any language
If you want to use these advantages, you could install... a few more modes. But in this article I'd like to look further. Maybe we could use Neovim or some other editor for programming? Before we start, I'd like to mention a few points:
- If you start from scratch, maybe the first article about Vim and Emacs configs could be useful for you
- I created a git repo with my configs, for reference
First, we activate projectile to be able to navigate within the project:
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(setq ido-ignore-buffers '("\\` " "^\*"))
(setq ido-ignore-files '("^\#" "\~$"))
I added some lines to ignore backup files Emacs creates. And we also make ibuffer default:
(defalias 'list-buffers 'ibuffer)
Now we are ready to activate evil-mode, which emulates Vim:
And jumping between lines is easier with relative numbers:
(setq display-line-numbers-type 'relative)
"It ain't much, but it's honest work." © I still don't feel comfortable though.
I used vim a lot, but I can't get rid of a thought that it's not logical. You could change the keystrokes, but I mean the deeper logic for the editor, it feels that it's just absent sometimes. Could it be better?
And I also have some doubts regarding Emacs. Do we really need a Lisp environment just to write texts? Doesn't it get bloated with all that extensions? Evil mode works quite well, but does it seem alien to the whole logic of Emacs?
Could we have just a simple editor, maybe lacking some features, but with a more holistic approach? An editor, which would not require to search for plugins and install them and then finding where these plugins conflict with each other? Maybe an editor, which could be written with modern achievement like language and the whole idea of modern text editing and writing programs?
Well, if you don't need LSPs and modal editing, maybe you could go with micro. It has themes and plugins.
Helix has been there for a while, and this video includes a good explanation of differences with vim. It doesn't explain though, that helix lacks some features, like jumping between sentences (maybe because it's a programming editor, first of all), and it lacks snippets. But based on idea in this video even a looser like me can write a bash script to insert some HTML and Markdown. After using it for a while, I have some thoughts to share:
- It's more logical, than vim, and 'modes' are just to explain the logic behind the keystrokes
- I struggle switching from vim with some keystrokes, especially 'x', which is 'select line' in helix
- It's great that's it rather simple, so you don't get too frustrated studing it
With all that said, it's a lot of fun editing files in Helix. As a user I can't say how the fact that's it's written in Rust makes it better, I don't think Emacs is slow, although it's been criticised for that. It's more user-friendly, than Emacs, and a lot user-friendly, than vim, but these friendly features don't prevent you from beeing fast and highly effective. If you don't need information in these pop-ups, you could just ignore them and nothing will happen.
If you use tmux, don't forget to put this into your tmux.config:
set -sg escape-time 0