💾 Archived View for dioskouroi.xyz › thread › 29412806 captured on 2021-12-04 at 18:04:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

➡️ Next capture (2021-12-05)

🚧 View Differences

-=-=-=-=-=-=-

Avy Can Do Anything

Author: signa11

Score: 167

Comments: 50

Date: 2021-12-02 05:19:07

Web Link

________________________________________________________________________________

CyberShadow wrote at 2021-12-03 07:54:09:

I found a different solution to the "getting around the screen" problem: set your keyboard repeat rate to 100 keys/s.

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).

layer8 wrote at 2021-12-03 11:12:14:

Incidentally, high keyboard repeat rates is an important reason why I prefer spaces over tabs —- so that the horizontal cursor speed remains constant. (I’m serious.)

enriquto wrote at 2021-12-03 09:34:19:

> set your keyboard repeat rate to 100 keys/s.

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...

mssdvd wrote at 2021-12-03 10:13:35:

If you are on sway you can do the same:

https://wiki.archlinux.org/title/Sway#Typematic_delay_and_ra...

To see the default value use xset -q

r-zip wrote at 2021-12-03 14:21:59:

I found Emacs could keep up after the gccemacs update.

ashton314 wrote at 2021-12-03 04:47:50:

I once had someone tell me that they could edit text faster with a mouse than I could from the keyboard with Emacs. I should send this article to them. Smh

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…

thewakalix wrote at 2021-12-03 05:17:40:

Umeshism: "If you're using all the features of your editor, you're not using a good enough editor."

andi999 wrote at 2021-12-03 06:03:49:

Wait.. Emacs is an editor?

yjftsjthsd-h wrote at 2021-12-03 07:16:32:

Remember, UNIX was born as a typesetting system; apparently, many great OSs start with text editing;)

riskneutral wrote at 2021-12-03 07:28:48:

> UNIX was born as a typesetting system

Do you have a link about this by any chance?

linschn wrote at 2021-12-03 07:30:56:

This is a simplification of Unix history, but is in accordance with the fact that the first eager knon programmer) users of Unix were the people typing patents applications at Bell Labs.

See e.g. "unix, a history and a memoir" by Brian kernigan

yjftsjthsd-h wrote at 2021-12-03 07:45:47:

I was thinking of it being sold to management as a typesetting system because Bell didn't do OS development. Unfortunately I don't have a reference immediately at hand.

kqr wrote at 2021-12-03 11:00:21:

That's funny. Not at all related but the Sidewinder heat-seeking missile got its budget from the fuses department, because it was "an intelligent fuse". (That's where it got its budget, but formally it was sold to management as "a rocket with fire control inside" because China Lake was allowed to work on rockets and fire control – they were expressly forbidden to work on guided missiles.)

daptaq wrote at 2021-12-03 07:32:59:

Maybe

https://www.bell-labs.com/usr/dmr/www/hist.html

might help.

Buttons840 wrote at 2021-12-03 18:10:21:

No, Emacs _has_ an editor. If you're using Evil it even has a good one. ;)

jayceekay wrote at 2021-12-03 05:46:00:

What if you're using neovim with all its possible plugins and moving like a god. It's given neovim is the best editor. What then?

thewakalix wrote at 2021-12-03 05:51:39:

"What if you simply arrive at the perfect time to every flight, neither too early nor too late?"

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.)

kamaal wrote at 2021-12-03 06:22:48:

Use what you can to get work done.

Either way other people using a tool or not using a tool shouldn't effect you doing the same.

throw10920 wrote at 2021-12-03 19:52:11:

> Emacs’ biggest drawback is that you are never using it to the fullest

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)

daptaq wrote at 2021-12-03 07:34:57:

> Emacs’ biggest drawback is that you are never using it to the fullest

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.

gumby wrote at 2021-12-03 06:59:23:

> Emacs’ biggest drawback is that you are never using it to the fullest

That’s true of your phone (or every computer). It’s one of the manifold weaknesses of (_shudder_) Word.

jsilence wrote at 2021-12-03 12:55:03:

Isn't that slogan applied to the brain the catchphrase of Scientology?

gumby wrote at 2021-12-03 17:26:45:

Woah, really?? The only things I know about Scientology are SF writer on boat, snakes, something is called an e-meter, someth8ng about volcanos, and that they harassed my friend Keith for years.

chungus wrote at 2021-12-03 09:58:47:

Oh man I had no idea you could perform actions with avy! Also didn't know you could jump between different screens. All I did was jump to spots, do something, then jump back. The teleport thing is going to be fun: "get over here" _yanks line_

jwr wrote at 2021-12-03 09:56:21:

Hmm. I think I might be missing something — I've been using ace-jump to jump to any character for years now. I tried avy and it is significantly less efficient, requiring me to type 4 characters instead of 1 or 2 with ace-jump.

