• 0 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: June 27th, 2023

help-circle











  • As other comments point out, they are usually not properly packaged through nix.

    If you read the vim/plugins modules, for most plugins, the derivation just downloads the plugin, puts it to nix-store, and makes it available to the editor through environment variables. So it’s similar to the binary distributed software. Two most notable restrictions:

    1. Nix is not aware of transient dependencies.
    2. The plugin is not aware of the nix-store model.

    So for plugins that don’t have external dependencies (or dependencies other than the “common” ones like python or sh that happen to be available), and that don’t interact with the filesystems, this approach would be fine, but the more complex ones would fail.

    In your example, mason failed because of 1, home-manager wasn’t aware that the pip module is a transient dependency of this plugin; and treesitter failed because of 2, because it doesn’t know that nix-store is read-only and should be managed by nix.

    There are no general solutions, but people may have nixified some plugins on a case-by-case basis. If you don’t want to spend a lot of time (and remember that it might be broken by the next plugin upgrade), as others have suggested, take the traditional plugin management approach. (Personally, I use LunarVim which uses Lazy.nvim and it’s been working fine.)







  • It’s a “terminal multiplexer”, i.e. you can start multiple terminals in a single terminal.

    You might ask, why not open a new terminal window or tab? Well, you can only do that in a desktop environment and that’s not always available. Even if you can, you might want the terminals to be side by side in a single screen, which might not be easy to do with window tiling.

    The real power of tmux, though, is that it manages the session you created. To quote from the manual:

    tmux may be detached from a screen and continue running in the background, then later reattached.

    So, one use case would be saving your current terminal setup. Instead of exiting the terminal and navigating to the project and setting up the environment again next time, you can simply detach and re-attach.

    When connecting to a remote server, this is especially useful:

    Each session is persistent and will survive accidental disconnection (such as ssh(1) connection timeout) or intentional detaching

    Suppose you want to execute a long running command on a remote server. If you just put it to foreground, when you exit the ssh session, the job is also killed. If you put it to the background, its output can’t be easily observed.

    With tmux, you can simply run it in the foreground like normal and detach. When you reattach later, the job is running and you get all the output easily, as if you have been in that session all along.