tags:

views:

258

answers:

2

What do I type in i, n, and v mode to do say the following hotkey?

\sd \sf

Also I am using this plugin in cygwin?

This is the plugin and the hotkeys Warning PDF that I am trying to use.

+1  A: 

For \sd to get a do {} while with the cursor between the braces:

:imap \sd do {} while<ESC>hhhhhhi
:nmap \sd ado {} while<ESC>hhhhhhi
:vmap \sd ado {} while<ESC>hhhhhhi

With this, I guess you should be able to fill in the rest as well.

jqno
What do I actually type on the key board to initiate this hotkey. For example I learned the ^C is ctrl+shift+C what is \sd? Alt Meta? If I type in \sd in normal more on s it substitutes character under cursor with d.
kthakore
There is no single hotkey, it's a sequence of keys. In this case, you actually type backslash, s, d. When you add the mapping, it will overrule any mapping that came before.
jqno
but I installed http://www.vim.org/scripts/script.php?script_id=556 but these hotkeys still don't work
kthakore
Go to normal mode and type in the commands I gave, see if they work. If they do, you probably didn't install your plugin correctly. If they don't, maybe you didn't type the keys fast enough, or some other strange thing is going on ...
jqno
This plugin works fine in gvim the menus shows up properly and I can click on menu items which have the \sd hot key. Why can't I do this in the terminal one? \lps says it will load the menus.
kthakore
Well, menus aren't available in the terminal. Only in GUI-based vims, like gvim. In the terminal, I'm afraid you'll just have to type the key sequences.(In fact if you look inside `perl-support.vim` you'll see the definition of `lps` is inside a big `if has("gui_running")` block.)
jqno
A: 

I fixed this by adding

filetype plugin on

in ~/.vimrc

kthakore