News for hackers. Stuff that matters.
Re:Zed, a collaborative code editor, is now open source by Octoth0rpe on Wednesday January 24, 2024 @01:04PM (#39120545)
I'm generally a big fan of zed and have been using it for 60%ish of my dev time for 6 months or so. A couple of nice things to note:

- It really is remarkably responsive,and makes one really notice how UNresponsive everything else is. I have reasonably fast machines, so we're not talking about the difference between 5ms typing lag and 500ms, but it's still pretty surprising. VSCode never felt slow on my macs until I started using Zed.

- They seem reasonably responsive to feedback. There was some contention around how search/replace was initially implemented, and the current builds have something much more usable IMO. I'm not sure how much that was driven by community feedback, but the changes were great.

- The debug syntax tree mode is a really neat feature that I think demonstrates how much more advanced zed is under the hood than older editors that are doing syntax highlighting via regex.

There are a few downsides that I'm hoping get addressed soon:

- The collaboration workflow/security isn't very clear to me. You sign in via github (no other option???), there are 'contacts' (I guess these are github usernames?), and 'channels' (where do these live? on zed's servers?). I would really like to know if I can self-host the chat server and use a company oauth provider rather than github. If the diffs being passed around are going through zed's servers, that may be a showstopper for the company I work for as well. If they're p2p and encrypted, maybe not.

- I would love to see ollama integration. This + continue is the only reason why I spend any amount of time in vscode now. There's an issue for it here: https://github.com/zed-industries/zed/issues/4424