dgarrett wrote at 2021-12-03 17:52:58:

I'm very much new with emacs, but maybe `avy-goto-char-2` is what you're looking for?

TacticalCoder wrote at 2021-12-03 07:36:19:

I've got my _avy_ configured to jump around by never using the pinkies. I use _avy_ to move to any char in any Emacs "windows" and I also use it very extensively for many "menus" / drop-down lists, to quickly jump to a selection. For example I use it with _counsel_ (from the same author, as mentioned in TFA), say I open the list of recently opened-file, I'll then "avy" to the one I want to re-open. Or I _counsel-rg_ (calling _ripgrep_ from Emacs, with the candidates shown using _counsel_): then I visually pick the one I want and I "avy" to it.

This is magical.

I know I could configure/use it for more stuff so I'll study TFA.

ashton314 wrote at 2021-12-03 17:28:22:

I just tried this out in conjunction with evil-mode and… it's perfect. `d <avy-jump command>` will delete from your cursor to the point you jump to. Might not be everyone's cup of tea, but boy is this going to be fun for me to use!

bostonvaulter2 wrote at 2021-12-03 18:46:13:

Can you give a specific example? What do you mean by `<avy-jump command>`?

ashton314 wrote at 2021-12-03 19:21:57:

Let’s see if I can explain it…

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.

praptak wrote at 2021-12-03 09:59:03:

So I tried Avy actions and they do look promising. I hit a nasty speed bump though. When the following conditions hold:

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.

kamaal wrote at 2021-12-03 05:13:22:

Emacs really is an automation tool for text buffers/palette, the fact that code is text too is just incidental. Other wise the kind of tasks emacs is better suited for is changing text programmatically.

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.

minimilian wrote at 2021-12-03 13:25:34:

I've tried Avy a bit, but I prefer displaying line numbers and jumping with Evil. While the former needs typing, looking, and typing again, the latter requires only looking and typing.

nickysielicki wrote at 2021-12-03 16:42:17:

The collection of abo-abo tools creates an editing experience that rivals modal editors in navigation speed, I think everyone should try it once.

wiresurfer wrote at 2021-12-03 11:34:14:

out of curiosity, if the blog post itself an org-mode output?

if yes then :

1. What tools did you use for the images?

2. That's a neat sidebar. custom ya-snippets?

3. Would love to take a leaf out of your dotfiles/.emacsd

Totally love the aesthetics of the page.

karthink wrote at 2021-12-03 15:18:46:

Thanks. The blog is generated by Hugo from org using ox-hugo[1]. The sidebar is part of the Hugo Cactus theme[2], which I modified a bit for my use.

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.)

[1]

https://ox-hugo.scripter.co/

[2]

https://themes.gohugo.io/themes/hugo-theme-cactus/

bloopernova wrote at 2021-12-03 13:25:44:

If you do find out how the page is translated from org to the html/css we see, could you please let me know? I agree about the page, I think it looks great.

mundanevoice wrote at 2021-12-03 08:18:40:

Just use Vim and learn modal editing, all this hassle for so little benefit.

countmora wrote at 2021-12-03 09:04:55:

As someone who has only experience with vim and not Emacs, are there any advantages to Emacs or is it just „different“?

lelanthran wrote at 2021-12-03 09:44:14:

> As someone who has only experience with vim and not Emacs, are there any advantages to Emacs or is it just „different“?

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.

mundanevoice wrote at 2021-12-03 09:50:35:

> 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?

lelanthran wrote at 2021-12-03 10:26:46:

> I hear this a lot, can you give some concrete examples?

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.

mundanevoice wrote at 2021-12-03 10:33:07:

I have heard many good things about org-mode.

Question:

- 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.

ralls_ebfe wrote at 2021-12-03 11:09:46:

If you use Emacs for email or reading PDF files, you can have links in your org files which open the linked email/pdf page inside of emacs.

lelanthran wrote at 2021-12-03 11:14:23:

I've used VimWiki, and org mode was an upgrade :-)

mundanevoice wrote at 2021-12-03 09:43:20:

Well, Emacs is incredibly powerful, but it is just too much work to do anything, even regarding keystrokes and all the chords you have to remember. I have worked on Emacs too, but sometimes it is just not worth investing so much time and energy in Emacs if you can spend much fewer time in Vim and get a lot more done.

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.

lelanthran wrote at 2021-12-03 10:01:18:

> 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.

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'.

ungamed wrote at 2021-12-03 11:46:11:

Let me start with the singular most obvious.

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.

bloopernova wrote at 2021-12-03 13:34:55:

I think you're being downvoted for the tone of your post. It comes across as sneering and argumentative for no reason.

vharish wrote at 2021-12-03 17:05:43:

I think Emacs is more like Lego. Vim doesn't quite feel so.