davidgranstrom / scnvim

Neovim frontend for SuperCollider.
GNU General Public License v3.0
208 stars 28 forks source link

Installer function don't work for me #164

Closed molleweide closed 2 months ago

molleweide commented 2 years ago

meta info

os - macos big sur nvim - stable install with brew instl neovim

message when calling :call scnvim#install()

Error detected while processing function scnvim#install:
line    1:
E5108: Error executing lua ...vim/site/pack/packer/start/scnvim/lua/scnvim/install.lua:68: ENOENT: no such file or directory: /Users/hjalmarjakobsson/
.local/share/nvim/site/pack/packer/start/scnvim/scide_scnvim -> /Users/hjalmarjakobsson/.local/share/SuperCollider/Extensions/scide_scnvim
stack traceback:
        [C]: in function 'assert'
        ...vim/site/pack/packer/start/scnvim/lua/scnvim/install.lua:68: in function 'link'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

healthcheck scnvim

scnvim: health#scnvim#check
========================================================================
## scnvim
  - ERROR: SCNvim SuperCollider classes are not installed
    - ADVICE:
      - :call scnvim#install()
  - OK: has("timers") - success
  - INFO: sclang executable: /Applications/SuperCollider.app/Contents/MacOS/sclang
  - INFO: using g:scnvim_scdoc_render_prg = /usr/local/bin/pandoc
  - INFO: using g:scnvim_scdoc_render_args = % --from html --to plain -o %
davidgranstrom commented 2 years ago

@molleweide Thanks for the report. Could you post the output of the following commands?

In a shell:

echo $XDG_DATA_HOME

In SuperCollider (either the IDE or using scnvim)

Platform.userExtensionDir
molleweide commented 2 years ago
╰ echo $XDG_DATA_HOME
/Users/hjalmarjakobsson/.local/share
molleweide commented 2 years ago

-> /Users/hjalmarjakobsson/Library/Application Support/SuperCollider/Extensions

davidgranstrom commented 2 years ago

Thanks for your quick response! There is a mismatch between the path reported by SuperCollider and the path derived by scnvim. AFAIK SuperCollider should respect XDG_* paths for the user Extension directory, at least that was the case last time I tried this.

Did you set XDG_DATA_HOME in your shell startup config or was it already defined by the OS?

I would also be interested in the output of Platform.userAppSupportDir to see if its the same path as the Extensions dir.


Until this is solved, you can fix the issue manually by creating a symbolic link between scide_scnvim and your SuperCollider Extensions directory. It should look something like this (paths based on the output you have posted):

ln -s /Users/hjalmarjakobsson/.local/share/nvim/site/pack/packer/start/scnvim/scide_scnvim /Users/hjalmarjakobsson/Library/Application\ Support/SuperCollider/Extensions/scide_scnvim
molleweide commented 2 years ago

I set XDG paths myself.

I would also be interested in the output of Platform.userAppSupportDir to see if its the same path as the Extensions dir.

-> /Users/hjalmarjakobsson/Library/Application Support/SuperCollider

molleweide commented 2 years ago

i have to look into supercollider and XDG myself also!

davidgranstrom commented 2 years ago

If I launch nvim with XDG_DATA_HOME=~/.local/share nvim test.scd or sclang with the same envir variable set I get the expected paths. Maybe there is a problem with the wayXDG_DATA_HOME is exported in your shell configuration? You can also try and start the IDE from the command line and see if you get the expected paths from the commands mentioned above.

molleweide commented 2 years ago
  1. i will try the command and report back.
  2. are you setting any supercollider env vars?
  3. FYI -> I am setting my environment vars with https://github.com/bevry/dorothy
  4. some of the vars are set in dorothy (above) and some are set in my personal dotfiles user dir with https://github.com/molleweide/dotfiles/blob/molleweide/config/environment.bash

just in case you are interested or want to check out yourself...

It was also a long time since I personally was using SC. Now I just want everything to run correctly in case I get time to play around with it more so that I can integrate it into my workflow.

molleweide commented 2 years ago

David can you please give me the command for how I start SC from the command line? And do you know what I can search for in order to set environment vars for supercollider? I am asking because searching for sc environment variables only brings me to sort of in IDE usage help. And you have somekind of superollider config under your dotfiles?

molleweide commented 2 years ago

SIDE NOTE my goal later would be to try to integrate scnvim with gwatcha/reaper-keys which is a lua-vim framework that implements a vim-bindings internally inside of reaper. I dunno if you use reaper but I have seen Maads plugin for nvim which I haven't used myself. In my own fork of reaper-keys I have implemented a feature for creating sends and routes which pretty much allows one to never ever touch the mouse inside of the GUI which is pretty cool that one can do that. But I also want to try Maads plugin and see how it feels.

davidgranstrom commented 2 years ago

David can you please give me the command for how I start SC from the command line? And do you know what I can search for in order to set environment vars for supercollider? I am asking because searching for sc environment variables only brings me to sort of in IDE usage help. And you have somekind of superollider config under your dotfiles?

The executable is inside /Applications/SuperCollider.app/Contents/MacOS (note that the path might differ depending on where you have installed SuperCollider). To launch the IDE: ./Applications/SuperCollider.app/Contents/MacOS/SuperCollider

To access env variables inherited from the shell call "MY_VAR".getenv. It would be interesting to see what "XDG_DATA_HOME".getenv returns.