" Set options and add mapping such that Vim behaves a lot like MS-Windows " " Maintainer: Bram Moolenaar " Last change: 2001 Aug 23 " set the 'cpoptions' to its Vim default if 1 " only do this when compiled with expression evaluation let s:save_cpo = &cpoptions endif set cpo&vim " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows behave mswin " backspace and cursor keys wrap to previous/next line set backspace=2 whichwrap+=<,>,[,] " backspace in Visual mode deletes selection vnoremap d " CTRL-X and SHIFT-Del are Cut vnoremap "+x vnoremap "+x " CTRL-C and CTRL-Insert are Copy vnoremap "+y vnoremap "+y " CTRL-V and SHIFT-Insert are Paste nnoremap Paste "=@+.'xy'gPFx"_2x map Paste map Paste imap xPaste"_s imap xPaste"_s cmap + cmap + vmap "-cxPaste"_x vmap "-cxPaste"_x " Use CTRL-Q to do what CTRL-V used to do noremap " For CTRL-V to work autoselect must be off. " On Unix we have two selections, autoselect can be used. if !has("unix") set guioptions-=a endif " CTRL-Z is Undo; not in cmdline though noremap u inoremap u " CTRL-Y is Redo (although not repeat); not in cmdline though noremap inoremap " Alt-Space is System menu if has("gui") noremap :simalt ~ inoremap :simalt ~ cnoremap :simalt ~ endif " CTRL-A is Select all noremap gggHG inoremap gggHG cnoremap gggHG " CTRL-Tab is Next window noremap w inoremap w cnoremap w " CTRL-F4 is Close window noremap c inoremap c cnoremap c " restore 'cpoptions' set cpo& if 1 let &cpoptions = s:save_cpo unlet s:save_cpo endif