From 071d4279d6ab81b7187b48f3a0fc61e587b6db6c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 13 Jun 2004 20:20:40 +0000 Subject: updated for version 7.0001 --- runtime/mswin.vim | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 runtime/mswin.vim (limited to 'runtime/mswin.vim') diff --git a/runtime/mswin.vim b/runtime/mswin.vim new file mode 100644 index 000000000..4072af1c6 --- /dev/null +++ b/runtime/mswin.vim @@ -0,0 +1,115 @@ +" Set options and add mapping such that Vim behaves a lot like MS-Windows +" +" Maintainer: Bram Moolenaar +" Last change: 2004 May 26 + +" 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=indent,eol,start 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 +map "+gP +map "+gP + +cmap + +cmap + + +" Pasting blockwise and linewise selections is not possible in Insert and +" Visual mode without the +virtualedit feature. They are pasted as if they +" were characterwise instead. +" Note: the same stuff appears in menu.vim. +if has("virtualedit") + nnoremap Paste :call Paste() + func! Paste() + let ove = &ve + set ve=all + normal `^ + if @+ != '' + normal "+gP + endif + let c = col(".") + normal i + if col(".") < c " compensate for i moving the cursor left + normal l + endif + let &ve = ove + endfunc + inoremap