I have been using the Sublime editor and is making a switch to vim (Because I have to) . I have heard that Vim is the best editor there is, if you can master all the shortcuts. Given below are some of my needs. Please tell me which shortcut/plug-in I should use to achieve them.
case n:10+
?}
. Same need with parenthesis.>
like symbol to the left of line number. Is this possible in Vim?Any help is appreciated.
Switch-case statement in C : I need like 10 cases. So How can I add them quickly? Is there something like case n:10+ ?
ocase :<CR>break;<Esc>
9.
See :help repeating
.
Curly Bracket completion : I need an auto closing curly bracket }. Same need with parenthesis.
That "feature" is not that useful but if you didn't already grow tired of it, you can find a good list on the Vim wiki..
In CSS : Code completion for properties.
It's built-in. Try <C-x><C-o>
after a couple of characters. If you don't like the default <C-x><C-o>
, create your own with:
inoremap <key> <C-x><C-o>
See :help key-mapping
and :help key-notation
.
Code shrink option : In Sublime u could shrink the code present in a block (like a function or loop) by pressing an > like symbol to the left of line number. Is this possible in Vim?
That feature is universally called "folding". You can close a fold with zc
, open it with zo
, toggle it with za
and much more. See :help folding
.
Any other shortcut / plug-in that programmer ( C, C++, php, CSS, HTML ) can use to increase his/her productivity.
Learn Vim before looking for plugins.