Ⅰ. 插件描述
Sonic Pi plugin for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'dermusikman/sonicpi-vim-safe-and-sound'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'dermusikman/sonicpi-vim-safe-and-sound'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'dermusikman/sonicpi-vim-safe-and-sound'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/dermusikman/sonicpi.vim
Ⅳ. 文档说明
# sonicpi.vim
The sonicpi vim plugin requires the following:
- An installation of Sonic Pi 2.4+.
- A tool to interface with Sonic Pi. The default is sonic-pi-cli.
Features
The plugin enables itself when Sonic Pi is running and the Ruby filetype is initiated (let g:sonicpi_enabled = 0 to disable), and provides the following features:
<leader>r- send buffer to sonicpi<leader>S- send stop message to sonicpi- Contextual autocompletion of Sonic Pi terms with omnicomplete (
<C-x><C-o>by default). That is, if you havesynth :zawa,in the line, omnicomplete will provide parameter names for:zawa, et al! - Extension of Ruby syntax to include Sonic Pi terms
Installation
Prerequisites: Sonic Pi 2.4+, and sonic-pi-cli or similar.
If you use pathogen (and you should), simply clone this repo into ~/.vim/bundle/ like so:
git clone https://github.com/dermusikman/sonicpi.vim.git
Whenever Sonic Pi is running, and you haven't disabled the g:sonicpi_enabled flag in your configs, the plugin will activate. Otherwise, it's a normal Ruby session!
Configuration
g:sonicpi_keymaps_enabled can be used to disable the default keybindings.
g:sonicpi_command can be used to configure what tool is used to send the
code to Sonic Pi. The default is sonic_pi.
g:sonicpi_send and g:sonicpi_stop can be used to adjust the arguments sent
to g:sonicpi_command. The default values are g:sonicpi_send = '' andg:sonicpi_stop = 'stop'.
g:vim_redraw, if true (such as by setting it to 1), will redraw the screen
after the stop command instead of waiting for output. Its default value is0.
As an example, to usesonic-pi-tool, the following.vimrc settings would work:
let g:sonicpi_command = 'sonic-pi-tool'
let g:sonicpi_send = 'eval-stdin'
let g:sonicpi_stop = 'stop'
let g:vim_redraw = 1Sonic Pi interfacing tools
- sonic-pi-cli. The default.
- sonic-pi-tool. Written in Rust, and more responsive than sonic-pi-cli.
- sonic-pi-pipe. An
- version of
sonic-pi-toolwith less functionality written in Go.
TODO
Fix autocompleteMake contextual autocomplete (e.g., a list of samples followssamples)Add movement for Sonic Pi style files, ala ruby.vim's modifications(Now we stay in the Ruby filetype)Extend Ruby syntax to incorporate Sonic Pi directivesUpdate for Sonic Pi 2.4- Add named notes (e.g.,
:c4,:e2) and chords (e.g.,sus4,m7+5) - Add oddball contexts beyond the sounds. For instance, we've added the "spread" context to include
rotate: