I’ve just started using Vim (yes, it’s heresy…), and I’m absolutely
loving it – but there are of course still things I haven’t picked up
yet.
One of those things is insert-mode mappings, as described at RubyGarden
[1]. In the section “Customising” there’s a guide on how to add such,
namely this:
imap end-cc
which should be inserted into ftplugin/ruby_structure.vim.
ruby_structure.vim didn’t already exist, so I created it.
Should it already have existed?
Nothing happens after I’ve added the snippet above to
ruby_structure.vim. Do I need to do more?
Note: I’m having the same problem with vim70, I added ruby_structure.vim
but it won’t add the “end” also the in my system its adds tabstops I was
expecting two spaces for indenting?
It doesn’t work – it only indents the next line (which it has done all
along). I want it to add the `end’ keyword after that line.
If you are running console-mode Vim (within an Xterm, say, or at the
text-mode Linux VT), then Vim is probably not seeing the shift modifier
applied to the CR. Try gvim (graphical Vim) and see if it works there if
this is the case; it really should. Unfortunately, I don’t know if it’s
possible to get console-mode Vim to see the shift if that’s the problem.
It doesn’t work – it only indents the next line (which it has done all
along). I want it to add the `end’ keyword after that line.
If you are running console-mode Vim (within an Xterm, say, or at the
text-mode Linux VT), then Vim is probably not seeing the shift modifier
applied to the CR. Try gvim (graphical Vim) and see if it works there if
this is the case; it really should. Unfortunately, I don’t know if it’s
possible to get console-mode Vim to see the shift if that’s the problem.
Yes, that seems to be the problem.
Does anyone have a solution to this?
Daniel
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.