# Can play with GHCI but not with Vim

**URL:** <https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455>\
**Category:** TidalCycles\
**Tags:** installation\
**Created:** [19 September 2024 21:13 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455 "2024-09-19T21:13:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom\_gop](https://uzu.lurk.org/user_avatar/uzu.lurk.org/tom_gop/32/2975_2.png) [@tom\_gop](https://uzu.lurk.org/u/tom_gop)\
**Post date:** [19 September 2024 21:13 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455/1 "2024-09-19T21:13:50Z")

</div>

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:

```haskell
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!

 ![Capture d’écran 2024-09-19 à 22.48.55](https://uzu.lurk.org/uploads/default/original/2X/c/c9c75aa22b4ac363daecc8151ba92daad49c41be.png)

Tom

---

<div class="post-metadata">

**Author:** ![tom\_gop](https://uzu.lurk.org/user_avatar/uzu.lurk.org/tom_gop/32/2975_2.png) [@tom\_gop](https://uzu.lurk.org/u/tom_gop)\
**Post date:** [21 September 2024 13:06 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455/2 "2024-09-21T13:06:46Z")

</div>

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! 🙂

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! ^^)

- [Install vim on macOS High Sierra using source code – Arophix](https://arophix.com/2018/01/24/install-vim-on-macos-high-sierra/)
- [vim - Where is my .vimrc file? - Stack Overflow](https://stackoverflow.com/questions/10921441/where-is-my-vimrc-file)
- [https://macvim.org/](https://macvim.org/)

The rest can be found in the Tidal documentation. 🙂

---

<div class="post-metadata">

**Author:** ![yihuang](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yihuang/32/2859_2.png) [@yihuang](https://uzu.lurk.org/u/yihuang)\
**Post date:** [26 September 2024 13:39 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455/3 "2024-09-26T13:39:20Z")

</div>

I use nixpkgs everywhere.

- [install nix](https://nixos.org/download/)
- install neovim, `nix profile install nixpkgs#neovim`
- neovim plugins:

```haskell
Plug 'tidalcycles/vim-tidal'
Plug 'davidgranstrom/scnvim' -- start supercollider from within neovim

```

- Setup ghci with tidal package:

```haskell
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](https://github.com/NixOS/nixpkgs/issues/149937).  
It setup an environment with ghci and tidal package, and start the vim in it.

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [27 September 2024 02:01 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455/4 "2024-09-27T02:01:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom\_gop](https://uzu.lurk.org/user_avatar/uzu.lurk.org/tom_gop/32/2975_2.png) [@tom\_gop](https://uzu.lurk.org/u/tom_gop)\
**Post date:** [27 September 2024 09:21 UTC](https://uzu.lurk.org/t/can-play-with-ghci-but-not-with-vim/5455/5 "2024-09-27T09:21:16Z")

</div>

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.
