Using the following steps one can setup vim/gvim to run on windows. 1) Add the following new variable VIM on your system. Example: VIM=C:\apps\vim\vim73 (Where C:\apps\vim\vim73 is where vim/gvim is installed) 2) Copy the file %VIM%\vimrc_example.vim as _vimrc in %VIM% folder 3) Add the following 2 lines at the end in %VIM%\_vimrc so it sets up vim for windows source $VIM/mswin.vim behave mswin Advertisements Continue reading How to set vim/gvim on windows?
Move by one character h – Move cursor left j – Move cursor down k – Move cursor up l – Move cursor right Move by word w or W – Move forward by word, cursor is beginning of the word b or B – Move backward by word, cursor is beginning of the word e or E – Move forward by word, cursor is … Continue reading Movement commands in vi
h – Left l – Right k – Up j – Down w – Move forward to beginning of next word e – Move end of the word b – Move backward to beginning of the previous word 0 – First position on the line $ – Last position on the line ^ – First non-blank position on the line + or <Return> – First … Continue reading Commands to change cursor position in vi
There are few commands one can use to save a file n To save and quit: <esc>:wq To save (if modified) and then quit, if not modified then does not save quit: <esc>:x (by firstname.lastname@example.org) To save (if modified) and then quit, if not modified then does not save quit: <esc>ZZ (by email@example.com) To save and continue edititing: <esc>:w To quit: <esc>:q (Note: You will … Continue reading Useful commands in vi to save/quit
Useful commands in vi: To delete lines One at a time: <esc>dd n lines at a time: <esc>ndd – where n is the number of lines to be deleted, eg: 3dd would delete 3 lines To delete all blank lines (lines that don’t have spaces in between): <esc>:g/^$/d To delete all blank lines that have spaces in them: <esc>:g/^ *$/d To delete from current cursor … Continue reading Useful commands in vi to delete