Avy Can Do Anything
karthinks.com
karthinks.com
Upside: works anywhere, much lighter mental load, relatively easy to learn and adjust to.
Downside: some programs (ironically, mainly Emacs) can't keep up, and scrolling becomes choppy.
On Linux this is quite easy. When I was using Windows, there was no good solution for USB keyboards, so I hacked up a driver to do it: https://github.com/CyberShadow/KeyboardEmperor (signing keys not included).
also, you can reduce the delay so that repetitions start sooner. With some practice and care you can reduce the delay to about 0.15 seconds and learn to fly over your keyboard
xset r rate 150 255 # delay=150 (milliseconds) rate=255 (keys per second)
at this point it's faster and easier to click left arrow than ^A, but of course it's not for everybody...To see the default value use xset -q
Emacs’ biggest drawback is that you are never using it to the fullest—an issue this article makes painfully clear to me. I guess it’s time to break out my config and tweak it… for the third time today…
Nobody can ever do that, so it's pointless to ask.
(I suppose that if you built your own editor this might be true, but if you have your own plane then you're never early or late to your flight either.)
Either way other people using a tool or not using a tool shouldn't effect you doing the same.
Do you have a link about this by any chance?
See e.g. "unix, a history and a memoir" by Brian kernigan
That’s true of your phone (or every computer). It’s one of the manifold weaknesses of (shudder) Word.
I disagree, this is not a linear question. Emacs supports many different styles of working, and you aren't required to use anything to it's fullest. You might be using avy and other manipulation packages, or clicking around with the mouse (perhaps with your own commands bound to special kinds of mouse clicks) and it would be just as OK. You might always learn something tomorrow, but that shouldn't keep you from going on today.
I think that this is actually a strength.
If you're using your editor to its fullest, then that means that there's no more room for you to improve. If your editor is simple, then its "fullest" isn't very good. If your editor is complex, then it took you a long time to get to its "fullest", and you hit diminishing returns a while ago.
Emacs is great because the skill gap is ridiculously high, while the skill curve isn't very sharp (Emacs' modeless editing is straight-up easier to learn than vim's modal editing, whatever other people might say), so wherever you are, you can always learn a little bit more, and be a little bit more productive...or continue to work with what you have.
That is - you can stop learning Emacs exactly when you want to - no sooner, no later. If you have a relatively simple editing task, you can just start it up, use the arrow keys to navigate, then save and quit (three keybindings total? find-file, save-buffer, save-buffers-kill-terminal). If you're anticipating starting a career in programming, you can learn and improve your skill with it (and your config) continuously for decades. I don't know of any other tool that's as good at this as Emacs is.
On a tangent, I would propose to you that Emacs' greatest weakness is that it doesn't come configured out of the box. It's way easier to set up VSCode to do Python than it is Emacs, and that's going to be the final factor for a large fraction of programmers. If two editors are equally flexible (which isn't actually the case with Emacs vs. VSCode, but bear with me), the one with the better out-of-the-box experience will win. (and this is why I think that starter kits like Doom and Spacemacs are the only way for Emacs to survive)
I should have added a "/s" in there. :) I'm 100% with you on basically everything you've said. I totally agree that the biggest weakness is how bad the default Emacs experience is. I used vanilla Emacs in a terminal for years until I discovered I could install packages. What a world that opened up.
While Emacs doesn't have intelligent code awareness out of the box the way vscode does, its powers lie in providing out of the box commands to easily manipulate text.
To truly harness the power of emacs one has to get good good at thinking in terms of text. I tried org-mode but eventually realized emacs is actually restrictive when compared to using plain pen and paper.
Emacs definitely has its use cases, and is really in some way the original Perl. Or at least the Perl equivalent of a text buffer.
This is magical.
I know I could configure/use it for more stuff so I'll study TFA.
1. I try to use avy-goto-char-timer with an action. 2. The chosen char is the only one visible on the screen.
Then Avy just jumps to this single occurrence of the char without letting me specify the action.
Edit: Okay, I can switch this behavior off by setting avy-single-canditate-jump to false. Not bad.
I have the avy-goto-char-timer function bound to Cmd-j. If my buffer looks like this (cursor at |)
Foo |bar baz zoop quux
Then I can delete through zoop like this: d Cmd-j op
Since there’s only one candidate, it should delete the words to give me: Foo quux
Or something similar. Not at a computer atm, and I’m still getting used to this so there might be some inaccuracies.Totally love the aesthetics of the page.
The "flow charts" were made in Inkscape. No custom (ya)snippets are in use. (My Emacs configuration is linked to on the home page of the blog, but there isn't anything particularly interesting about it.)
VimScript is aweful, sure, but with Neovim Lua support, you can do a lot more in a decent and fast language. Emacs has some great plugins and good LSP support (Also, available in Neovim/Vim and also native treesitter support too). There is barely anything in Emacs at this moment that really justifies investing so much time into it.
Even with this post, as an experienced Vimmer, I could basically do everything they are doing here, without installing any plugin and remembering all those obscure keystrokes.
Also, Emacs folks downvoting this, tell me if my logic is wrong, you will come up with NADA.
I thought so too[1], but I am willing to give the blog author the benefit of the doubt (that Avy is the fastest way). It also seems to me that with Avy the process is a little more uniform and consistent than the way I would do it in Vim (only a little, though).
[1] In Vim, I would do the Filter->Select->Act cycle as *'/<pattern>qq<modify-pattern><esc>q'* and then use 'n@q' for each modification, or 'nn' to skip to the next modification.
For simple patterns (for example, adding a parameter to a function call) I won't even bother with the recording, I'll do a flurry of 'n.' or 'nn'.
No plugin org-mode like exports of all default org-mode export types in vim.
Just for reference:
https://orgmode.org/manual/Exporting.html
Looking forward to your youtube clip in a few years.
As someone who uses both, there are clear advantages to each one. A Vim power-user spending time learning Emacs will not be wasting their time (and vice-versa, of course).
IMO, Vim is slightly faster to use when you want to navigate the file, making changes as you go, while Emacs is slightly better at programmatically automating common tasks.
I hear this a lot, can you give some concrete examples?
I am really curious to know how Emacs and Vim fits in your daily workflow?
You can get a good example of what is possible by using org mode for a little while.
For example, keystroke <TAB> on an issue marked as TODO moves it to the next state IN-PROGRESS, <TAB> again moves it to the next state DONE and changes the color from red to green, and if you continue <TAB>ing you will cycle through all states.
That's the default 3 states.
If you don't like the default states, at the top of your file you can simply list the state progression in plain text like this:
#+TODO: TODO INVESTIGATING IN-PROGESS BLOCKED | DONE
And now your <TAB>ing will cycle through those states.
Another example of the programmability of Emacs is when editing tables in org mode - it's so painless and intuitive to have text tables with columns all aligned as you move to the next column or row. That's also behaviour that is not hardwired into Emacs, it's simply some sort of hook that's registered when org mode is set up.
As a final example, here's a snippet from my .emacs file:
; Set the postamble for org html export
; %t stands for the title.
; %a stands for the author's name.
; %e stands for the author's email.
; %d stands for the date.
; %c will be replaced by `org-html-creator-string'.
; %v will be replaced by `org-html-validation-link'.
; %T will be replaced by the export time.
; %C will be replaced by the last modification time.
(setq org-html-postamble-format
'(("en" "<p class=\"author\">Author: %a</p>
<p class=\"date\">Date: %C</p>
<p class=\"creator\">Powered by %c</p>
<p class=\"validation\">%v</p>")))
(setq org-html-postamble '(("en" "<p class=\"author\">Author: %a</p>
<p class=\"date\">Date: %C</p>
<p class=\"creator\">Powered by %c</p>
<p class=\"validation\">%v</p>")))
Those are callbacks - you don't get any more programmability than telling the application "call me back when the user requests an export, but only for HTML use these functions".> I am really curious to know how Emacs and Vim fits in your daily workflow?
I use Vim primarily for writing code and code navigation. I use Emacs primarily for writing text and text navigation (for example, Emacs shortcuts for paragraph formatting and navigation are great (C-u M-q)). Emacs org mode is also great for maintaining tasklists, time-spent on tasks (it calculates that for you using a date-picker), reorganising the task hierarchy, etc.
Vim, even with plugins, doesn't come close to org mode.
- Have you ever used Vimwiki? I know it is no org-mode, but even I am a regular notetaker and I never felt it really lacked in anything, but yeah, it doesn't have task planning.