tidalcycles / vim-tidal

Vim plugin for TidalCycles
MIT License
223 stars 56 forks source link

Support neovim's terminal. #26

Closed purpleposeidon closed 4 years ago

purpleposeidon commented 5 years ago

No need to use the special launch script; you can just run the line from a *.tidal file and it'll start tidal in a terminal buffer.

Quick overview of the terminal buffer:

  1. The terminal defaults to insert mode.
  2. Enter terminal insert mode using eg 'i'.
  3. Exit terminal insert mode with <C->.
  4. You'll probably want to apply the mappings mentioned in :help terminal
munshkr commented 5 years ago

Cool! Didn't know about this feature. I'd be great if we can enable this mode only when running neovim, so we can keep it compatible with Vim (I assume this is a neovim-feature only).

purpleposeidon commented 5 years ago

It does not change the behavior of vanilla vim appreciably. Vanillavim can do terminals now, but its API is different. It'd probably be super easy to support tho.

munshkr commented 5 years ago

Oh! I thought this was an issue, not a PR, awesome! I will test and merge later today.

flupe commented 5 years ago

Perhaps it would also be beneficial to investigate the Vim8 terminal feature (See :help terminal). I already tried using it in my own fork of this plugin (https://github.com/flupe/vim-tidal), it works quite well and gets rid of all the cumbersome tmux code and bash scripts altogether. However maybe you are not willing to ditch the tmux part of this plugin, as it is possible some users do prefer to use tmux for this kind of things – I know I don't.

munshkr commented 4 years ago

Thank for adding this feature and sorry it took so long. I've merged the commit on this PR, but left tmux as a default for nvim, so as not to break compatibility with any neovim user of this plugin right now. For that I had to rebase against master and merge manually, so I'll just close this PR.

I'll look into @flupe's fork, maybe we can merge it too and then make it both implementations of the terminal as the default target, and tmux as an optional one, for those users that want to use it (tmux can still be useful for certain screen configurations, and for older versions of Vim I guess).

Thanks again!!