Threads for nickspoon

  1. 3

    Very thorough article! I’d be interested in an updated version.

    3 years isn’t that long but in that time LSP has “happened”, so I would rather use an LSP server for actual code editing so I get a consistent experience with editing other languages. I should be able to edit lisp using the same LSP client (vim-lsp, ALE, neovim native LSP etc.) and therefore the same mappings I use in e.g python and typescript, to get completions, go to definition, find references, semantic highlighting (although this is presumably much simpler and easier to do with regex in lisp than lots of other languages).

    The really interesting stuff (to me) in the article is about the REPL integrations and debugging, so having that decoupled from the editing support would be very interesting.

    1. 21

      Even worse, Lenovo is claiming, rightly or wrongly, that this is a contractual obligation by MS. https://download.lenovo.com/pccbbs/mobiles_pdf/Enable_Secure_Boot_for_Linux_Secured-core_PCs.pdf

      1. 24

        Got to give Lenovo some credit for how they complied, though. They could have made it so you would have to go through a complicated process of adding the keys you need to boot anything other than Windows. But they put a simple toggle switch to enable the most common case (you are booting a Linux distribution that uses the Microsoft 3rd party shim for secure boot).

        1. 14

          Why are you disrupting the daily “Five minutes of hate for corporate America?”

          1. 14

            To be fair, that’d be corporate China you’d be hating on.

            1. 1

              Is M$ a Chinese company now?

              1. 17

                Microsoft isn’t, but Lenovo is.

                1. 1

                  And the complaint is about M$ forcing their crap onto a HW vendor. I cannot imagine Lenovo doing this on their own. There is no money in that.

                  1. 7

                    I mean, for all we know, Lenovo might be getting a good deal out of this as well – sure, there may be no money to be taken straight from customers for it, but that’s not the only source of money nor the only metric for a good deal. Just because it was a contractual obligation (if it was) doesn’t mean it was a bad deal or that Lenovo were forced to make it.

                    Not sayin’ you’re not right to suspect Microsoft being nasty here, just that I’ve found it best to distribute suspicion evenly (and in very generous amounts :-D) among corporate actors.

            2. 9

              Well, I will say that assuming this was actually a contractual obligation, the culpability is on Microsoft, and Lenovo did the best they could. I’m not letting Microsoft off the hook at all here.

              1. 0

                Because some tech people still work at M$ for some reason. It’s mind boggling how legions of people who dedicate their life to understanding technology end up creating walled gardens.

                1. 11

                  I don’t think it’s that mind boggling. Creating walled gardens is lucrative and M$ pays pretty okay.

                  1. 2

                    Ok. One shouldn’t be surprised by people being willing to do questionable things for money. But this is literally working on something that they are probably going to be working around one or two employers later.

                    Or is it different in the US? Is it like really simple to just call one of your friends at M$ and get them cooperating, unlike from EU?

                    1. 4

                      The overwhelming majority of developers in the world will not be effected by this. It’s not like a .NET developer is going to go out of their way to replace the OS on their work laptop.

                      1. 2

                        I have done exactly that and it’s great for me, and actually great for my company, to have at least one person who knows their way around a linux machine (my system dependencies better match cloud dependencies and build chains, if nothing else). And dotnet works really well natively on linux now.

                        I would hope that developers as a group are curious enough that this is pretty common. Realistically I’m sure that the “majority” will only ever use Windows but I like to think and hope it’s not the “overwhelming majority”.

                      2. 3

                        But this is literally working on something that they are probably going to be working around one or two employers later.

                        I think you’re wildly overestimating how many developers will ever voluntarily try to run linux on a laptop (as opposed to a server).

                        1. 5

                          While not fully representative, almost every year the Stack Overflow survey has Linux on personal machines around the 30% ballpark.

                    2. 3

                      It’s not like M$ is somehow worse than all the other big tech companies. I’m sure one could quibble over details, but at a high-level, I’d argue they are all basically the same in terms of walled-garden love.

                      1. 4

                        Sure, but M$ walling off the general purpose computer segment would affect me way more than Google with Apple claiming the phone segment. I make a living off Linux on my (and some of my clients’) productive general purpose computers after all.

                        And I am surprised that other devs don’t mind. I though the idea was that we are the ones who could always walk away and disrupt as much as we’d like.

                        If this continues, we won’t be able to install Linux and Kodi on a NUC to provide 4k video for the occasional movie screening in our favorite coffee. It would have to be Windows. Meaning, among other things, no SSH remote administration, license fees, reboots in the middle of the movie and so on.

                        We’d have to buy either underpowered RPis or some unlocked industrial devices at much higher price point.

                        Or my aunt’s laptop. She can’t afford a new one, so she has an old Lenovo with Linux. Making the device useful for couple more years. Do we just throw them away once the Windows support ends? Or do we run insecure and/or slow devices?

                        I kinda like how things are now. The freedom of compatible hardware and software without artificial barriers is just more productive.

                        1. 4

                          I generally agree with you, I think it’s a bad precedent and I don’t like where it’s going either.

                          Security being used to enforce stupid things is bad for everyone, not just us that want to run non-Windows.

                          The part I don’t really agree with is that Google or Apple’s or …’s influence is somehow not as bad, they are, just in different ways.

                          1. 1

                            I think that in the past couple of years the general awareness of embedded computing skyrocketed. Thanks to Arduino, RPi and many others.

                            I believe that I will get my Linux phone eventually. Who knows what happens from there?

                            PC lockdown is a trend in the other direction.

                      2. 1

                        For the record, I agree with the “unkind” assessment of my comment, but I was definitely not trolling.

                        I truly believe that people who help build these walled gardens should think about harm they are doing instead of just throwing arms up in the air “it’s just a job”.

                  2. 14

                    IMO this requirement is entirely reasonable. I think it’s more important for a company to provide strong defaults for the majority of its customers than to make things easy for competitors, and that shouldn’t change just because a company is the dominant player. Notice I said defaults, not forced restrictions. Booting an alternative OS is an esoteric task that only a tiny percentage of PC customers will ever do, and I think it’s fine to require such customers to tweak a security setting in their firmware, particularly since they don’t have to disable Secure Boot altogether. Defaults can never be perfect for everyone, but I think that having the strongest security by default for the majority of users is the right call here.

                    1. 10

                      I doubt that it would be legal in Norway: Lock-in mechanisms (innelåsende mekanismer), hereunder missing compatibility, is unfair according to Forbrukertilsynet.

                      If you don’t know Forbrukertilsynet, they were the first to forbid DRM on music, for similar reasons.

                      1. 4

                        Do they forbid DRM on video?

                        Regarding this article, I don’t think that this is a real lock-in mechanism. It is a simple toggle to enable the shim and also another toggle that can disable secure boot altogether. I don’t think it is a lock-in to require a few keypresses to change some settings when the default is argubly more secure.

                        1. 1

                          Yes, video shouldn’t be any different. Famously, as DVD-Jon found out, it’s not illegal to break DRM. Note that this is specifically about bought music and bought video.

                          I don’t think it is a lock-in to require a few keypresses to change some settings when the default is argubly more secure.

                          That sounds like a key point. But it also depends on their informational obligations: How many expectations are broken, and do you need to be Matthew Garrett to debug it? I don’t think I could have guessed “the 3rd party key” if I hadn’t read the news today. If you can’t do it with the knowledge that can be expected of a customer, well, that’s a dark pattern, which is also forbidden.

                          1. 4

                            I should add what I feel the law should be similar to the concept where they are required to allow it to be easily turned off so the user can actually own the machine, while at the same time be required to fix any issues that come up for that device during the lifetime + some extra duration of it (so no disabling of the functionality ten years later).

                            So installing your own operating system doesn’t violate the warranty, and the warranty of a fitness for purpose includes fixing any issues booting up the device using third party software - so if you have a disk with debian on it that boots on a few other contemporary machines but doesn’t on this particular laptop - or even better multiple separate machines all being this laptop - then they are required to fix it.

                            1. 4

                              I think EU might be slowly getting there with the sideloading mandate. I don’t think they will explicitly cover different OSes, but the wording might be loose enough for courts to pry it wide open. Also, FSFE is probably lobbying as much as possible to include the OSes explicitly.

                              1. 2

                                I’m convinced they’re in as well, I’m not very hopeful. It’s going to include too many holes. If you think FSFE is lobbying, what do you think MS is doing? They’ve been proven that they abuse their monopoly and that they don’t stop on “lobbying” and go straight for bribe and corruption.

                                EU might get the doors cracked a little. But wide open? I’m not hopeful.

                      2. 3

                        As the article states though, turning the 3rd-party signing key toggle on by default would not weaken the security model.

                        1. 3

                          I think requiring users to install their own security keys in order to install Linux would be unreasonable. But IMO, having to change one toggle switch in the BIOS is fine.

                          1. 3

                            Yeah, I mean, slippery slope and all, but the first time I installed Linux on my computer like 20 years ago I had to fiddle with way more BIOS settings than a toggle switch. As long as I don’t have to recite incantations at the EFI shell, this just falls under the old “tinker with your machine until you get to the login prompt” dance that I do about twice during a laptop’s useful life.

                      1. 3

                        The RPi 400 was still in stock recently — it’s a slightly-overclocked RPi 4 built into a keyboard. I bought one from SparkFun in April.

                        1. 4

                          The 400 is worth it IMHO, relative to the plain rpi4. The whole keyboard acts as passive heatsink. It outperforms rpi4 with fancy cooling solutions. And it is cheaper than these rpi4 after you add the cost of the cooling solutions.

                          1. 3

                            I hadn’t heard this before and had been looking into cooling cases for an rpi4. So I had a quick search and found this article, really interesting that yes, the rpi400 stays passively cooler than the rpi4 in an active Argon case. Awesome!

                            https://tutorial.cytron.io/2020/11/02/raspberry-pi-400-thermal-performance/

                            1. 1

                              apart from the looks / space required that is actually a good argument for taking it as “homeserver”

                            2. 3

                              Plus, where else are you going to find a keyboard with a raspberry key?

                              1. 1

                                Here’s one that doesn’t have a pi built-in: https://www.raspberrypi.com/products/raspberry-pi-keyboard-and-hub/

                            3. 1

                              Microcenter has those in stock locally here right now, too.

                            1. 3

                              I started out with vim-wiki, then decided I only needed a very minimal subset of features and moved to vim-waikiki for simple and easy markdown formatted note management.

                              I have my notes in a git repo backing a man.sr.ht site, which is exactly that: a git-based wiki. It gives me an easy front end for reading notes in the browser. The downside is of course that there’s no remote note editing. Fine for my needs though.

                              1. 11

                                Oh, I have quite a few!

                                For shell aliases and functions:

                                vg: Shell function to open grep results directly in Vim using the quickfix. A bit of expounding here, in a small blog post.

                                • rg foo (with ripgrep) to simply view results
                                • vg foo to use the results as a jumping point for editing/exploring in Vim.

                                A ton of aliases to shorten frequently used commands. Few examples:

                                • When I want to sync a Git repo, I run gf to fetch, glf to review the fetched commits, then gm to merge. git pull if I’m lazy and want to automatically merge without reviewing
                                • glp to review new local commits before pushing with gp. Both glf (“git log for fetch”) and glp (“git log for push”) are convenient because my shell prompt shows me when I’m ahead or behind a remote branch: https://files.emnace.org/Photos/git-prompt.png
                                • tl to list tmux sessions, then ta session to attach to one. I name tmux sessions with different first letters if I can help it, so instead of doing ta org or ta config, I can be as short as ta o and ta c

                                Also, “aliases” for Git operations that I relegate to Fugitive. Technically these are shell functions, but they exist mostly just to shorten frequently used commands.

                                • Instead of gs for git status, I do vs and open the interactive status screen from Fugitive (which after a recent-ish update a few years ago, is very Magit-like, if you’re more familiar).
                                • When I’m faced with a merge conflict, I do vm to immediately open Vim targeting all the merge conflicts. The quickfix is populated, and I jump across conflicts with [n and ]n thanks to a reduced version of vim-unimpaired.

                                For scripts:

                                First off, an easy way to manage my PATH scripts: binify my scripts so they go into PATH, binedit if I need to make a quick edit.

                                ez: Probably my favorite one. A script to run FZF, fuzzy-find file names, and open my editor for those files. Robust against whitespaces and other special characters. I also have a short blog post expounding on it.

                                watchrun: A convenience command to watch paths with inotifywait and run a command for each changed file. For example, watchrun src -- ctags -a to incrementally update a tags file.

                                notify-exit: Run a command and shoot off a libnotify notification if it finishes (whether with a successful exit code or not). I have it aliased to n for brevity (using a symlink). For example, n yarn build to kick off a long-running build and be notified when it’s done.

                                • Also, a remote counterpart rnotify-exit, which I have aliased to rn (using a symlink). For example, rn ian@hostname yarn build on a remote machine (within my LAN) to kick off a build, and have it still notify on my laptop.

                                And a slew of scripts that are a bit more integrated with tools I use, e.g.:

                                I normally keep these in fixed locations, so everything I’ve accrued naturally over the years should be here:

                                1. 4

                                  I used to have a ton of these git shortcuts but at some point I threw them out again because I kept forgetting them. The only thing I use daily is git up which is git pull --rebase.

                                  1. 1

                                    I had a similar problem and only kept branch-history which showed me the one line commit diff between my feature branch and dev.

                                  2. 2

                                    notify-exit: that’s one of those ideas that is so great you facepalm and ask yourself why you never thought of it before. I’m adding this to my config tomorrow.

                                    1. 1

                                      ez, is great, thanks for sharing!

                                    1. 20

                                      After I learned about “ci” in vim I got hooked. All of the sudden replacing text in quotes became as simple as ci” and now I’m having a hard time to use other editors. Sometimes a little detail is all that it takes.

                                      1. 8

                                        This was extremely helpful thanks.

                                        Just to clarify to others. In vim if you are on a word “c” starts a change and the next keystroke determines what will be changed. For example, “c$” removes text from where the cursor is to the end of the line.

                                        Now what is new for me is vim has a concept of “inner text”. Such as things in quotes, or inbetween any two symmetric symbols. The text between those two things are the “inner text”.

                                        For example, in this line, we want to change the “tag stuff” to “anything”.

                                        <tag style="tag stuff">Stuff</tag>
                                        

                                        Move the cursor anywhere between the quotes and type ci then a quote and you are left with

                                        <tag style="">Stuff</tag>
                                        
                                        1. 8

                                          This is a good example of why to me learning vi is not worth the trouble. In my normal editor, which does things the normal way, and does not have weird modes that require pressing a key before you are allowed to start typing and about which there are no memes for how saving and quitting is hard, I would remove the stuff in the quotes by doing cmd-shift-space backspace. Yes, that technically is twice as many key presses as Vi. No, there is no circumstance where that would matter. Pretty much every neat Vi trick I see online is like “oh if you do xvC14; it will remove all characters up to the semicolon” and then I say, it takes a similar number of keystrokes in my editor, and I even get to see highlight before it completes, so I’m not typing into a void. I think the thing is just that people who like to go deep end up learning vi, but it turns out if you go deep in basically any editor there are ways to do the same sorts of things with a similar number of keystrokes.

                                          1. 14

                                            There is not only the difference in the number of keystrokes but more importantly in ergonomics. In Vim I don’t need to hold 4 keys at once but I can achieve this by the usual flow of typing. Also things are coherent and mnemonic.

                                            E.g. to change the text within the quotes I type ci”(change inner “) as the parent already explained. However this is only one tiny thing. You can do all the commands you use for “change(c)” with “delete(d)” or “yield(y)” and they behave the same way.

                                            ci”: removes everything within the quotes and goes to insert mode di”: deletes everything within the quotes yi”: copies everything within the quotes

                                            d3w, c3w, y3w would for example delete, replace or copy the next 3 words.

                                            These are just the basics of Vim but they alone are so powerful that it’s absolutely worth to learn them.

                                            1. 3

                                              Just a small correction; I think you meant “yank(y)” instead of “yield(y)”.

                                              1. 1

                                                Haha yes thanks I really got confused :)

                                              2. 2

                                                And if you want to remove the delimiters too, you use ‘a’ instead of ‘i’ (I think the logic is that it’s a variation around ‘i’ like ‘a’ alone is).

                                                Moreover, you are free to chose the pair of delimiters: “, ’, {}, (), [], and probably more. It even works when nested. And even with the nesting involves the same delimiter. foo(bar(“baz”)) and your cursor is on baz, then c2i) will let you change bar(“baz”) at once. You want visual mode stuff instead? Use v instead of c.

                                                This goes on for a long time.

                                              3. 6

                                                One difference is that if you are doing the same edit in lots of places in your editor you have to do the cmd-shift-space backspace in every one, while in vi you can tap a period which means “do it again!” And the “it” that you are doing can be pretty fancy, like “move to the next EOL and replace string A with string B.”

                                                1. 2

                                                  Sublime Text: ctrl+f search, ctrl+alt+enter select all results, then type your replacement.

                                                  1. 2

                                                    Yeah I just do CMD-D after selecting a line ending if I need to do something like that.

                                                2. 3

                                                  I would remove the stuff in the quotes by doing cmd-shift-space backspace

                                                  What is a command-shift-space? Does it always select stuff between quotes? What if you wanted everything inside parentheses instead?

                                                  and then I say, it takes a similar number of keystrokes in my editor, and I even get to see highlight before it completes, so I’m not typing into a void

                                                  You can do it that way in vim too if you’re unsure about what you want, it’s only one keypress more (instead of ci" you do vi"c; after the " and before the c the stuff you’re about replace will be highlighted). You’re not forced to fly blind. Hell, if your computer is less than 30 years old you can probably just use the mouse to select some stuff and press the delete key and that will work too.

                                                  The point isn’t to avoid those modes and build strength through self-flagellation; the point is to enable a new mode of working where something like “replace this string’s contents” or “replace this function parameter” become part of your muscle memory and you perform them with such facility that you don’t need feedback on what you’re about to do because you’ve already done it and typed in the new value faster than you can register visual feedback. Instead of breaking it into steps, you get feedback on whether the final result is right, and if it isn’t, you just bonk u, which doesn’t even require a modifier key, and get back to the previous state.

                                                  1. 2

                                                    What if you wanted everything inside parentheses instead?

                                                    It is context sensitive and expands to the next context when you do it again.

                                                    Like I appreciate that vi works for other people but literally none of the examples I read ever make me think “I wish my editor did that”. It’s always “I know how I would do that in my editor. I’d just make a multiselection and then do X.” The really powerful stuff comes from using an LSP, which is orthogonal to the choice of editors.

                                                  2. 2

                                                    I do not disagree. For vim, as for your editor, the process is in both places somewhat complex.

                                                    Like you I feel I only want to learn one editor really well. So I choose the one which is installed by default on every system I touch.

                                                    For which I give up being able to preview what happens and some other niceties. Everything is a tradeoff in the end

                                                  3. 2

                                                    In a similar way, if you want to change the actual tag contents from “Stuff” to something else:

                                                    <tag style="tag stuff">Stuff</tag>
                                                    

                                                    you can use cit anywhere on the line (between the first < and the last >) to give you this (| is the cursor):

                                                    <tag style="tag stuff">|</tag>
                                                    

                                                    Or yit to copy (yank) the tag contents, dit to delete them etc.. You can also use the at motion instead of the it motion to include the rest of the tag: yat will yank the entire tag <tag style="tag stuff">Stuff</tag>.

                                                    Note that this only works in supported filetypes, html, xml etc., where vim knows to parse markup tags.

                                                  4. 2

                                                    I really like that I keep stumbling on tidbits like this one that continue to improve my workflow even further.

                                                  1. 4

                                                    All of Powershell, C#/.NET, Fennel and Janet, Love2D, Godot, Web Assembly come to mind for me.

                                                    1. 7

                                                      I’m thankful for C#/.net for providing me a high paying career for the last 20 years. I’m even more excited about .net core, the fact that Linux is not a second class citizen, and the fact that I’ll hopefully soon be done with IIS.

                                                      1. 2

                                                        Ha ha this is very very familiar. I’ve just completed migrating a huge codebase to dotnet core and running everything natively on Linux (instead of in a Windows VM) is so slick and fast.

                                                        1. 2

                                                          Yeah, same boat here (though I’ve only been doing C# for 15 years now). Looking forward to my workplace moving over to .NET Core so that more of my tooling works with Emacs and I can use Visual Studio even less than I do now.

                                                      1. 3

                                                        One suggestion is to rebind the default prefix (C-b) to C-z instead: while C-b moves backwards one character in the default shell config (and hence I use it all the time), C-z backgrounds a job, which I do rarely enough that typing C-z z to do so is perfectly fine.

                                                        1. 5

                                                          I background+foreground jobs pretty frequently. So I need C-z to be free.

                                                          Personally I set my prefix to C-a.
                                                          I think it’s usually used to go to the start of the input line in most shells by default, but I set -o vi in my shell so that doesn’t apply to me.

                                                          A friend of mine sets their prefix to a backtick. Which I thought was interesting, but I like to use backticks now and then…

                                                          1. 7

                                                            C-a is a super common choice, as it’s the same prefix that screen uses by default. The screen folks, in turn, either had the right idea or it was a pretty lucky guess: C-a takes you to the beginning of the line, which is not needed too frequently in a shell.

                                                            On the other hand it’s the “go to the beginning of the line” in Emacs, too so, uhh, I use C-o for tmux. I suppose it might be a good choice for the unenlightened vim users out there :-).

                                                            Another prefix binding that I found to be pretty good is C-t. Normally, it swaps two characters before the cursor, a pretty neat thing to have over really slow connections but also frequently unused. Back when I used Ratpoison, I used it as the Ratpoison prefix key.

                                                            I think C-i (normally that’s a Tab) and C-v (escape the next character) are also pretty good, particularly the former one, since Tab is easily reachable from the home row and available on pretty much any keyboard not from outer space.

                                                            I’ve no idea why I spent so much time thinking about these things, really. Yep, I’m really fun at parties!

                                                            1. 2

                                                              I use C-o for tmux

                                                              Yeah, I’ve used C-o for screen since I guess the mid-90s because I couldn’t deal with C-a being snarfed, possibly because I was using a lot of terminal programs which used emacs keybindings at the time… Now I’m slowly moving over to tmux and keeping the C-o even though I rarely use anything terminal-based these days.

                                                              1. 1

                                                                C-o is pretty important in vim actually. Personally I use M-t, which doesn’t conflict with any vim bindings (vim doesn’t use any alt/meta bindings by default) or any of my i3 bindings (I do use alt for my i3 super key)

                                                                1. 1

                                                                  Oh, I had no idea, the Church of Emacs does not let us meddle with the vim simpletons, nor dirty our hands with their sub-par editor :-P. I just googled it and, uh, yeah, it seems important, I stand corrected!

                                                              2. 2

                                                                Personally I set my prefix to C-a. I think it’s usually used to go to the start of the input line in most shells by default …

                                                                And in Emacs; I use it multiple times an hour, so unfortunately that is out for me.

                                                                I think that I have experimented with backtick in screen, after I started using Emacs. I have a vague memory of problems when copy-pasting lines of shell which led me to use C-z instead.

                                                                1. 2

                                                                  I’ve used C-a in screen for ages and carried it over tmux. Hitting. C-a a to get to the start of the line is so ingrained now that it trips me up when I’m not using tmux.

                                                              3. 2

                                                                I just use C-a, primarily because I moved to tmux from using screen, which uses that binding for the prefix.

                                                                1. 1

                                                                  Yeah I found C-a much better than C-b, much less of a stretch, but eventually I started getting firearm pain in my left arm from all the pinky action. I’ve moved to M-t, most often using right hand for alt and left hand for t.

                                                                2. 1

                                                                  C-f

                                                                  1. 1

                                                                    Unfortunately that is forward-char🙂

                                                                    1. 1

                                                                      the lesser of all evil

                                                                  2. 1

                                                                    I use C-q. It’s extremely easy for me to hit the keys together, since I remap capslock to be control, and is quite comfortable.

                                                                    This leads to fun when I accidentally killed my other applications, but at this point it’s ingrained so I don’t mess up.

                                                                    1. 1

                                                                      Interesting! I might give that a shot. I do use C-q to quote characters, but not that often, only once or twice every couple of days.

                                                                  1. 1

                                                                    I’ve read through this guide several times over the years and it’s great. Looking forward to the perpetually-TBD ConfigureAwait section!

                                                                    1. 3

                                                                      By coincidence, I just exactly finished migrating a huge codebase from .NET Framework to .NET Core and got the front end running natively in linux today.

                                                                      Having it run in linux is SO nice. My dev machine runs arch linux with Windows in a qemu VM, and the Windows VM runs builds and uses IIS for hosting.

                                                                      However the Windows VM also sucks up a heap of memory and occasionally CPU cycles. So being able to leave it off is very very nice.

                                                                      I code in vim, using OmniSharp-vim for C# language services. I actually could already do this with the .NET Framework codebase, using mono. So dropping the mono requirement is nice but doesn’t make much difference to me.

                                                                      The BIG thing that I’m stoked about is that I can now debug in Vim, using vimspector with the Samsung netcoredbg DAP adapter. It works really really well. Debugging is the only reason I ever use Visual Studio any more and I’m so happy to be able to do more of that in vim. Visual Studio is a great debugger and I expect I’ll still use it for “heavy” debugging.

                                                                      1. 1

                                                                        Thank you for sharing about Vimspector and Samsung netcoredbg DAP adapter. I’ll have to make time to investigate those. Debugging and Intellisense are the two main things that keep me using VS Code on Linux.

                                                                        1. 1

                                                                          I’m not entirely sure what the state of Microsoft debugger licensing is, but the initial reason for looking into the Samsung netcoredbg adapter was due to this issue, where the MS debugger license said you were only allowed to use it in Visual Studio or VSCode. JetBrains made their own debugger in response to this and I suspect Samsung also made this debugger for the same reason.

                                                                        2. 1

                                                                          any particular reason you still use IIS for hosting?

                                                                          1. 2

                                                                            I’ve been using it for hosting .NET Framework stuff as it was what we’ve traditionally used in the company and it’s easier for me to work cooperatively with the team when my environment is not too drastically different from others’.

                                                                            However my new setup with .NET Core is running its own Kestrel server with dotnet start which is way easier and lighter.

                                                                        1. 4

                                                                          What are some crustacean experiences with Treesitter?

                                                                          I tried it out, despite the warnings about instability, for the refactor plugin. Got this Unity codebase to deal with, and nothing else really provided C# refactoring.

                                                                          The refactoring wasn’t project-wide, which caused some woes, though I could repeat the operations a few fimes in separate files and be happy-ish. The dealbreaker is that Neovim would quite often deny insert mode, as if the buffer setting changed BTS somewhere. Restart, my favorite!

                                                                          I don’t use treesitter ATM, maybe later.


                                                                          LSP is also a mixed bag. Very useful and works nice on my heirloom-grade laptop, even for Unity, but on my desktop it buffers up syntax errors for nearly every keypress and flushes them out so slowly I can jump to Unity and run the unit tests by the time LSP’s done complaining. Sometimes an error is left lingering.

                                                                          This is with the same config on both machines, and OS load is always less than you’d imagine, so it’s just weird. Even mono should be the same version.

                                                                          No regrets; C# needs this stuff so bad it’s worth the trade-off.

                                                                          1. 7

                                                                            For typescript it was a game changer. Syntax highlighting in vim never looked quite right, especially in a side-by-side comparison with VSCode.

                                                                            I also find the neovim ecosystem to be rich and full of new plugins because of things like tree-sitter support. There’s an entire section dedicated to treesitter enabled colorschemes on neovimcraft: http://neovimcraft.com/?search=tag:treesitter-colorschemes

                                                                            1. 3

                                                                              FWIW I hit the insert mode bug without treesitter. For the first time, even. Guess it was the wrong tree(sitter?) I was barking up, because of https://github.com/nvim-telescope/telescope.nvim/issues/82#issuecomment-854596669

                                                                              Treesitter might be laggy enough or something to trigger the problem more often. Testing that fix now, and maybe I can give Treesitter another shot soon!

                                                                              1. 3

                                                                                nothing else really provided C# refactoring.

                                                                                Could you expand on this? I would expect C# to be the language with best refactoring tools, given that both JetBrains (Resharper & Rider) and Microsoft (Roslyn) have been working on them for more than 10 years at this point.

                                                                                1. 2

                                                                                  Not if neovim is your goal. The solutions from jetbrains and ms are proprietary

                                                                                  1. 5

                                                                                    This is factually wrong about ms.

                                                                                    Roslyn is MIT licensed, omnisharp makes it speak LSP. For refactors specifically, I’d be surprised if there isn’t non-editor tooling to apply Rosly analyzers as project-wide refactors.

                                                                                    1. 3

                                                                                      Sure. However actually using omnisharp is another matter. Its definitely not on par with the experience inside of visual studio itself. For example vscode which uses omnisharp provides a pretty demonstrably second class experience compared with rider and visual studio proper. And even then that experience is better than what you get from lsp c# in neovim.

                                                                                      An example of this breakdown is that msbuild integration with visual studio is on a whole other level compared to what omnisharp can handle

                                                                                  2. 2

                                                                                    What @Kethku said.

                                                                                    I did find this one refactoring plugin vim-refactor that pulled in a bunch of library-like stuff, less surprisingly conflicted with some of my maps, and didn’t do c# properly in the end.

                                                                                    That’s why Treesitter seemed so appealing. I’m sure it’s not such a turd as my experience was, but I also have work to do beside debugging 0d plugins ;)

                                                                                    I do really look forward to trying it out again, but I’m happy with my LSP setup (despite the error stuff!) and able to be productive now.

                                                                                    1. 5

                                                                                      I still don’t understand something I believe. Roslyn is a very mature tool to do analysis and transformation of C# code. Using tree sitter for refactors (which knows only syntax) is like parsing html with regexes, only one level up: using syntax analysis for semantic transformations.

                                                                                      I would be surprised if no-one has glued Roslyn to vim, and indeed folks seem to have done that? https://github.com/OmniSharp/omnisharp-vim

                                                                                      If, despite all this, “refactoring C# in vim” is still an unsolved problem, then there’s an opportunity for a fairly easy, fairly popular OSS project here. All the hard work of actually doing refactors has been done by Microsoft. What’s left is the last mile of presenting what Roslyn can do in an editor.

                                                                                      1. 2

                                                                                        Maybe my “repeat in multiple files” is because of syntax being the wrong layer? I’m really not 100% sure!

                                                                                        It was palatable, and got the job done, and the dealbreaker was something else.

                                                                                        I do have OmniSharp running, but I haven’t seen anything related to proper refactoring in Neovim with it. I could look again and verify I have the latest version, though I did take a quick look before my Treesitter journey.

                                                                                        It would be beyond awesome if more native refactoring existed, but I do believe it’s more of an opportunity than an existing feature.

                                                                                        1. 5

                                                                                          Current OmniSharp-vim maintainer here. All of the OmniSharp-roslyn code actions are available in OmniSharp-vim. OmniSharp-vim doesn’t actually use LSP, as both OmniSharp-vim and OmniSharp-roslyn are older than the protocol.

                                                                                          However the OmniSharp-roslyn server does have an LSP “mode” and so is usable without OmniSharp-vim using vim LSP plugins or neovim native LSP. I would expect all code actions to be available via LSP too but I don’t know.

                                                                                          I’m curious to know what kind of server-based refactorings we’re talking about exactly.

                                                                                          1. 2

                                                                                            Hi! And thanks for your maintainership! :)

                                                                                            My use case is/was simple: given a code base, rename methods so they’re renamed everywhere. The start of the rename can be a method definition or a usage, and everything will be figured out. Not sure if that’s possible, even, just a wishlist thing ;)

                                                                                            I haven’t needed to touch constructor (or other method) argument refactoring, and I’m sure the Treesitter refactor plugin has nothing for this, but could be useful.

                                                                                            1. 4

                                                                                              In OmniSharp-vim you can do :OmniSharpRenameTo NewSymbolName on either the definition or a usage and it will be renamed everywhere in the solution.

                                                                                              Here’s a demo on the OmniSharp-roslyn codebase. The first 60 seconds are the server warming up (it’s a big solution):

                                                                                              https://asciinema.org/a/gd6GGiGGtcXjBsXoY0UKrqluB

                                                                                              1. 2

                                                                                                TIL! Thanks! Now I got a config with treesitter that disables the refactoring prompt in c# in favor of an autocmd map for omnisharp :)

                                                                                                Edit: yet to see what needs to be reloaded to get rid if the “does not conrain a definition (though it sure does lol!)” error, but still this is good news :)

                                                                                                Edit2: jumping the gun here, :LspRestart seems to be good enough.

                                                                                                1. 3

                                                                                                  Right, if you’re using LSP and OmniSharp-vim together, you’ll have to find ways of keeping the servers synchronised, because you’re running multiple instances.

                                                                                                  1. 2

                                                                                                    Yeah, it’s a bit messy but most often only when autocompleting. I approach my neovim pretty much by fixing things as they start to annoy me too much or cause a productivity hit.

                                                                                                    Maybe I’ll get that thing sorted some day, but I’m fine for now :)

                                                                                1. 13

                                                                                  I am intrigued by the framing of the Sturm und Drang about the state of the web as being driven, to some significant degree, by politics internal to Google.

                                                                                  1. 26

                                                                                    As I stated earlier this week, promo packets are what’ll do in the web.

                                                                                    I think a lot of developers simply lack the interest in context to process the realpolitik that shapes and distorts the fabric of spacetime for our industry.

                                                                                    If you refuse to understand that Google’s whole business is threatened by adblockers, you probably would be confused at the some of the changes to web extensions webRequest that make that work harder. If you don’t understand the desire to make SEO, crawling, and walled gardens easier AMP probably seemed like a great return to roots.

                                                                                    Other companies do this too, of course. If you didn’t know about OS/2 Warp some of the Windows APIs probably seemed weird. If you don’t know about Facebook trying to own everything you do then the lack of email signup for Oculus probably seems strange. If you invested heavily into XNA you probably got bit when internal shifts at Microsoft killed XNA off. If you don’t know about internal Canonical and RHEL shenanigans, systemd and other things probably are a surprise.

                                                                                    Developers need to pay as much attention to the business dependencies as the technical ones.

                                                                                    1. 6

                                                                                      What do you mean by promo packets? I’m not familiar with this term.

                                                                                      1. 21

                                                                                        When you’re doing a performance review at Google, you can request a promotion. If you do this, you put together a ‘packet’ including the impactful work you’ve done. New work is rewarded heavily, maintenance less so. For senior engineers, shipping major projects with an industry wide impact is a path to promotion.

                                                                                        1. 30

                                                                                          Which means Google rewards doing something new for the sake of doing something new. It’s tremendously difficult to get promoted by improving older systems. Crucially, you often need to demonstrate impact with metrics. The easiest way to do that is sunset an old system and show the number of users who have migrated to your new system, voluntarily or otherwise.

                                                                                          1. 16

                                                                                            Ew. Thanks for the insight. But ew.

                                                                                          2. 1

                                                                                            Is there any material evidence suggesting that someone’s promotion is the reason that chrome will remove alert? Obviously google will push the web in the direction that juices profit, but an individual promotion? Seems like a red herring.

                                                                                            1. 6

                                                                                              It is often difficult to pick it apart as it’s rarely a single person or team. What happens in large organizations is that there is a high-level strategy and different tactics spring from that. Then, there are metrics scorecards, often based on a proxy, which support the tactics delivering the strategy. This blurs the picture from the outside and means that rarely one person is to blame, or has singular control over the successes.

                                                                                              I haven’t followed the alert situation very closely, but someone familiar with large organizations can get a good read from the feature blurb. There is a strong hint from the language that they are carrying a metric around security, and possibly one around user experience. This translates to an opportunity for a team to go and fix the issue directed by the metrics since it’s quantifiable. The easiest way to start might be to work back from what moves the metric, but this is a very narrow perspective.

                                                                                              Developers may know what the best things to work on having been a developer in that area for 10 years, but their impact tracks towards those top-level strategies. Management can’t justify promotion because someone else is very focused on metrics that drive the strategy.

                                                                                              In lots of places this is called alignment. Your boss may only support X amount of work on non-aligned projects, if you do at least Y amount of work on Y projects. A classic big company alignment example is a talented person in a support department. If they can fix your biggest problem at the source it’d be best to let them do this. However, metrics incentivize assigning them to solving N support cases per week and other metrics designed for lower-skilled individuals instead of working on fixing root causes. Eventually, they leave unless you have smart management taking calculated risks, manage the metrics at the team level so the team is not noticed working the way it wants, seeking paths for talented people to work on the product, etc.

                                                                                              1. 1

                                                                                                Many of us understand how metrics and incentives at tech companies work. Was just pointing out that it’s a bold claim to assume that chrome is removing alert due to an individual seeking a promotion.

                                                                                        2. 3

                                                                                          I think about this in terms of my time at Apple – like, people ascribed all kinds of causes to various seemingly peculiar Apple decisions that to those of us on the inside were obvious cases of internal politicking leaking out.

                                                                                          1. 2

                                                                                            WHATWG is a consortium of multiple companies so I’m curious why everyone is pointing the finger at Google here, or is the assertion that Google has so much power over the WHATWG and Chrome at this point that there’s no ability for other companies to dissent? (And I mean we all know that the W3C lost and WHATWG won so a consortium of vendors is the web.)

                                                                                            1. 9

                                                                                              The multiple companies are Apple, Google, Microsoft, and Mozilla (https://whatwg.org/sg-agreement#steering-group-member, section 3.1b) Of the three, only Apple develops a browser engine that is not majority funded by Google.

                                                                                              1. 4

                                                                                                I’m pretty sure Apple develops a browser engine that is majority funded by Google: https://www.theverge.com/2020/7/1/21310591/apple-google-search-engine-safari-iphone-deal-billions-regulation-antitrust

                                                                                                1. 5

                                                                                                  That’s some pretty weird logic.

                                                                                                  The browser engine Apple creates is used for a whole bunch of stuff across their platforms, besides Safari:

                                                                                                  Mail, iMessage, Media Store fronts, App Store fronts.. Those last two alone produce revenue about 4x what Google pays Apple to make it the default.

                                                                                                  Do I wish they’d get more people using alternatives and pass on the google money? Sure. Is there any realistic chance their ability to fund Safari and/or Webkit would be harmed by not taking the google money? Seems pretty unlikely.

                                                                                                  1. 1

                                                                                                    I don’t think the stores use WebKit. They didn’t last time I investigated.

                                                                                                  2. 4

                                                                                                    It’s true-ish. But I’m sure the most profitable company in the world probably doesn’t require that money and would be able to continue without.

                                                                                                    1. 3

                                                                                                      You don’t become the most profitable company by turning down revenue.

                                                                                                  3. 1

                                                                                                    Right I was just wondering if folks think the WHATWG is run solely by Google at this point. Thanks for the clarification.

                                                                                                  4. 5

                                                                                                    The point is that many of those new APIs don’t happen in standards groups at all. Exactly because they’d require more than one implementation.

                                                                                                    1. 5

                                                                                                      Yes, this. Google’s play here is less about controlling standards per se (ed: although they do plenty of that too) and more about getting everyone to treat Whatever Google Does as the standard.

                                                                                                    2. 4

                                                                                                      WHATWG was run at inception by a Googler and was created to give Google even more power over the standards process than the hopelessly broken W3C already gave them. That they strong armed Mozilla into adding their name or that Apple (who was using the same browser engine at the time) wanted to be able to give feedback to the org doesn’t change the Googlish nature of its existence, IMO

                                                                                                  5. 12

                                                                                                    Like it or not, Google is the www. It is the driving force behind the standards, the implementations (other than Safari), and the traffic that reaches websites.

                                                                                                    It would be odd if Google’s internal politics didn’t leak into the medium.

                                                                                                    1. 6

                                                                                                      Right, it’s just … one of those things that is obvious in retrospect but that I would never be able to state.

                                                                                                      1. 9

                                                                                                        A lot of people seem to think that standards work is a bit like being in a university - people do it for the love of it and are generally only interested in doing what’s best for all.

                                                                                                        In reality it’s a bunch of wealthy stakeholders who realize that they need to work together for everyone’s best - they’re not a monopoly, yet - but in the meantime it behooves them to grab every advantage they can get.

                                                                                                        As mentioned in the post, standards work is hard and time-consuming, and if an organisation can assign a dedicated team to work on standards, that work will get implemented.

                                                                                                        1. 3

                                                                                                          Universities work like that too now

                                                                                                          1. 1

                                                                                                            This is sadly true.

                                                                                                  1. 10

                                                                                                    FWIW, I’ve personally enjoyed email hosting by Migadu.

                                                                                                    1. 1

                                                                                                      Same here. Switched after self-hosting mail for a couple years. Can absolutely recommend Migadu.

                                                                                                      1. 1

                                                                                                        I’m the author of the post. I hadn’t heard of Migadu before, but it almost looks like it would work. The only issue is their Micro plan ($19/year) only allows 200 inbound emails per day. I guess that may not be an issue most of the time, but there are days where I receive more than 200 emails. The inability to control how much inbound email you are receiving makes me hesitant to use such a service.

                                                                                                        1. 3

                                                                                                          I also use migadu for a family account. The thing I really like about it is that you can add as many accounts as you like for your domain: this@my.domain, that@my.domain, theother@my.domain, it’s so nice.

                                                                                                          But yes, the 200-in limit has been my concern too. I subscribe to a few mailing lists and have a worry that one day some big heated mailing list conversation will put me over. This FAQ answer suggests they are lenient and that emails won’t actually be lost (assuming senders follow correct email practices!), but my tentative plan has been to wait and see if I ever get a warning email, and upgrade to the next tier if it becomes an issue. It hasn’t so far, after a year or so.

                                                                                                          1. 3

                                                                                                            For what it’s worth, it’s not a hard limit. They won’t block the 201st email — if it’s a recurring thing, they’ll ask you to upgrade. This is mentioned in their docs, somewhere. cc @jeremyevans

                                                                                                            1. 1

                                                                                                              I checked and it is in their documentation. So maybe that would have been a simpler option. I might have switched to Migadu instead of using a VM if I had known about it first. I think the only issue is the next level up from the $19/year plan is the $90/year plan, which is a pretty significant jump. But for someone who isn’t likely to go over their limits, Migadu looks like a really nice option.

                                                                                                              1. 1

                                                                                                                It’s mentioned in the FAQ answer I linked to

                                                                                                                1. 1

                                                                                                                  Ah, didn’t notice you’d done that.

                                                                                                              2. 1

                                                                                                                Re: using multiple addresses at the same domain:

                                                                                                                Which email client(s) do you use? Last time I checked, Thunderbird doesn’t put design thought toward this use case. As such it is clunky to use for sending emails from different addresses.

                                                                                                                I’m on Evolution now, but always looking for better options.

                                                                                                                1. 1

                                                                                                                  I primarily use mutt, which I have configured with 4 different email accounts: 1 work, 1 gmail, 2 migadu. So I don’t actually send from different addresses exactly (although I think that is easy to do in mutt), but have commands which switch me completely to a different account and inbox.

                                                                                                                  But what I meant about migadu is not that they give you multiple email addresses to send to and from within your domain, but that they let you add as many accounts as you like within that domain. So my daughters get their own email addresses and passwords and can sign into them on whatever mail client they like. And I can give these out to as many of my family as I like (the domain is a play on our surname), as long as I don’t hit the 200/20 limit.

                                                                                                              3. 2

                                                                                                                Thanks for posting your setup. I’ve been sniffing at things adjacent to this for a while, looking at some other providers for SMTP. mailroute was the one that had looked most promising, but their definition of a “user” would have had me paying heavily for all the aliases I use, so I had not made the jump yet. Tuffmail’s EOL is going to force my hand.

                                                                                                                Right now, I’m deciding between Migadu and a setup similar to what you’ve done. I had almost given up on the self hosted setup. Sendgrid could work for me, though. My only heartburn about it is, if they decide to kill off their free plan, it’s a huge jump up to $15/mo while I work out an alternative. Where I’d be flirting with the 200 in/day limit on Migadu, the jump up to the next tier isn’t as nasty if I need to do that.

                                                                                                                1. 2

                                                                                                                  Really sad to hear about Tuffmail. They were truly the best option.

                                                                                                            1. 3
                                                                                                              • I work with Git repos, but strictly through Mercurial + hggit. Templates + revsets are the best.

                                                                                                              • go file1 file2 … is a little wrapper to open multiple files/dirs with xdg-open. I’ll probably rename this script if I ever have to install Golang.

                                                                                                              • h myprogram tries, in order, to open the man page, or run mycommand --help | less flag, or with mycommand -h | less. Basically “I want to read your help page, dammit” with a side order of “in a pager, please, don’t barf it straight into the terminal”.

                                                                                                              • addkernel installs the active Conda environment as a one of my user’s IPython/Jupyter kernels. This makes it visible from any Jupyter installation, specifically my main one. This, in turn, lets me maintain one virtualenv with a Jupyter installation + extensions, instead of one Jupyter installation per {conda,virtual}env.

                                                                                                              1. 2

                                                                                                                h! What a great idea, I’m doing that! Actually, I might call it ;h since I type this often by accident anyway, as a vim user who maps ; to :

                                                                                                                1. 1

                                                                                                                  Oh yes, nnoremap ; : is an excellent mapping.

                                                                                                                  If you have a PageDown key to fall back on, nnoremap <Space> : is also fantastic, and even easier to type. No drawbacks so far in my experience.

                                                                                                              1. 14

                                                                                                                I use tmux a lot. I like tmux’s splits and windows and sessions, but the main reason I use it is for keyboard text selection and scrolling. I wrote a little about this here, with a demo of what it looks like: tmux lets you select and copy text with your keyboard. I don’t really remember what life was like without it.

                                                                                                                I don’t really get the appeal of smart cd, but I have persistent tmux sessions set up for all the projects I work on, so switching directories is usually just switching my tmux session.

                                                                                                                I wrote a little thing to hook up fzf to my shell completion. I have different triggers, like .f for “select file” or .c for “select commit,” and when I type .c<TAB> I get a little fzf popup that lets me select a commit and insert it. I know you can just enable fzf integration with shell completion globally, but this has a few advantages:

                                                                                                                • it’s much, much, much faster than shell autocomplete (especially for selecting dirty git files)
                                                                                                                • it’s deterministic: when I activate completion, I know exactly what choices I’m going to get – I am not at the mercy of whatever shell autocomplete decides I want to do
                                                                                                                • I can add new triggers without having to modify a program’s shell completion (if you have not edited these scripts, they are… truly arcane), and I don’t have to worry about missing completion files for random programs.

                                                                                                                And I can still use the default shell completion as much as I want; this just adds another option. I did this for years with global shell aliases, which have a lot of problems, but a few months ago I dove in and figured out how to hook it into regular tab-completion. It’s a little complicated, but it works great.

                                                                                                                I really like delta; the goto-next-file-header thing is a brilliant hack. But I had to do a lot of work to get output that I liked.

                                                                                                                Having nix installed provides a cool super-power that I use a lot: temporary installation of a program. If I heard of something and want to try it out, I can run nix-shell -p fd (for example) and play around with it. And then it “disappears” as soon as I close that shell, so I don’t have to remember to uninstall it. Lowers the barrier of trying random stuff out.

                                                                                                                I made a hacky thing to organize all of the scripts in my ~/bin into a single hierarchical command that’s defined by its directory structure, and that automatically parses bash comments to display help lines in autocomplete. (The ability to easily add new subcommands makes nix’s CLI a lot more palatable…)

                                                                                                                ngrok is a really nice niche tool if you want to show your local test server to someone else (I’ve used it for sharing blog drafts, for example). There’s a paid version, mostly to combat spam, I think, but the free version is sufficient for anything I would ever do, and it doesn’t require an account or anything.

                                                                                                                terminal-notifier is nice if you’re on a Mac… often I’ll run some long command, ctrl-z, then fg ; terminal-notifier -message "done $?". I actually have an alias for that because I do it often enough.

                                                                                                                A little different than the rest, but I use iTerm’s “Hotkey Window” almost exclusively. I’m often tabbing between a web browser and a text editor, and keeping my terminal window out of the ⌘Tab history means I never switch to it by accident because I just happened to run git status.

                                                                                                                I have more, but I think that’s enough for now…

                                                                                                                1. 2

                                                                                                                  I’m in a very similar boat regarding persistent tmux sessions, I find this to be an excellent way to maintain structured environments. I just have some simple scripts to set up a session, or attach to it if it already exists.

                                                                                                                  I love shell completion for the things where it works, but it’s frustrating when it doesn’t. Your .c fzf commit shortcut sounds like something I could really use, for the reasons you state: I far prefer to be explicit about what I’m looking for, so having control over exactly what I’m completing would be perfect. Looking forward to playing with it, thanks!

                                                                                                                  1. 3

                                                                                                                    I agree on the persistent sessions but it really bugs me that tmux conflates two sets of functionality:

                                                                                                                    • A pseudoterminal that I can disconnect from and reconnect to.
                                                                                                                    • A thing that takes over control of my terminal emulator and provides its own windowing system

                                                                                                                    My terminal emulator does a really good job at being a terminal emulator. I don’t need something else to replace that. I’ve switched to using abduco instead of tmux because subsequent versions of tmux made it harder and harder and eventually impossible to tell it not to break my terminal’s scrollback. I’m not completely convinced that abduco is an improvement: it doesn’t seem to properly buffer state when I disconnect and reconnect and it manages to break command-line editing in some terminals.

                                                                                                                    I’d love to have a reliable thing that just opened a pty and just forwarded everything to it, buffering when necessary, without any feature creep.

                                                                                                                    The macOS Terminal provides an environment variable containing a UUID and if you force-quit it then it restarts with all of the windows in the same position and with the same UUID in that environment variable. I use a wrapper around autossh that drops a file in a known location named with this UUID and containing the remote host name. When the terminal restarts, it automatically reconnects my sessions, so I can reboot my local machine and not lose any state. The Windows terminal and konsole do not preserve the UUID across restarts so I have to run abduco -l on the remote machine after a restart to find the sessions I need to reconnect to. I think the macOS terminal copied this feature from iTerm, I wish other terminal emulators would copy it too.

                                                                                                                    1. 2

                                                                                                                      I think the “buffering when necessary” would be kinda tricky. Like, you could run some graphical program like vim without switching to an alt screen, and it would have to buffer every intermediate drawing character in order to re-create the final state if you attached a new client. I think? Maybe there’s a smarter thing you could do.

                                                                                                                      I am also bothered by tmux – especially the copy mode that I love so much. I wish that I could compose my environment out of smaller building blocks – so a session manager, running a multiplexer, with each “window” running a scrollback-buffering-pty-with-text-selection. Then I could swap out one “layer” for a better alternative without needing to re-write all of tmux. ptys are cheap! I’m currently working on an experiment to write a new “bottom layer” – the text selection bit – as an excuse to learn Rust, and fix some of the ergonomic complaints I have with tmux.

                                                                                                                      1. 1

                                                                                                                        I am also bothered by tmux – especially the copy mode that I love so much. I wish that I could compose my environment out of smaller building blocks

                                                                                                                        Hmmm… tmux was originally written to replace the BSD program window(1) which just performed window management in a terminal. Separate tools could be used for copying and so on,

                                                                                                                        1. 1

                                                                                                                          Anything like this is doing some buffering: It maintains two connections to PTYs, one that talks to the clients (e.g. vim, ls, whatever) the other that talks to the real terminal emulator (or the next step in the chain if, for example, ssh is between it and the real terminal emulator). It reads from one PTY and writes to the other, sitting in a loop. The only extra thing necessary is that if the terminal disconnects then it needs to store any messages that it gets somewhere (ideally in an in-memory buffer that spills to the disk above a certain size).

                                                                                                                    2. 1

                                                                                                                      tmux lets you select and copy text with your keyboard.

                                                                                                                      I love this feature, or at least until it stopped working for me on sway/wl-clipboard. I think it was a recent tmux update.. My attempt to bisect tmux to find where it broke led to it mysteriously working for about a week, then breaking again. I still have no clue why it doesn’t work for me anymore :(

                                                                                                                      1. 1

                                                                                                                        tmux 3.3 added the copy-command option which makes it easier to hook into the system clipboard… but I don’t know why that would have broken anything. If you aren’t using a custom copy-pipe (or whatever) command, tmux prints escape codes if it detects that your terminal emulator supports them. Maybe something changed with that detection, or your terminal emulator? You can force it on by adding set -g set-clipboard on to your ~/.tmux.conf. But if you have 3.3 you could try set -g copy-command "wl-copy".

                                                                                                                    1. 11

                                                                                                                      Switching to using Lua for Neovim seems like it’ll be really powerful. I’m just a little scared to make that final jump, because there’s way to really go back to Vim after doing this. I’ve already leveraged a bunch of Neovim-only stuff, but this is a lot more extreme.

                                                                                                                      1. 7

                                                                                                                        The Lua support in Neovim is one of the things making me eager to look at it. Lua is a fantastic little language and there’s no reason to be stuck with something like vimscript in 2021.

                                                                                                                        1. 5

                                                                                                                          I looked a bit at lua, and a lot of stuff seemed much more verbose/awkward to me.

                                                                                                                          I kinda of like VimScript 😅 There are a few annoying parts (line continuations, ugh, and I still forget that stupid a: sometimes), but overall I find it works fairly well, especially since lambdas (already some time ago) and the method syntax (also some time ago, but never ported to Neovim) were added. It’s a fairly small language that fits its purpose reasonably well.

                                                                                                                          It’s perhaps a bit of an acquired taste though.

                                                                                                                          1. 4

                                                                                                                            Neovim is claiming that lua is much faster than VimScript. I’ve seen VimScript chug on files with just a few hundred lines, so I’m hoping I can convert my heavier functions to lua and get a speed boost.

                                                                                                                            1. 2

                                                                                                                              I can’t say I ever ran in to issues with this myself; most of the times I ran in to performance issues it’s because you do something like :%s/<something rather complex on a large file>/, but I’m not sure if Lua will really help with that? From what I can tell, most of the performance issues is when people implement stuff like fuzzy matching in VimScript and similar computation-heavy stuff.

                                                                                                                              The new VimScript9 is quite a bit faster (but still slower than LuaJIT), but I haven’t really looked at it.

                                                                                                                            2. 1

                                                                                                                              I kinda of like VimScript

                                                                                                                              Wow, this is the first time in twenty years I’ve heard anyone express an emotion about vimscript other than disgust.

                                                                                                                          2. 7

                                                                                                                            if you keep your dotfiles in source control (which I recommend if you aren’t already), you have nothing to lose. If you make the switch and decide later that it’s not for you, just revert back to the previous version of your config that uses vimscript.

                                                                                                                            1. 3

                                                                                                                              That only works until you customize further in lua.

                                                                                                                              1. 2

                                                                                                                                I’m not sure what you mean. Sure, you lose some further custom lua config (until you port it to vimscript), but you won’t end up worse off than you were before you switched if you have your config in source control.

                                                                                                                            2. 4

                                                                                                                              I have recently switched not only to Lua, but to Fennel as well and I am pretty happy with result. Now I need to port rest of my config from VimL to Fennel.

                                                                                                                              1. 2

                                                                                                                                Wow, that’s amazing! Did not know Fennel could be used like this.

                                                                                                                                1. 2

                                                                                                                                  do you notice any delay from having to compile the fennel files to lua on every startup?

                                                                                                                                  1. 4

                                                                                                                                    Slight, but nothing annoying me. In the past I was trying to cut load time as much as possible, but now I stopped giving a damn. I haven’t tried precompilation though.

                                                                                                                                  2. 1

                                                                                                                                    If you’re using a lisp for your editor scripting.. At what point does evil/emacs becometthe saner choice, though?

                                                                                                                                    1. 3

                                                                                                                                      As soon as Evil will learn into all my favourite quirks of Vim. I have tested Emacs in the past and there was always some small nitpick that was missing and was irritating me. Now I get the best of two worlds.

                                                                                                                                  3. 2

                                                                                                                                    Is there a reason that’s a problem? Neovim is a fork of the vim codebase and migrating to it doesn’t seem all that different from upgrading vim and then using plugins that require the new version as their minimum version. Neovim is basically just vim that is making faster progress on cool new features than mainline vim is.

                                                                                                                                    1. 5

                                                                                                                                      Neovim 0.5 lets you write your vimrc as a lua script, which Vim8 can’t parse.

                                                                                                                                      1. 2

                                                                                                                                        The big gotcha I hit with Neovim was that it uses a different format for undo files. I have this in my vimrc:

                                                                                                                                        set undodir=${XDG_CACHE_HOME}/vim/undo//
                                                                                                                                        set dir=${XDG_CACHE_HOME}/vim/swap//
                                                                                                                                        set backupdir=${XDG_CACHE_HOME}/vim/backup//
                                                                                                                                        set undofile
                                                                                                                                        set undolevels=1000
                                                                                                                                        set undoreload=10000
                                                                                                                                        

                                                                                                                                        This avoids cluttering my working directories with undo / backup / swap files and gives me effectively unlimited persistent undo, my favourite feature of vim. If I run neovim on a file that I’ve edited with vim, it complains. Similarly, if I edit with nvim and then vim, vim can’t read the undo file. I wish they’d change the name of files if they were going to have things for the same purpose as vim but with incompatible formats.

                                                                                                                                        1. 3

                                                                                                                                          I wish they’d change the name of files if they were going to have things for the same purpose as vim but with incompatible formats

                                                                                                                                          This can be achieved with something like

                                                                                                                                          if has('nvim')
                                                                                                                                            set undodir=${XDG_CACHE_HOME}/nvim/undo//
                                                                                                                                            ...
                                                                                                                                          else
                                                                                                                                            set undodir=${XDG_CACHE_HOME}/vim/undo//
                                                                                                                                            ...
                                                                                                                                          endif
                                                                                                                                          

                                                                                                                                          I believe the undofile format became incompatible only very recently, when more information was added to undofiles.

                                                                                                                                          1. 1

                                                                                                                                            That’s what I did, but it’s annoying that I have to.

                                                                                                                                            I was also quite excited by the built-in LSP support, but all of the tutorials I found required incredibly complex configs and didn’t explain how to configure the LSP integration for something like clangd for C/C++.

                                                                                                                                      2. 1

                                                                                                                                        There are heaps of incompatibilities between Vim and Neovim, and have been for years.

                                                                                                                                        https://news.ycombinator.com/item?id=27719968

                                                                                                                                      3. 1

                                                                                                                                        What are some neovim features that you’ve really liked? I generally see the same things trotted out by fans, like treesitter and in-build LSP, but these aren’t things I’ve felt like I was missing in Vim (I do use LSP, plugins work well for this). I’d love to hear what benefits you have found, as an experienced Vim user?

                                                                                                                                        1. 6

                                                                                                                                          It’s a bit of a moving target, because a lot of neovim innovations are eventually implemented in vim. That’s what happened with floating windows, async jobs, and terminal emulation. So I guess the feature I really like is being a couple years ahead of everyone else :)

                                                                                                                                          There’s also a few smaller things: I really like inccommand, which I don’t think has been ported over yet. And I just found out I can use the lua bindings to do this:

                                                                                                                                          local nav_keys = {'h', 'j', 'k', 'l'}
                                                                                                                                          for _, key in ipairs(nav_keys) do
                                                                                                                                            local c_key = '<c-'..key..'>'
                                                                                                                                            vim.api.nvim_set_keymap('n', c_key, '<c-w>'..key, opts)
                                                                                                                                            vim.api.nvim_set_keymap('t', c_key, [[<c-\><c-n><c-w>]]..key, opts)
                                                                                                                                          end
                                                                                                                                          

                                                                                                                                          I expect that as I get more comfortable with lua and the neovim API I’ll have more say. I write a lot of custom functions and vimL is one of the worst languages I’ve ever used.

                                                                                                                                          EDIT ooh something I just realized I can do:

                                                                                                                                          local set_all = function(list)
                                                                                                                                          for _, item in pairs(list) do
                                                                                                                                            vim.o[item] = true
                                                                                                                                          end
                                                                                                                                          end
                                                                                                                                          
                                                                                                                                          set_all {"termguicolors", "hidden", "splitright"}
                                                                                                                                          set_all {"number", "relativenumber"}
                                                                                                                                          

                                                                                                                                          That’ll make it easy to create setting groups.

                                                                                                                                          1. 2

                                                                                                                                            No, no inccommand in Vim still. I was quite keen on this for a while until I discovered traces.vim which is a lot more powerful.

                                                                                                                                            Yeah vimL has its quirks. The actual examples you’ve shown would look pretty similar in vimscript though … although they would use :execute, e.g. exe 'nnoremap' c_key '<c-w>..key. I’ve come to quite like vimL but I realise that puts me pretty firmly in the minority. I hate the line continuations but those are going away in vim9script.

                                                                                                                                            It does look like configs will diverge now, to the lua neovim scripts and the Vim vim9script scripts. Which I suppose is good, trying to support 2 diverging editors with a single code-base is annoying, as each add different features.

                                                                                                                                            1. 1

                                                                                                                                              You can map stuff in loops in regular VimScript:

                                                                                                                                              for k in ['h', 'j', 'k', 'l']
                                                                                                                                                  exe printf('nnoremap <C-%s> <C-w>%s', k, k)
                                                                                                                                                  exe printf('tnoremap <C-%s> <Cmd>wincmd %s<CR>', k, k)
                                                                                                                                              endfor
                                                                                                                                              

                                                                                                                                              For a somewhat creative use of this you can see this ;-)

                                                                                                                                              I guess the issue is that a lot of people just can’t be bothered to invest in learning VimScript, which is fair enough. But pretty much anything you can do in Lua you can do in VimScript, and vice versa.

                                                                                                                                              1. 1

                                                                                                                                                I guess the issue is that a lot of people just can’t be bothered to invest in learning VimScript, which is fair enough. But pretty much anything you can do in Lua you can do in VimScript, and vice versa.

                                                                                                                                                Also, there’s more third party Lua libraries. A while back I needed to fill an autocomplete based on information in a YAML file, but couldn’t figure out how to parse YAML in VimScript. I ended up writing a python script to first convert the file to JSON, then use json_decode. It worked in that case but would have been nicer to just import a library and read the YAML directly.

                                                                                                                                                1. 2

                                                                                                                                                  I think this - the availability of the Lua library ecosystem - is probably a “bigger deal”, looking forward, than the performance/tooling/ergonomics benefits Lua brings over VimScript. I haven’t seen too much adoption of Luarocks packages in plugins yet (though there are some examples, e.g. https://github.com/camspiers/snap), but I expect this to change now that 0.5 is stable.

                                                                                                                                                  I will also say that, while anything* you can do in Lua you can do in VimScript, I personally find it much easier to do most things in Lua - partially due to familiarity, but also due to the simplicity of the language and the relative lack of footguns, compared to VimScript.

                                                                                                                                                  *In Neovim specifically, Lua provides access to luv, which I’m not sure you can access from VimScript. In my experience, having the libuv event loop and utility functions readily at hand makes it possible to write functionality which would be at least substantially more painful without these tools.

                                                                                                                                                  1. 2

                                                                                                                                                    I haven’t seen too much adoption of Luarocks packages in plugins yet, but I expect this to change now that 0.5 is stable.

                                                                                                                                                    Why do you expect this to change with 0.5? It’s been possible to write Lua plugins since 0.3, with luv becoming available in 0.4. I don’t see anything (besides the hype, maybe? :^) ) in 0.5 that would change the attitude of plugin authors towards Luarocks.

                                                                                                                                                    1. 1

                                                                                                                                                      It’s true that we’ve had the ability to write Lua plugins for a while now, but there’s been a huge increase in the use of Lua during the later part of the 0.5 development cycle (the past year or so). This, to me, indicates that we may have passed an inflection point in the ease of using Lua for plugin development that will contribute to more people writing Lua plugins, and (potentially) more people using functionality from Luarocks libraries for those plugins (though I admit this also assumes that people need and know about the libraries available through Luarocks).

                                                                                                                                                      The hype is another factor, at least at first. And - noting that this runs dangerously close to self-promotion - I think that tools like packer.nvim‘s Luarocks integration (which you can use even if you don’t use packer for plugin management) significantly lower the complexity cost of using Luarocks packages, while also requiring features from 0.5.

                                                                                                                                                      1. 2

                                                                                                                                                        I see. In my opinion there’s a fundamental issue with the with dependencies where as a plugin author you don’t want to rely on external dependencies (otherwise you’re inevitably going to end up with people opening issues after misconfiguring the dependencies for your plugin…) but vendoring is fairly unattractive too (messes up version control history, you have to manually update everything…). This issue was already there with Vimscript and I don’t think it can be solved by anything else than Vim/Neovim implementing a full-featured plugin manager (which I don’t think it should do).

                                                                                                                                                        1. 1

                                                                                                                                                          Yeah, that’s definitely true too. I think this is easier with Luarocks because it already supports some basic versioning specification, so you can control what versions of dependencies your users get without needing to vendor. I definitely agree that there shouldn’t be a full-featured plugin manager baked into Vim/Neovim, though - people’s preferences and needs around plugin management are too disparate for there to be a good “one size fits all” option, in my opinion.

                                                                                                                                                          1. 2

                                                                                                                                                            I think this is easier with Luarocks because it already supports some basic versioning specification

                                                                                                                                                            My point was that the package manager that downloads from luarocks itself becomes a dependency, which you want to avoid. So luarocks doesn’t really make things easier there :)

                                                                                                                                                  2. 1

                                                                                                                                                    One way would be to use Python:

                                                                                                                                                    :pyx import yaml, vim; vim.vars['x'] = yaml.safe_load('{"hello": [1, 2]}')
                                                                                                                                                    

                                                                                                                                                    Or Ruby, Racket, Lua, Tcl, Perl, or even Visual Basic. It’s nice that Vim can interface with all that, but the big problem with that is that a lot of people don’t have the scripting support, and if you want things to work on Linux (all distros), macOS, and Windows is nigh-impossible. In reality It’s all pretty useless if as can never use it and have it work for everyone (the reason I didn’t try :lua is because my Vim isn’t compiled with it, and also, because I don’t really know Lua).

                                                                                                                                                    Generally Vim tries to minimize required dependencies, which isn’t a bad thing. The Lua interpreter is pretty small so it could be integrated like libvterm or xdiff instead of linking toliblua. But I guess it’s too late for that now :-/

                                                                                                                                          1. 1

                                                                                                                                            I found this article quite fascinating, thanks. It reminds me of the git demos like this where they build a git repo up from scratch without actually using any git <command>s. I get a much better understanding of what the tool actually does (docker in this case) by seeing these methods of replicating functionality.

                                                                                                                                            1. 39

                                                                                                                                              Updates causing a reboot

                                                                                                                                              Again, I’ve simply not experienced this. Now, back in the Windows 2000/XP days, yeah I think we all experienced this. However, for many years now, I’ve not seen this happen.

                                                                                                                                              I have, many times, left my computer on overnight to come back to it being at the login screen with literally zero intervention. Looking at my update history, I think this happens about twice a month or so.

                                                                                                                                              1. 20

                                                                                                                                                Oh God! I really wish the author would tell us how in the world they achieved this state!

                                                                                                                                                I have a Windows 10 machine that I use for work and it’s driving me nuts. Despite having disabled every single switch that Google told me to disable, this machine will automatically wake up and reboot to install updates if it’s on sleep.

                                                                                                                                                Thing is, it doesn’t even work: this is a laptop, that I take with me on the road for my one customer whose stack depends on Windows, so the hard drive is encrypted. It reboots at 3 AM and then I wake up to… the Bitlocker prompt, which is followed, of course, by a good half hour of “hang on”. Should I seriously believe that nobody at Microsoft ever tried to update a computer with an encrypted hard drive?

                                                                                                                                                It’s driving me nuts because the reason why that machine is on sleep is that it runs a diverse array of rather arcane applications, some of which aren’t exactly top-notch and lack various features like, uh, workspace management. So it takes me like 20 minutes to start up all of them and set things up back the way they were, so it’s easier to just let the laptop sleep.

                                                                                                                                                On a tangential note: I think this is a hole that Microsoft have dug themselves into.

                                                                                                                                                20 years ago there was really no question of whether you wanted to upgrade to one of the service packs. At best you’d wait two or three weeks to let early adopters find any of the truly bad, hard drive-wrecking blunders, but after that you’d update.

                                                                                                                                                Nowadays, when you reboot after an update, you may boot to a more secure system with the latest security patch. Or a full-screen ad for Microsoft Edge that you have no idea how to hide, oh, and it’s set itself to be the default browser (guess who had to drive halfway across town in the middle of the pandemic because their parent had to teach online classes and they didn’t know how to make the ad go away – then drive back again because “they couldn’t find Firefox”). Or a brand-new version of Candy Crush Saga on Windows 10 Pro (I’ve given up wiping it, I now accept it as a fact of life, the way I accepted My Briefcase on Windows 95).

                                                                                                                                                Of course nobody trusts the updates now, so now it’s a silent, subversive war, in which Microsoft has to find new ways to force updates because the users have been burned so many times they will never update on their own (fool me once etc. etc.) and everyone else tries to figure out ways to dodge them, at least until they can get their work done.

                                                                                                                                                1. 6

                                                                                                                                                  I have had similar rage, and eventually wrote a little utility to just solve the problem: https://github.com/wheybags/Win10BSFixer

                                                                                                                                                  Every 10 seconds, it checks if the windows update service is running, and if it is, kills and disables it. Have had zero problems since, and it does allow you to pause the update blocking and manually update when you want to.

                                                                                                                                                  1. 2

                                                                                                                                                    You are my new favourite programmer now!

                                                                                                                                                2. 6

                                                                                                                                                  Very common. Many, many times this has messed up cryptomining for me. I haven’t used windows for mining, or for anything for awhile now, so maybe that has changed in the last year or two.

                                                                                                                                                  1. 22

                                                                                                                                                    Very common. Many, many times this has messed up cryptomining for me.

                                                                                                                                                    I never thought I’d look on this behaviour as a good thing, until now.

                                                                                                                                                    1. 2

                                                                                                                                                      It’s still not. The real problem, giant mining firms with hundreds of thousands of GPUs calculating useless hashes 24/7, know how to get around it. It makes literally zero difference whether slylax puts their GPU to use overnight every now and then. Hell, they may even use their desktop as a crypto mining thermostat for all we know, in which case it’d make literally no difference compared to any other form of resistive heating.

                                                                                                                                                  2. 5

                                                                                                                                                    This was my major gripe. I never felt comfortable leaving the machine on a long running process overnight, even if I had remembered to go to the updates menu and disable updates for 7 days, which is the maximum AFAIR.

                                                                                                                                                    After having switched to Linux with Windows running in a VM for the few things I need, my machine runs faster and lighter, the fans spin less and I get more battery life. And I trust my computer again.

                                                                                                                                                    1. 1

                                                                                                                                                      The cancer is making its way to Linux, though. Ubuntu snaps have a similar “updates happen by our command and you can delay them a bit but that’s it” philosophy. It is infuriating if you are managing the rule lists for host-level intrusion detection.

                                                                                                                                                    2. 4

                                                                                                                                                      It even wakes itself up in the middle of night to do some updating and then reboots itself, only to end up in Linux because of the dual-boot. And it’s not exactly easy to convince it not to do that.

                                                                                                                                                      1. 3

                                                                                                                                                        I think this also depends on whether and how the IT department manages this. It is hard to discover who is responsible for this.

                                                                                                                                                        1. 3

                                                                                                                                                          This is my personal desktop, so my IT department is me.

                                                                                                                                                        2. 3

                                                                                                                                                          I own a windows 10 machine that I boot about once a month and it feels like I always have to do an update which requires a reboot. So, at least in my experience, this update/reboot thing is absolutely common.

                                                                                                                                                          1. 3

                                                                                                                                                            Updates causing a reboot

                                                                                                                                                            Again, I’ve simply not experienced this. Now, back in the Windows 2000/XP days, yeah I think we all experienced this. However, for many years now, I’ve not seen this happen.

                                                                                                                                                            I have, many times, left my computer on overnight to come back to it being at the login screen with literally zero intervention. Looking at my update history, I think this happens about twice a month or so.

                                                                                                                                                            Same here. Worse, I’ve lost work because of it more than once. Much more recently than the Win 2000/XP days.

                                                                                                                                                            About a year ago, when I got a document that I could only handle on Windows for some reason, fired up my not-too-frequently used Windows machine with Outlook on it, and read/started composing a reply. This was a bit earlier than my normal workday, around 4:30 AM. When I walked upstairs around 5:30 to make myself some more coffee and returned to my basement office around 5:50, the machine was sitting there, rebooted. It discarded my in-progress draft response. It didn’t save it to my IMAP drafts folder. It didn’t save it to a local drafts folder. It was just gone.

                                                                                                                                                            I’ve been using computers long enough to know I shouldn’t walk away from even a laptop without saving, but this age of auto-saved drafts has made me soft.

                                                                                                                                                            I think this phenomenon is especially bad for systems that don’t get booted and used all the time, which may account for the seemingly outsized perception of the problem by people who primarily use other OSes. If it’s been more than a couple weeks since I booted a VM, I feel like I need to allow an hour for it to update, reboot, update again and settle down post-update before I can really use it.

                                                                                                                                                            1. 4

                                                                                                                                                              I think this phenomenon is especially bad for systems that don’t get booted and used all the time, which may account for the seemingly outsized perception of the problem by people who primarily use other OSes.

                                                                                                                                                              This is exactly the issue with my gaming PC.

                                                                                                                                                              I’m really cooling off on the idea of a gaming PC as of late because of BS like this. When I finally do arrange a time with friends to play every 2-3 weeks, it’s a dice roll whether W10 will pull some inane crap like this because you actually had the gall to boot it up and use it: “you need to update! You have to wait an unspecified amount of time!”

                                                                                                                                                              What I really want to know is: what exactly is it doing after it applies updates? It seems like it just sits there for 5-10 minutes “finalizing” settings.

                                                                                                                                                              The absolute worst: W10 thinking it is okay to upgrade your video driver while you are using it. Most games/apps just crash outright because they aren’t designed to handle this.

                                                                                                                                                              1. 3

                                                                                                                                                                I’m really cooling off on the idea of a gaming PC as of late because of BS like this. When I finally do arrange a time with friends to play every 2-3 weeks, it’s a dice roll whether W10 will pull some inane crap like this because you actually had the gall to boot it up and use it: “you need to update! You have to wait an unspecified amount of time!”

                                                                                                                                                                Same for the XBox 360. It would disable a lot of features (e.g. networking) if you didn’t update (maybe it still does). We were not very regular gamers, so we would often start the XBox after a couple of weeks to call family on Skype with the Kinect camera. Only to disappoint them that they had to wait 30-60 minutes while the XBox fetches some update.

                                                                                                                                                                1. 2

                                                                                                                                                                  what exactly is it doing after it applies updates? It seems like it just sits there

                                                                                                                                                                  One of the most annoying aspects of Windows updates is that user profile data seems to need migration to the latest schema. For whatever reason, this can’t occur during the system update and is instead ran the next time that user logs in. Which means updating in the middle of the night hardly saves me any time.

                                                                                                                                                                  1. 2

                                                                                                                                                                    If I’d guess, I’d say that user profile stuff is probably encrypted with the user’s password, so it has no way to read the user profile until the user logs in and it has the password. That would make sens to me at least.

                                                                                                                                                                    Not that that’s an excuse. There are definitely solutions here which would move the schema migration time to a less inconvenient time than right as you’re logging in, or ways to make the schema migration process faster. (Or ways to keep the user profile schema stable across most updates.)

                                                                                                                                                                  2. 1

                                                                                                                                                                    I’ve found that like 99% of the time, I can get a game to run on Linux now. I still sometimes reboot into Windows to play a game with friends if it’s a game I haven’t played before, but after that initial session, I usually go back into Linux and spend some time getting it to run in my main set-up. So far, there’s one game we’ve tried to play which I haven’t gotten to run in Linux - and that’s not due to a technical limitation, but because the anti-cheat detects that it’s not on Windows somehow and therefore disables online functionality.

                                                                                                                                                                    In a surprising amount of cases, all it takes is literally just downloading the game on Steam and letting Proton automatically do its thing. Sometimes, I have find an installer on lutris.com, but then it usually works fine once installed.

                                                                                                                                                                    I wish “getting the game to work on my system” wasn’t a thing I had to spend time on. But overall, it’s much nicer to have to do that once per game than to have to boot into Windows and deal with its updates, an environment I’m less used to, losing all my Linux state, etc.

                                                                                                                                                              1. 8

                                                                                                                                                                This really puts into perspective how complex Vim really is. And yet, when using it, it never feels complex; it feels natural, simple, and intuitive, which just shows how well designed it is. The user can take advantage of so much, and switch between many different states, and it’s all presented in a way that rarely ever feels bloated or overwhelming.

                                                                                                                                                                1. 6

                                                                                                                                                                  I didn’t learn vim until I joined a company where it was a mandatory part of the workflow. I’ve been using it now for about 18 months. I would say I’m decent with it.

                                                                                                                                                                  It definitely still feels complex. p can be used to paste something from the registers in normal mode, but in insert mode I have to use ctrl+r " to accomplish the same thing. ctrl+w is the motion for window-based actions in normal mode, but in insert mode it deletes the word before the cursor (an action I accidentally perform constantly). Any sense of intuition anybody feels about it is hard fought and earned from years of intentional, focused use on it.

                                                                                                                                                                  Just now, in the process of writing this post, I had to go look up the exact syntax for looking up exactly what ctrl+w did in insert mode. The syntax for that was apparently :help i_CTRL-W. I haven’t had much opportunity to dig into the documentation to try to learn more complex actions because whenever I do, I feel stymied by the crunchiness of it all. When the process of looking up how things work is overwhelming, I think it’s fair to say that the system is neither inherently intuitive nor particularly well-designed.

                                                                                                                                                                  I understand why people feel strongly about their enjoyment of vim or emacs, but I often wish I could just go back to VS Code.

                                                                                                                                                                  1. 9

                                                                                                                                                                    First, as someone who loves vim, someone being forced to use it sounds like torture, and a really silly strategy for a company, let devs use what they’re comfortable with!

                                                                                                                                                                    The help is, in my opinion, the best documentation of any tool I’ve ever used. There are some tricks to using it effectively though. In this case yes, you found the correct command to get to the right place in the help, but I find this shortcut much easier to remember/intuit: :h i^w. The i is the mode, and ^ indicates CTRL. Another example is :h ^w^J to find the help for the normal mode command to move a window to the bottom of the screen.

                                                                                                                                                                    In addition to the reference manual, which is what you get when you use the :help command to find particular commands/motions/options/regex tools etc., there’s also the user manual, which has a completely different style and can be read start-to-finish like a book. It’s very readable and is full of examples and in-depth descriptions of workflows. :h user-manual

                                                                                                                                                                    For an overview of the help system itself, :help helphelp is a good place to start.

                                                                                                                                                                    1. 3

                                                                                                                                                                      I appreciate this cool and useful post - and I will take it all to heart - but I do want to point out the unintentional hilarity that to learn more about the help system I have to scream help into the void over and over again.

                                                                                                                                                                      1. 2

                                                                                                                                                                        I love it. You can shorten it a bit but that’s one that I prefer to write out in full. It’d be nice if you could choose to use all caps…

                                                                                                                                                                        1. 1

                                                                                                                                                                          :help!

                                                                                                                                                                          E478: Don’t panic!

                                                                                                                                                                    2. 4

                                                                                                                                                                      Yeah, the default bindings / syntax for Vim can be a bit awkward at times. I was moreso referring to how I never feel like I have to keep a mental map in my head of what mode(s) I’m currently in and how they relate to one another. I think some binds make more sense for some than others, because people naturally adapt differently to different workflows. Per your ctrl+w example, I’m the exact opposite, in that I regularly use ctrl+w in insert mode (in fact while typing this reply I tried pressing ctrl+w to delete a word and accidentally closed the browser tab :P ), but I have the window-management keys remapped to be quicker and easier to use.

                                                                                                                                                                      I disagree with your conclusion that you finding it difficult to look things up in the documentation shows that the system isn’t well designed. Perhaps not “intuitive”, though that was a miscommunication on my part, I meant intuitive as in once you know how to do things and it’s in your muscle memory it feels natural. Once you learn the general syntax for the help pages, looking stuff up is relatively straight-forward, and the jump stack can be used to go back and forth between pages (C-o to pop/go back, C-i to push/go forward). Once again though, everyone thinks and works differently, and the solution that is easy and intuitive for one may be cumbersome and overwhelming for another.

                                                                                                                                                                      1. 2

                                                                                                                                                                        I barely even think of vim as being modal anymore since I just use it as a sequence of commands. For example, if I want to insert the word “foo” under the cursor, I’ll hit “ifoo”. So the mental process is not “press i switch to insert mode and do a bunch of stuff then press esc to switch to the other mode”, but rather just “do an insert of this text, terminated by the esc key”.

                                                                                                                                                                        This way, there’s no thinking about mode - it is just always doing commands - and it helps understand exactly what operations like undo and repeat last command will actually do to the document.

                                                                                                                                                                        This mental model also helps compose things better… and avoids bothering with the other weird commands like ctrl+w (which i didn’t even know was a thing until you mentioned it lol).

                                                                                                                                                                      2. 3

                                                                                                                                                                        It helps that most people don’t use most of these modes: I’ve been using Vim for 10 years and don’t think I’ve ever even needed to know about select mode.

                                                                                                                                                                        1. 2

                                                                                                                                                                          This really puts into perspective how complex Vim really is. And yet, when using it, it never feels complex; it feels natural, simple, and intuitive, which just shows how well designed it is.

                                                                                                                                                                          Oof, I have to disagree hard here. Vim has a lot of good things to offer, but natural, simple and intuitive are definitely not on that list. Vim is incredibly complex and clunky. The good ideas behind it could have been implemented in a much more elegant way.

                                                                                                                                                                          After using Neovim for five years I got so fed up with it that I even started a project to write my own editor. But fortunately I had not spend much time on it before I discovered Kakoune. (Actually, that was not luck. I discovered it when doing some research for my own project.) I am still in the transitioning phase, but so far I really like it.

                                                                                                                                                                        1. 9

                                                                                                                                                                          Maybe not everyone knows this, but instead of pressing ESC in vim, which is kind of far, you can do Ctrl+[, it will send the same signal to vim.
                                                                                                                                                                          Looking at the ASCII table (man 7 ascii) you’ll instantly know why, control is interpreted in terminals as nullifying the 6th and 7th bit:

                                                                                                                                                                                 033   27    1B    ESC (escape)                133   91    5B    [
                                                                                                                                                                          

                                                                                                                                                                          This is also the reason why ESC often shows as ^[.

                                                                                                                                                                          1. 2

                                                                                                                                                                            Isn’t that even worse from the RSI-avoidance point of view?

                                                                                                                                                                            1. 2

                                                                                                                                                                              I have caps lock mapped to ctrl, so ESC is just a small movement away for my little fingers. Not sure if that helps RSI avoidance, but it’s a bit less stretching around.

                                                                                                                                                                            2. 2

                                                                                                                                                                              That’s very interesting, I did not know that.

                                                                                                                                                                              1. 2

                                                                                                                                                                                Or use something like xcape and turn Ctrl into ESC.

                                                                                                                                                                                1. 4

                                                                                                                                                                                  Even better, bind caps lock to ESC (when tapped) and CTRL (when chorded) using e.g. caps2esc on Linux or AutoHotKey on Windows. This has dramatically reduced stress I was experiencing in my left forearm, as my wrists sit at a much more natural angle.

                                                                                                                                                                                2. 2

                                                                                                                                                                                  Switching caps and esc is also really good tho! How often do you need to caps, really?