aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/ruby/ruby.vim
diff options
context:
space:
mode:
Diffstat (limited to 'stow/vim/.vim/ftplugin/ruby/ruby.vim')
-rw-r--r--stow/vim/.vim/ftplugin/ruby/ruby.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/stow/vim/.vim/ftplugin/ruby/ruby.vim b/stow/vim/.vim/ftplugin/ruby/ruby.vim
new file mode 100644
index 0000000..41b806a
--- /dev/null
+++ b/stow/vim/.vim/ftplugin/ruby/ruby.vim
@@ -0,0 +1,27 @@
+" ~/.vim/ftplugin/ruby/ruby.vim
+" Ruby-specific vim configuration
+
+" Tabs are expanded to 4 spaces
+setlocal tabstop=2 shiftwidth=2 expandtab
+" Show existing tabs (they can be deleted with :retab)
+setlocal list
+
+" Mappings
+"
+" For SonicPi
+
+if expand('%:p') =~ 'sonicPi'
+
+ let mapleader = " "
+
+ nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/ruby/ruby.vim<CR>
+
+ nnoremap <buffer> <leader>p :w<CR>:!sonic-pi-tool eval-file %<CR><CR>
+ nnoremap <buffer> <leader><leader> :w<CR>:!sonic-pi-tool stop && sonic-pi-tool eval-file %<CR><CR>
+ nnoremap <buffer> <leader>s :!sonic-pi-tool stop<CR><CR>
+
+ let mapleader = ","
+
+ inoremap <buffer> <leader>loop loop do <CR><+++><CR>end<CR><++><Esc>?<+++><CR>cf>
+
+endif