Vim Macros
Here are some interesting Vim macros you can put on your ~/.vimrc :
To make get an insensitive and “smart” search:
set ignorecase
set smartcase
C file template will be generated when you press F7 button:
map <F7> i#include <stdio.h><CR>int main(int argc, char *argv[])<CR>{<CR><CR>return 0;<CR>}<ESC>
Perl heder, when you press F8:
map <F8> i#!/usr/bin/perl -w<CR><Left><Del>use strict;<CR>use warnings;<CR>use POSIX<ESC;>
Python header, press F9:
map <F9> i#!/usr/bin/python<ESC>o## -*- coding: iso-8859-1 -*-<CR><ESC>
To activate folding:
set foldmethod=on
To fold on a file, limit your text by
{{{ Some Title
And
}}}
To open a folded text, press “space” at the beginning of folding , to unexpand all folds, type
Escape - z - m
