this post was submitted on 17 Nov 2023
2 points (100.0% liked)

Nix

10 readers
1 users here now

founded 1 year ago
MODERATORS
 

I'll start by saying I'm super new to vim, so I'm messing around with make a configuration from scratch. As such, I'd like to use nix as my plugin manager; However, I'm seemingly failing to install nvim-tree, and I was hoping someone could point out what I'm missing.

programs.neovim = {
    enable = true;
    defaultEditor = true;
    viAlias = true;
    vimAlias = true;
    vimdiffAlias = true;

    plugins = with pkgs.vimPlugins; [
        # nerdtree
        nvim-tree-lua
        vim-sleuth
        catppuccin-nvim
    ];

    extraConfig = lib.fileContents ./init.vim;
};

This works for installing the other plugins. But I can't seem to access nvim-tree. According to the website (https://github.com/nvim-tree/nvim-tree.lua), I should be able enter :NvimTreeOpen in neovim, but I get "Not an editor command: NvimTreeOpen." Any ideas?

Thanks.

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 11 months ago

I just ran into this too and you have to add an extra config that initializes the plugin like in the nix neovim docs.

I ended up switching to helix out of spite.

[–] [email protected] 1 points 11 months ago

Somewhere you need to call require("nvim-tree").setup() to initialize it.

[–] toyvo 0 points 11 months ago* (last edited 11 months ago)

If you haven’t seen it yet you might want to try out https://github.com/nix-community/nixvim

It’s some modules to configure neovim and many popular plugins are pre configured