Posts Tagged "vim"

Removing ^M character GVIM windows

‘^M’ is end of line character in Linux, when you edit files created in Linux in other environments you might see the ‘^M’ character.
To remove ^M character in GVIM windows you should do:

:%s/^M//g

‘^M’ is CONTROL-V. Once you enter it will search your document and it removes all instances of ^M character from the file.

Read More

VI tips

Here are some beginners tips to VI editor:

To change the color scheme in vi just do:

colorscheme torte

which changes your color shema to torte. To see the available color schemes you could use key.

To change the font in vi editor you would have to do:

set guifont=Lucida\ Console:h10

Please note that ‘\’ is being used before every space character in the font name.
setting the line numbers:

set number

To highlight the search result in the current doument:

set hlsearch

To have this change made every time you start vi you would need to add it anywhere in vimrc file. In Linux its under /etc/vim/ and in windows its inside the installation folder in “program files”

Read More