From My Notepad
Jump to: navigation, search

This page contains information for vi/vim/gvim.

You can download Vim from here.


Vim Tutorial - Hosted at

How to use VI

Vim 8 Changes

The biggest change for me was the enabling by default of xterm-bracketed-paste. This prevents you from being able to right-click paste into a PuTTY session. Just add the line below to your ~/.vimrc to set it back to normal.

set t_BE=

Favorite colors for Vi(m)

In Windows, the _vimrc file is located in "C:\Program Files\Vim". Add the following lines to set default color scheme and font:

mkdir ~/.vim
git clone ~/.vim

set background=dark
colorscheme hybrid_material

set guifont=Courier_New:h10:cANSI

Favorite color schemes

colorscheme hybrid_material
colorscheme molokai
colorscheme monokai

Search and Replace, Insert new line

Source: Vim: Search and Replace, Insert new line

:%s/^text on line$/text on line\rtext on next line\rtext on line after that/g

The \r is the new line character.

NOTE: \r is used as the new line character when vim is using DOS file format, to find out which file format you are using type :set ff?

Disable xterm-style mouse usage

1. issue the command :set mouse-=a
2. insert the directive set mouse-=a into your ~/.vimrc file

Highlight duplicate lines

:syn clear Repeat | g/^\(.*\)\n\ze\%(.*\n\)*\1$/exe 'syn match Repeat "^' . escape(getline('.'), '".\^$*[]') . '$"' | nohlsearch

Set syntax highlighting language

:set syntax=html
:set syntax=asterisk