aboutsummaryrefslogtreecommitdiffstats
path: root/ftplugin/ruby.vim
diff options
context:
space:
mode:
authorTeddy Wing2017-12-05 21:16:14 +0100
committerTeddy Wing2017-12-05 21:16:14 +0100
commit73fa46a7796d5f53326c0d38f617b6cb839c2d34 (patch)
tree0b22976d030b4ef9b8530f99df9f226bba152190 /ftplugin/ruby.vim
parent0f134e5812a937b7d93fe580774a4ab8d37ab2ff (diff)
downloaddotvim-73fa46a7796d5f53326c0d38f617b6cb839c2d34.tar.bz2
ftplugin/ruby.vim: Add `RubyNewHashSyntax` command
I've had to use a similar pattern a couple of times in the past to convert files or sections of files from the old Ruby hash syntax (`:key => 'value'`) to the new syntax (`key: 'value'`). Give the pattern and substitution a command to make it readily available the next time I need to use it.
Diffstat (limited to 'ftplugin/ruby.vim')
-rw-r--r--ftplugin/ruby.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim
index fe7315d..2abb417 100644
--- a/ftplugin/ruby.vim
+++ b/ftplugin/ruby.vim
@@ -20,3 +20,9 @@ nnoremap <buffer> ZD Obyebug<Esc>
" Spring
command! -buffer FuckSpring :!bundle exec spring stop
+
+
+" Convert from old to new hash syntax
+" Example: :%RubyNewHashSyntax gc
+command! -buffer -range -nargs=? RubyNewHashSyntax
+ \ <line1>,<line2>substitute/\v:<(\w+)> \=\>/\1:/<args>