Re:Zed, a collaborative code editor, is now open source by rob74 on Wednesday January 24, 2024 @03:14PM (#39122071)
> VSCode never felt slow on my macs until I started using Zed.

I guess you haven't used Sublime Text before?

Re:Zed, a collaborative code editor, is now open source by bastawhiz on Wednesday January 24, 2024 @03:49PM (#39122455)
I switched _to_ VSCode because Sublime was occasionally so slow at times that it was unusable. It was very fast 95% of the time, but then I'd `git pull` on a very big repo and my machine would become unresponsive while Sublime did...something.
Re:Zed, a collaborative code editor, is now open source by GrumpySloth on Wednesday January 24, 2024 @05:38PM (#39123551)
I think on Linux at least it freezes due to watching too many files using inotify to update its sidebar. I wish there was an option to disable that. Same thing happens with Sublime Merge. It’s unusable on giant repos.
Re:Zed, a collaborative code editor, is now open source by ben-schaaf on Wednesday January 24, 2024 @06:23PM (#39124032)
Sublime Text 4166 has some major improvements in that area, previously ST would check every file in the side bar for changes in order to update its index but this is now done incrementally.
Re:Zed, a collaborative code editor, is now open source by Player6225 on Wednesday January 24, 2024 @11:19PM (#39126149)
This is very strange to me, because I have always used Sublime Text for super-giant corporate repos, and always found it snappy compared to vscode. Wonder if it was a specific usecase or something...

Every little while, I try to make vscode my main editor, because I enjoy all the features. I always switch back to Sublime just because VSCode's slowness bugs me.

Haven't really tried Zed in earnest yet, though, because of no custom LSP support.

Re:Zed, a collaborative code editor, is now open source by bastawhiz on Thursday January 25, 2024 @11:51AM (#39131656)
I'll be eager to try Zed when it gets LSP support for sure
Re:Zed, a collaborative code editor, is now open source by Octoth0rpe on Wednesday January 24, 2024 @03:57PM (#39122536)
Not in 15ish years and at the time I think I had a 5400rpm hd, so that probably limited any perception of sublime being noticeably faster than other editors I was using (geany, kate). I don't doubt that sublime is faster than vscode today, but the vscode ecosystem is a pretty nice place to be and probably worth trading some speed for, especially on a nice mac where the trade off is probably small. Zed might be even better however.
Re:Zed, a collaborative code editor, is now open source by stevage on Wednesday January 24, 2024 @03:17PM (#39122107)
I had to stop using sublime because it kept updating its search index at inconvenient times and slowing to a crawl.

That and self updating in ways that broke my most important plugin.

Re:Zed, a collaborative code editor, is now open source by SnowingXIV on Wednesday January 24, 2024 @03:43PM (#39122393)
I’m still using Sublime for the references, without fail I can load up any version of an application including older rails apps sub 3 and it instantly has context. I can easily jump to definitions and even on hover will show me where they are being used. In the context of foos.bars.baz I could easily infer where bars is defined. Seems to work across languages, doesn’t matter if it’s js, ruby, in an erb file it just works. Not to mention the flavor of vim feels great.

VSCode complains and I’ve got to hardcode an alternative absolute path gemfile for Shopify’s LSP to work. It also feels clunkier, even on powerful machines.

If Zed can give parity with Sublime on the references (I just tried and it did not seem to find any references when clearly bars was there) might be an interesting change. Considering it’s open source now I’d happily switch as it does seems super quick.

I might also be old-man yells at cloud and the copilot integration doesn’t appear important yet, but current sublime support is pretty poor for it and seems like that’ll be a thing more and more.

Re:Zed, a collaborative code editor, is now open source by nicoburns on Wednesday January 24, 2024 @05:37PM (#39123540)
I was hitting that bug for about 6 months, but at least for me they have actually fixed it now.
Re:Zed, a collaborative code editor, is now open source by bayindirh on Wednesday January 24, 2024 @03:53PM (#39122494)
or BBEdit.
Re:Zed, a collaborative code editor, is now open source by kstrauser on Thursday January 25, 2024 @11:31AM (#39131356)
That’s where I landed after v14 with LSP support came out. It’s so nimble! And extensions with shell scripts and CLI programs is right in my wheelhouse.
Re:Zed, a collaborative code editor, is now open source by reddalo on Wednesday January 24, 2024 @06:00PM (#39123812)
Cries in PhpStorm
Re:Zed, a collaborative code editor, is now open source by satvikpendem on Wednesday January 24, 2024 @06:28PM (#39124075)
Or vim, I suppose. It's remarkable how slow VSCode actually is, but I still use it because I hate configuring vim and packages always break when upgrading, it's honestly worse than npm.
Re:Zed, a collaborative code editor, is now open source by herjazz on Wednesday January 24, 2024 @10:21PM (#39125877)
Are you sure that’s vim rather than Melvin. Never had any issues with anything breaking on an upgrade using vim.
Re:Zed, a collaborative code editor, is now open source by satvikpendem on Thursday January 25, 2024 @03:07AM (#39127331)
Not sure what Melvin is. I've always had issues, specifically when I have lots of packages, such as when installing stuff through lazy.vim.
Re:Zed, a collaborative code editor, is now open source by sodapopcan on Thursday January 25, 2024 @09:59AM (#39130214)
Updating vim packages can be a nightmare if you don't vet your plugins and generally install stuff "just in case I want to try it out later". If you aren't using a plugin with any regularity, delete it.
Re:Zed, a collaborative code editor, is now open source by satvikpendem on Monday January 29, 2024 @01:26PM (#39180146)
Yeah but I never have issues with VSCode plugins, so I'm not sure what the difference is with Vim.
Re:Zed, a collaborative code editor, is now open source by sodapopcan on Sunday February 04, 2024 @02:49PM (#39253675)
I don't know what vscode's plugin architecture is like but I imagine it's just that Vim's is extremely powerful and, you know, with great power comes great responsibility and all that. Unfortunately, many vim plugin authors are not responsible, or don't realize they aren't being so.
Re:Zed, a collaborative code editor, is now open source by flexagoon on Wednesday January 24, 2024 @04:50PM (#39123045)
> older editors that are doing syntax highlighting via regex.

I mean, Emacs, which can probably be considered the oldest code editor at this point, got built-in tree-sitter (which is what Zed uses under the hood) support in the last release. So it's not really related to editors being new or old

Re:Zed, a collaborative code editor, is now open source by dnsco on Wednesday January 24, 2024 @06:40PM (#39124185)
It's not just tree-sitter that makes zed feel snappy.

If you're using a reasonably fast language-server, which rust-analyzer apparently is (I didn't know this using vscode), the autocomplete & intentions feel instantaneous.

I think the team has learned a lot from previous editor implementations (they were the core team of atom that was notoriously slow), and so they've had an opportunity to do a lot of stuff right.

FWIW they also are the team that originally wrote tree-sitter.

The quickness feels more like it's in the core of the editor. I was shocked how much it impacted the editing experience when I tried it in early beta.

Re:Zed, a collaborative code editor, is now open source by FridgeSeal on Wednesday January 24, 2024 @09:09PM (#39125416)
> If you're using a reasonably fast language-server, which rust-analyzer apparently is (I didn't know this using vscode)

Some more anecdata to back this up: initial workspace load in VScode I can watch RA tick through its progress. Clean and boot up Zed and the same process is so fast that it’s almost unbelievable.

Re:Zed, a collaborative code editor, is now open source by widdershins on Thursday January 25, 2024 @02:10AM (#39127031)
I've been impressed with the C++ clangd language server snappiness in Zed compared to both CLion (my old favorite) and Emacs (apple of my eye for 2.5 yrs).

I always thought the major slowness was coming from clangd itself, so I'm surprised and impressed to see that Zed appears to be quicker on this front. I might be using Zed as a 'second opinion' editor because of this.

However, now I'm used to the infinite customizability and coziness of Emacs, it's going to be hard for me to move across to Zed permanently.

Re:Zed, a collaborative code editor, is now open source by erk__ on Thursday January 25, 2024 @02:22AM (#39127103)
Emacs have some issues with LSP speed because of the json parsing not being the fastest which have lead to work like this: https://github.com/blahgeek/emacs-lsp-booster.
Re:Zed, a collaborative code editor, is now open source by widdershins on Thursday January 25, 2024 @05:10AM (#39127976)
Ah, thanks for the link, I hadn't seen that. I will give Eglot another go with this set up!
Re:Zed, a collaborative code editor, is now open source by The_Colonel on Thursday January 25, 2024 @01:19AM (#39126761)
As I understand, tree-sitter implementation in Emacs is currently more like a foundation for development / adoption by plugins, it's not really usable as-is today.
Re:Zed, a collaborative code editor, is now open source by nequo on Thursday January 25, 2024 @02:02AM (#39126991)
Emacs already had tree-sitter before 29, just not built in. You can do syntax highlighting[1] and structured editing with it.[2] What is missing for it to be usable in your view?

[1] https://emacs-tree-sitter.github.io/syntax-highlighting/

[2] https://github.com/meain/evil-textobj-tree-sitter

Re:Zed, a collaborative code editor, is now open source by epcoa on Thursday January 25, 2024 @02:39AM (#39127190)
Your understanding is outdated/incorrect. Already a number of major modes have corresponding ts modes and I use them daily. This includes C++, Rust, Python, yaml, toml, json, Java, typescript, dockerfile and cmake. True not every major mode has treesitter in the official release but I’d hardly call the above “not usable”
Re:Zed, a collaborative code editor, is now open source by chlorion on Saturday January 27, 2024 @02:10PM (#39158780)
There are multiple tree-sitter based major modes that are usable right now!

I use python-ts-mode, rust-ts-mode, c++-ts-mode, bash-ts-mode and a few more right now and they work well.

You can write your own modes with it also, but I have not yet looked too deeply into this.

It's definitely usable today in emacs-29, but not every language has a tree-sitter mode yet.

Whoops my tab was outdated and I didn't see that others already replied.

Re:Zed, a collaborative code editor, is now open source by sswezey on Friday January 26, 2024 @08:13AM (#39142249)
As a note, the zed editor team were the creators of the tree-sitter project
Re:Zed, a collaborative code editor, is now open source by thrwwycbr on Friday January 26, 2024 @10:22AM (#39143652)
It's ironic that you say that, even though the people building zed were the ones building the tree sitter in the first place.
Re:Zed, a collaborative code editor, is now open source by mjaniczek on Wednesday January 24, 2024 @04:01PM (#39122595)
Now I wonder what's the typing lag of 10xeditor, compared to Zed...
Re:Zed, a collaborative code editor, is now open source by benreesman on Wednesday January 24, 2024 @06:54PM (#39124314)
I’m really picky about my tools in general and latency in particular, and I give Zed a spin from time to time, it’s sweet. Clean, minimal design aesthetic, tree-sitter, tight code, it’s a nice bit of work and I dig it a lot.

But emacs 29 with the right flags and a tuned GC (no one does this! it’s got a heap-size from the 80s!) is just as snappy and has more amazing packages than VSCode.

There’s a market for people who want something snappier than VSCode but less labor-intensive to set up than emacs, and I wish them luck: I think it’s a front runner there. But I can’t imagine switching my main axe up with a holy shit moment a lot crazier than tree-sitter in 2024 and not having the render loop be in JS.

Re:Zed, a collaborative code editor, is now open source by jitl on Wednesday January 24, 2024 @07:41PM (#39124713)
How do you get a reasonably fancy Emacs to start up/open files quickly? Every time I try to get into EMacs after adding a few packages it becomes painfully slow to open a file for editing. Then I try to understand Emacs server, then I fail / give up and go back to vim.
Re:Zed, a collaborative code editor, is now open source by willdr on Wednesday January 24, 2024 @07:42PM (#39124724)
Open it at 8am, close it at 8pm
Re:Zed, a collaborative code editor, is now open source by jkrubin on Wednesday January 24, 2024 @10:37PM (#39125950)
Hahahaha. A dev I work with who has been using eMacs for 30+ years is well known at my company for having eMacs sessions open for 6+ months at a time.
Re:Zed, a collaborative code editor, is now open source by baq on Thursday January 25, 2024 @03:14AM (#39127370)
I’d rather open at 8am, close on kernel upgrade.

At least that’s how I worked with my vim tmux sessions ;)

Re:Zed, a collaborative code editor, is now open source by AlexCoventry on Wednesday January 24, 2024 @08:47PM (#39125237)
Emacs server is quite straightforward. M-x server-start in a running emacs, then emacsclient <filename>. emacsclient -c if you want to open the file in a new window, or emacsclient -t if you want to open it in your current terminal. C-x # when you're done editing the file.
Re:Zed, a collaborative code editor, is now open source by euroderf on Thursday January 25, 2024 @03:13AM (#39127363)
myhome>> emacs --daemon
Re:Zed, a collaborative code editor, is now open source by oarsinsync on Thursday January 25, 2024 @05:13AM (#39127991)

  emacsclient -ca '' 
Connect to the daemon if it’s running, start it if it’s not.

  alias emacs="emacsclient -ca ''"
Re:Zed, a collaborative code editor, is now open source by ideasman42 on Wednesday January 24, 2024 @10:50PM (#39126003)
I've been using emacs as my main editor for years now and don't find the startup speed to be an issue - to the point I've never bothered with emacsclient:

It starts up with ~77 packages in half a second.

This is my config.

https://gitlab.com/ideasman42/dotfiles/-/tree/main/.config/e...

Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @06:58AM (#39128586)
That’s pretty close to what I’ve been running on the GC tuning but I like parts of your spelling better.

This is going MIT as part of a bigger project in about a month (think Lucid s/C++/modern models/).

If I inline attribution you mind if I borrow this or that?

Re:Zed, a collaborative code editor, is now open source by mkesper on Thursday January 25, 2024 @02:27AM (#39127130)
Use doomemacs for a start. It really optimizes startup time and offers vast included modules as well as great package management. https://github.com/doomemacs/doomemacs/blob/master/docs/gett... Oh and for Windows, WSL2 seems to be the fastest: https://github.com/doomemacs/doomemacs/blob/master/docs/gett...
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @06:59AM (#39128596)
Doom is a great start for a low-friction, extreme quality curated emacs setup. +1
Re:Zed, a collaborative code editor, is now open source by kaeland on Friday January 26, 2024 @03:28AM (#39140122)
Another +1 for using DOOM emacs.
Re:Zed, a collaborative code editor, is now open source by Evidlo on Friday January 26, 2024 @04:25AM (#39140490)
So buggy for me.
Re:Zed, a collaborative code editor, is now open source by lynx23 on Thursday January 25, 2024 @03:05AM (#39127316)
I was about to answer "Use emacsclient", but then I realized you can't be bothered to configure it. For me, putting "(server-start)" into .emacs was always enough, but YMMV.
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @06:40AM (#39128472)
https://imgur.com/a/i99Nisn

1.4 seconds for 100 packages, half of which are on probation? My (and soon `HYPER//MODERN`'s) package set is under heavy construction, I'll be sad if I don't get it under 300ms including loading and rendering a logo at 6k from a cold disk which that was.

Rust is a perfectly good language for writing tight code, but those `emacs` inner loops have been tuned by hard-ass pros for 30+ years in straight C, which is plenty fast too. Even the best Rust code doesn't have that kind of tuning in.

`emacs` is fucking fast.

Re:Zed, a collaborative code editor, is now open source by estebank on Thursday January 25, 2024 @12:48PM (#39132289)
With no intention to push back on Emacs being highly optimized, age of an application is not an accurate proxy for level of performance. If it were, grep would be faster than ripgrep. New software can apply optimisations discovered over the previous 40 years, and leverage architectural designs with different assumptions, like the GC limits in Emacs discussed elsewhere in the comments. Older applications can apply those same optimizations, but it's not a given that they will, and changing their architecture can be daunting, for sometimes unknown benefits.
Re:Zed, a collaborative code editor, is now open source by PH95VuimJjqBqy on Friday January 26, 2024 @10:57AM (#39144103)
yeah, I can't deal with the emacs startup.

I mean, it's not slow per se, but compared to vim it's noticeably slower so I can't deal with it.

Re:Zed, a collaborative code editor, is now open source by cyruseuros on Friday January 26, 2024 @04:50PM (#39149035)
The way the other guy said. Then it breaks enough times, you give up, and switch to Helix. Nothing snappier out there (vanilla Vim included) and it comes with all the goodies you'd install 100 packages for (DAP, LSP, treesitter, sane default configs for dozens of languages)

To each their own, but for a hardcore Emacs user (wrote a number od my own plugins) that actually tried and couldn't seriously adopt VSCode for more than a few months, Helix was such a nice surprise + change of pace. Worth giving it a shot if you're caught in that gap.

Re:Zed, a collaborative code editor, is now open source by shanusmagnus on Friday January 26, 2024 @06:59PM (#39150624)
Is there something that approximates org-mode outlining? I don't need all the other stuff org-mode does, but just the simple outliner functionality combined with all the other Emacs stuff is my golden handcuffs.
Re:Zed, a collaborative code editor, is now open source by cyruseuros on Saturday January 27, 2024 @04:44AM (#39154098)
Not that I'm aware of just yet, unfortunately, so might be a good reason to stick around. For me the switch coincided with jumping on the zettelkasten train and I haven't looked back since. I miss some org mode fratures but constantly `org-refile`-ing I can do without.
Re:Zed, a collaborative code editor, is now open source by nccnm on Wednesday January 24, 2024 @07:08PM (#39124430)
Can you share more about your Emacs 29 setup? Thanks
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @07:05AM (#39128637)
I mentioned it above but I’m flattered by your interest (and remember your username as someone serious): my old dots were ok and are floating around but we’re putting together a multi-editor curated setup for good defaults and an emphasis on good, available-weight models as first-class citizens.

It’s a 404 until I get to an RC, but aiming for March 1st on “hyper-modern.ai” for all MIT on emacs, nvim, and vscode.

Re:Zed, a collaborative code editor, is now open source by dataangel on Wednesday January 24, 2024 @10:15PM (#39125856)
what are the right flags and gc tunings?
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @07:06AM (#39128644)
I don’t have much to add on what sibling @darthrupert said. You tweak this or that to your box but that’s an excellent guideline to start.
Re:Zed, a collaborative code editor, is now open source by manupanday1998 on Wednesday January 24, 2024 @10:28PM (#39125907)
Yes you are correct
Re:Zed, a collaborative code editor, is now open source by da39a3ee on Wednesday January 24, 2024 @11:14PM (#39126129)
> But I can’t imagine switching my main axe up with a holy shit moment a lot crazier than tree-sitter in 2024 and not having the render loop be in JS.

Congratulations for winning HN sentence of the year before the end of January.

Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @07:10AM (#39128672)
I’m glad I made a funny but it’s a lot of year to come :) And this one looks to be every bit as interesting as the last one was over-hyped.
Re:Zed, a collaborative code editor, is now open source by conartist6 on Thursday January 25, 2024 @08:11AM (#39129195)
It is a great sentence, and that holy shit moment is coming: when JS gains all the expressivity of tree-sitter and uses it to render code more beautifully than it has ever been rendered before.

(Spoiler: https://github.com/bablr-lang/)

Re:Zed, a collaborative code editor, is now open source by darthrupert on Thursday January 25, 2024 @01:59AM (#39126971)
People are asking what settings would be useful to tweak. Check out the following:

- gcmh -package and gcmh-mode and/or gc-cons-threshold variable (former should take over the latter)

- read-process-output-max

- jit-lock-defer-time

- package-native-compile

Doom Emacs sets gcmh in its initialization so tweaking that might not be needed there. You may still want to touch gcmh-high-cons-threshold and gcmh-idle-delay-factor. Here are mine currently:

    (setq gc-cons-threshold (* 1024 1024 1024))
    (setq gcmh-high-cons-threshold (* 1024 1024 1024))
    (setq gcmh-idle-delay-factor 20)
    (setq jit-lock-defer-time 0.05)
    (setq read-process-output-max (* 1024 1024))
    (setq package-native-compile t)
I've done nothing scientific to check out if these help at all, though, so take them with salt. With and without these, emacs seems quite sluggish at least on a Macbook, in certain modes. On Linux things seem to be a bit better.
Re:Zed, a collaborative code editor, is now open source by natrys on Thursday January 25, 2024 @04:53AM (#39127859)
The thing about gc-cons-threshold is that, too low a value and it will collect garbage too frequently. While a high value will drastically reduce frequency, but then GC pause will be big and you will likely feel whole system freeze and stutter when it happens. For me, 1GB is too high because I sorta notice the pause, I set it to 32MB but completely disable GC when minibuffer is active:

    (defun my-minibuffer-setup-hook ()
      (setq gc-cons-threshold most-positive-fixnum))

    (defun my-minibuffer-exit-hook ()
      (setq gc-cons-threshold (* 32 1024 1024)))

    (add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
    (add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
Eli Zaretskii (current Emacs maintainer) also thinks 1GB is too high, though for somewhat different reason:

https://old.reddit.com/r/emacs/comments/bg85qm/garbage_colle...

Here is an interesting optimisation that was merged in master, but didn't make the cut for 29 in time. I thought it improved snappiness:

https://tdodge.consulting/blog/living-the-emacs-garbage-coll...

---

Anyway, I also have these in my init (I nicked these from Doom which I don't use but they have done a lot of work to dive deep into these things, mostly around what improves start up but the following might help in general):

    ;; if you don't use RTL ever, this could improve perf
    (setq-default bidi-display-reordering 'left-to-right
                  bidi-paragraph-direction 'left-to-right
                  bidi-inhibit-bpa t)

    ;; improves terminal emulator (vterm/eat) throughput
    (setq read-process-output-max (* 2 1024 1024)
          process-adaptive-read-buffering nil)

    (setq fast-but-imprecise-scrolling t
          redisplay-skip-fontification-on-input t
          inhibit-compacting-font-caches t)

    (setq idle-update-delay 1.0)
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @07:16AM (#39128722)
I’m doing different heap sizes during package load, but I don’t have the mini buffer hook and in retrospect, I feel dumb.

If I do inline attribution you mind if I borrow that under MIT?

Re:Zed, a collaborative code editor, is now open source by natrys on Thursday January 25, 2024 @07:48AM (#39129001)
Go ahead. Though I don't think attribution is even necessary for something I myself may have borrowed from somewhere.
Re:Zed, a collaborative code editor, is now open source by sooheon on Thursday January 25, 2024 @07:05AM (#39128642)
Emacs still blocks input on simple things like package updates though.
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @07:08AM (#39128654)
Give straight.el (among others) a shot. Combined with use-package you don’t have to worry about that these days.
Re:Zed, a collaborative code editor, is now open source by sooheon on Thursday January 25, 2024 @07:12AM (#39128690)
Ah ok. Last time I used straight it still blocked input on straight-update-all, didn’t realize they changed this.
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @08:59AM (#39129595)
There's a little tweaking sometimes.

Most examples you'll see of `straight.el`/`use-package` configurations will have some version of: `(use-package something-cool :ensure t :config ...`. The `:ensure t` clause will cause it to fall back on `package-install` in the event it's not bolted into your local Cargo-style-own-the-world-and-dont-break repo mirror. Disks are big, it's like the right default now.

But if you've got a package that's mis-specified in terms of where on `github` or wherever that `striaght` is supposed to find it, you can find it tapping `elpa.org` on the shoulder at a time when the UI thread is also doing blocking network IO.

The `Messages` and/or `straight` buffers will have warnings about this, so it's fixable to find the offending package and it'll stay fixed, but in fairness what you're describing is possible.

Re:Zed, a collaborative code editor, is now open source by bergheim on Thursday January 25, 2024 @09:44AM (#39130062)
Elpaca [1] does not do this. I use it and it works a treat.

1: https://github.com/progfolio/elpaca

Re:Zed, a collaborative code editor, is now open source by ungamedplayer on Thursday January 25, 2024 @08:00AM (#39129112)
> But emacs 29 with the right flags and a tuned GC (no one does this!

Please share how.

Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @08:35AM (#39129392)
Both @darthrupert and @natyrys on the thread have said most of what I know. It's a little machine dependent to get the true sweet spot, but raising it from the like, megabyte (slight hyperbole) or whatever that it defaults to is the 80/20.
Re:Zed, a collaborative code editor, is now open source by dilap on Thursday January 25, 2024 @11:02AM (#39130962)
i got annoyed by emacs gc pauses and just disabled the gc completely (i think). haven't noticed any downsides so far. i'm in emacs all day...

    ;; don't garbage collect based on cons count
    (setq gc-cons-threshold 10000000000)
    (defun garbage-collect (&rest args)
     (message "trying to garbage collect. probably you want to quit emacs."))
something i love about emacs is everything is implemented in the same abstraction (of a "buffer of text"). so i can manipulate and move around an embedded terminal in the same way as a normal file, etc.

playing briefly with Zed it seemed like the terminal was a totally different "thing" than a normal file; i couldn't run the same text selection operations, couldn't split the window vertically or horizontally, etc. to me that loses a ton of the benefit of having a terminal in the editor in the first place.

still, it's a very interesting project. i have a very love/hate relationship with emacs, so i'm always interested in alternatives...

Re:Zed, a collaborative code editor, is now open source by pja on Friday January 26, 2024 @04:23AM (#39140481)
Ripped from my .emacs:

    (setq gc-cons-threshold (\* 100 1024 1024) ;; GC sometime after allocating 100Mb 
          read-process-output-max (\* 1024 1024)
          company-idle-delay 0.0 ;; company completions should be fast
          company-minimum-prefix-length 1
          lsp-idle-delay 0.1)  ;; clangd is fast
    (run-with-idle-timer 2 t (lambda () (garbage-collect))) ;; Trigger a GC after 5s of idle time
This is something of a hack of course, but it works & memory is cheap. You might want to push the GC threshold back down after emacs startup - a GC that fires early is a GC that does less work per invocation & is therefore less likely to cause perceptible stutter.
Re:Zed, a collaborative code editor, is now open source by oblio on Thursday January 25, 2024 @08:10AM (#39129190)
> (no one does this! it’s got a heap-size from the 80s!)

Shouldn't the devs do this? We're in 2024, embedded systems have more RAM, IO, etc than anything from the 80s.

Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @08:30AM (#39129349)
The, uh, GNU folks, are a little conservative in some ways that surprise the mainstream developers. But there are always flags for it. Well, except stupid-ass dynamic-linking of `glibc`.
Re:Zed, a collaborative code editor, is now open source by oblio on Thursday January 25, 2024 @08:34AM (#39129385)
> are a little conservative in some ways that surprise the mainstream developers

Conservative is one thing, but having the default be something that's detrimental to 99.999% of your users in 99.95% of situations feels like bad defaults/design, not being conservative. My worthless 2 eurocents :-)

Re:Zed, a collaborative code editor, is now open source by estebank on Thursday January 25, 2024 @12:43PM (#39132237)
You would think that it would dynamically check the system on first run and set appropriate defaults.
Re:Zed, a collaborative code editor, is now open source by minroot on Thursday January 25, 2024 @08:12AM (#39129201)
I can't still figure out how can I get Emacs not mess up indentation and auto indentation.
Re:Zed, a collaborative code editor, is now open source by benreesman on Thursday January 25, 2024 @08:29AM (#39129339)
Most language modes have a `foo-ts-mode` now that uses `tree-sitter` to get a perfect* AST in the absence of errors, and almost always the most reasonable one in the presence of errors. `tree-sitter` is amazing, a real feat.

It ships with 29 and it's work to find `brew` or `apt` or `nix` or anything giving you less than 29.1 these days.

Have you tried a recent version? 29.1 is dramatically more accurate on everything from syntax highlighting to indention than VSCode (IMHO, they're probably either using or working on using `tree-sitter` too, those are serious people) or JetBrains stuff (they're working on their vscode clone more than IntelliJ these days).

I only use `nvim` for commit messages and stuff the last few years, but AFAIK it has all the `tree-sitter` stuff too.

If it's the sloppy naming of `c-basic-offset-this` vs. `py-indent-that` or whatever (I don't even remember), try a good baseline distro like Doom and tweak from there.

Re:Zed, a collaborative code editor, is now open source by kamaal on Thursday January 25, 2024 @11:20AM (#39131215)
>>But emacs 29 with the right flags and a tuned GC (no one does this! it’s got a heap-size from the 80s!) is just as snappy and has more amazing packages than VSCode.

That explains my whole experience with Emacs. More time is spent in making Emacs awesome than actually doing my work.

Re:Zed, a collaborative code editor, is now open source by angra_mainyu on Thursday January 25, 2024 @12:43PM (#39132240)
> There’s a market for people who want something snappier than VSCode but less labor-intensive to set up than emacs, and I wish them luck

Basically AstroNvim or Doom Emacs. Not a huge fan of Doom Emacs but AstroNvim got me to drop my main editors (Sublime + Atom) and I basically only use AstroNvim.

One enormous advantage of Nvim is that I can run it anywhere. I run it on a Linux machine, a Mac, and a Tablet (w/ Termux) extremely easy (just clone my dotfiles, install nvim, and that's it).

Re:Zed, a collaborative code editor, is now open source by shanusmagnus on Friday January 26, 2024 @06:58PM (#39150612)
> But I can’t imagine switching my main axe up with a holy shit moment a lot crazier than tree-sitter in 2024 and not having the render loop be in JS.

I can't parse this sentence -- could you unpack it? Not being a dick, I really want to know what you mean.

Re:Zed, a collaborative code editor, is now open source by akam4n4n on Wednesday January 24, 2024 @10:08PM (#39125817)
how to you use ollama with vscode? some links/ details would help me a lot!
Re:Zed, a collaborative code editor, is now open source by Octoth0rpe on Wednesday January 24, 2024 @10:59PM (#39126041)
I use this extension: https://continue.dev/ their docs are pretty good, but it's also evolving pretty rapidly. For example, you no longer need to run the continue server yourself, it's entirely self contained in the vs code extension. I believe the docs still refer to how to run it manually.

I work for a pretty conservative company re: GAI, and the ollama + continue combo made it through legal.

Re:Zed, a collaborative code editor, is now open source by appplication on Thursday January 25, 2024 @01:14AM (#39126726)
VSCode has always felt incredibly slow to me, even compared to e.g. pycharm. , which I have always assumed of be otherwise roughly comparable. VSC’s lag in basic code inspection and linting became so annoying I had to switch off it. We’re not talking seconds, but maybe tenths of second lag, for everything at all times. I understand plenty of people love VSC, but honestly I have never been able to share that enthusiasm.
Re:Zed, a collaborative code editor, is now open source by ahmedfromtunis on Thursday January 25, 2024 @02:58AM (#39127285)
Yep. For some reason, suddenly, vscode became painfully slow on my decently spec'd machine; 3 to 7 seconds per keystroke just to analyse the file to show intellisense tooltips.

Yes, that was in seconds per keystroke.

The irony is that I moved from neovim to vscode because setting up intellisense in (neo)vim was always a hassle and never worked quite well. Pylance seemed too attractive not to give it a spin.

Now the lag has as mysteriously diminished, but still vscode is very far from being as snappy as (n)vim.

Re:Zed, a collaborative code editor, is now open source by McBeige on Thursday January 25, 2024 @02:38AM (#39127184)
Ive been wanting a syntax-tree-viewer for months, to help me learn functional languages where figuring out what is even going on syntax-wise in the exmaples provided by tutorials keeps being an issue for me. Does anyone know of a way to see a syntax tree for any given snippet of code for any given language? I'd try Zed, but I'll have to wait for Linux support.
Re:Zed, a collaborative code editor, is now open source by natrys on Thursday January 25, 2024 @06:34AM (#39128445)
I am not sure what debug syntax tree mode does in Zed, but if it's about tree-sitter generated syntax tree, you can see that in Neovim or Emacs (assuming you have major-mode/grammar loaded):

1) In Neovim, do `:TSPlaygroundToggle`

2) In Emacs, do `M-x treesit-explore-mode`

Re:Zed, a collaborative code editor, is now open source by kamaal on Thursday January 25, 2024 @11:17AM (#39131169)
>>I have reasonably fast machines, so we're not talking about the difference between 5ms typing lag and 500ms, but it's still pretty surprising.

I really envy people who can sense passage of time between intervals of 5 milliseconds and 500 milliseconds.

My sensibility begins over a second. And to be honest even that is least of my issues. Same with start up time, I restart the IDE only once in a few days. I thinking spending a second or two extra for it is any where in the ball park of what I would call wasting time.

Re:Zed, a collaborative code editor, is now open source by jasonjmcghee on Friday January 26, 2024 @12:14PM (#39145021)
Re Ollama in Zed

It’s very early, but I’ve been building a “trigger command/script and have it output anywhere” project that you could use as a bandaid solution.

I added Ollama support (you can specify model in settings)

https://github.com/jasonjmcghee/plock

It works wherever you are