fedemengo / nvim

Neovim configuration in Fennel
MIT License
2 stars 0 forks source link

Fix bootstrap #2

Closed fedemengo closed 1 week ago

fedemengo commented 1 year ago

It's kinda ok, but it always needs a couple of :PackerInstall on a brand new setup

fedemengo commented 1 year ago

worse than that, on a ubuntu docker image, trying to setup everything from scratch I get

Error detected while processing /root/.local/share/nvim/site/pack/packer/start/aniseed/plugin/aniseed.vim:
line    3:
E5108: Error executing lua [string ":lua"]:1: /root/.local/share/nvim/site/pack/packer/start/aniseed/plugin/aniseed.vim, line 3: Vim(echoerr):E121: Undefined variable: vim

stack traceback:
        [C]: in function 'init'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

which is really weird

fedemengo commented 1 year ago

turns out there are a couple of problems

  1. https://github.com/fedemengo/nvim/blob/8d34ef3bfc8087984157906ef90ae47837e354c2/fnl/core.fnl#L161 this doesn't seem to be working out of the box
  2. https://github.com/fedemengo/nvim/blob/8d34ef3bfc8087984157906ef90ae47837e354c2/fnl/init.fnl#L6 should be loaded before all heavy modules (before core and mapping in this case) and yet termguicolors must be set before plugins
  3. the setup used in every plugins is called before packer downloads/load the plugin, so that fails and make packer fail loading all plugins
    • for the first run of plugins disable setup altogether with a if false
      
      (fn setup [...]
      (when false          ;; <----- right here
      (let [in [...]]
      (let [name (. in 1)
          plugin (safe-require name)]
      (when plugin
        (if (= 2 (length in))
          (let [arg (. in 2)]
            (plugin.setup arg))
          (plugin.setup)))))))

this was solved in 9834d07690362c896565782d134b56215599c131

4. for some reason `zbirenbaum/copilot.lua` is installed at `~/.local/share/nvim/site/pack/packer/opt/` nothing that a raw `mv ~/.local/share/nvim/site/pack/packer/opt/copilot.lua ~/.local/share/nvim/site/pack/packer/start` can't solve
fedemengo commented 1 week ago

looks fine now, tested