tidalcycles / vim-tidal

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

Adding macros that call TidalParagraphSend at a mark #40

Open rseymour opened 4 years ago

rseymour commented 4 years ago

I added a few shortcuts to my ftplugin/tidal.vim that move to a mark then send it. It's useful for marking certain lines or do blocks and then moving to them quickly in a live scenario (specifically when I'm singing).

This is what I have:

  nmap <buffer> <F1> 'a<Plug>TidalParagraphSend
  nmap <buffer> <F2> 'b<Plug>TidalParagraphSend
  nmap <buffer> <F3> 'c<Plug>TidalParagraphSend
  nmap <buffer> <F4> 'd<Plug>TidalParagraphSend
  nmap <buffer> <F5> 'e<Plug>TidalParagraphSend
  nmap <buffer> <F6> 'f<Plug>TidalParagraphSend
  nmap <buffer> <F7> 'g<Plug>TidalParagraphSend
  nmap <buffer> <F8> 'h<Plug>TidalParagraphSend

I could do a PR but it's the sort of customization that (a) favors folks with real function keys and (b) is sort of specialized and could stomp on other mappings folks might have.

Ideally this would live in my .vimrc, but adding them makes the function keys work, but ctrl-e stops working. Even with noremap, I assume this is something fixable, but I don't know enough vimscript to be sure.

At any rate thanks for your work, I try use tidalvim daily.

munshkr commented 4 years ago

Nice one!

The plugin has some bindings for playing a paragraph that starts with d1 using localleader s 1 and so on, for each of the default streams, but this seems very useful too, especially like you say, for code blocks that do not resemble the "typical" use of streams in TidalCycles. Perhaps we can add them using a local leader instead of using the function keys, it would be less invasive as a local leader is only local the a Tidal buffer. In the end, the user can always disable all of these bindings with a flag.

Otherwise we can add these as a suggestion in the README.