Can play with GHCI but not with Vim

Hi !

I spent an entire week searching for how to install Vim on macOS High Sierra... I've had a small victory because, after following every forum I could find, I managed to install it with Plug, Brew, Cabal ................ (i don't know really ^^) and other dependencies recommended for Tidal and Vim.

Here's the situation: after closing Pulsar and rebooting SuperCollider, when I go into the Terminal of MacVim and type "ghci," I get the following output:

bash-3.2$ ghci
GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
Loaded package environment from /Users/tommyheisler/.ghc/x86_64-darwin-8.10.7/environments/default
[TidalCycles version 1.9.5]
Installed in /Users/tommyheisler/.cabal/store/ghc-8.10.7/tdl-1.9.5-a5ae8fc9/share
Listening for external controls on 127.0.0.1:6010
Connected to SuperDirt.
Loaded GHCi configuration from /Users/tommyheisler/.ghci

I can play a pattern from bash, but I can't play it in the Vim or MacVim interface... How can this be possible?

Thank you so much in advance!! I know a bit about hacking, but this is a big level for me ^^ but I'm learning!

Tom

Hi everyone!

So, I've been searching like crazy for three days, but I finally found it! I spent more time debugging than playing music. ^^

I managed to do it, but the problem was that everything had to be done manually under macOS High Sierra. Nothing worked with multiple ./vimrc files and certain plugin folders. I even had to recreate a ./vimrc file myself!

After spending evenings until 4 AM fixing my installation and configuration, with a bit of luck and a lot of research, everything is working now, and on top of that, I managed to change the color theme! :slight_smile:

After several tweaks and poorly used keyboard shortcuts, I ran into a sound problem that was impossible to debug. Tmux was the source of the issue due to my bad shortcuts. To fix it, I had to delete the two Tmux instances in the Activity Monitor.

Here are some links for anyone who has the same problem installing MacVim or Vim on macOS High Sierra. (A lot of help, because I don't know a thing about terminal stuff! ^^)

The rest can be found in the Tidal documentation. :slight_smile:

I use nixpkgs everywhere.

  • install nix
  • install neovim, nix profile install nixpkgs#neovim
  • neovim plugins:
    Plug 'tidalcycles/vim-tidal'
    Plug 'davidgranstrom/scnvim'  -- start supercollider from within neovim
    
  • Setup ghci with tidal package:
    nix-shell -p "ghc.withPackages (a: [a.tidal])" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/release-23.05.tar.gz --run nvim
    
    It's a little bit long because I pin it to a relatively old version of GHC, the latest version has an issue.
    It setup an environment with ghci and tidal package, and start the vim in it.
1 Like

So there's a bit of a trick to the vim-plugin - it essentially has two possible modes of operation.

One is inside tmux which will handle the panes and set stuff up (usually started from a custom program, vim-tidal or similar), the other is to use native pane management inside eg neovim.

When using neovim and it's native pane handling, there is no need for tmux, you can just edit a *.tidal prefix file, press your eval key combo and it will fire up ghci in a native neovim pane.

Now, I believe this may also be possible in newer vim versions too - you could try starting it without tmux as per above and see what happens!

In any case, it's a lot cleaner setup because you don't need to worry about managing multiple tools to make it go

1 Like

Okay, I need to check this, thanks!
I was a bit lost with hiding files and so on... Everything is working now, except coc-tidal, which uses NVM 18 (for OSX 10.15... but I only have OSX 10.13 ^^).
Coc-tidal can help me with my learning progress, so I'm waiting and writing code in Pulsar again.