VIM Commenting - Speed up


Hi all,

Are you facing problems with commenting in code using VIM?
Here's a nice little trick which proved to be very helpful in my coding experience with VIM editor.

Lets say you want '#' character repeated 100 times to make your code look more neat.

Then all you have to do is

In the insert mode type <C-o>100i#<Esc>.

C-o means you have to type CTRL + O.
# is the character you want to repeat.
ESC - to get your output.

And you will have # repeated 100 times.

This can be done for any character

# - needed in bash scripting, python
% - Matlab commenting
// - C coding.

Source : - http://stackoverflow.com/questions/5054128/repeating-characters-in-vim-insert-mode 

Comments

Popular posts from this blog

SOX - Sound eXchange - How to use SOX for audio processing tasks in research.

Sox of Silence - Original post - http://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/

How to get video or audio duration of a file using ffmpeg?