11" Set options and add mapping such that Vim behaves a lot like MS-Windows
22"
33" Maintainer: Bram Moolenaar <[email protected] >4- " Last change: 2012 Jul 25
4+ " Last change: 2017 Feb 09
55
66" bail out if this isn't wanted (mrsvim.vim uses this).
77if exists (" g:skip_loading_mswin" ) && g: skip_loading_mswin
@@ -23,29 +23,33 @@ set backspace=indent,eol,start whichwrap+=<,>,[,]
2323" backspace in Visual mode deletes selection
2424vnoremap <BS> d
2525
26- " CTRL-X and SHIFT-Del are Cut
27- vnoremap <C-X> "+x
28- vnoremap <S-Del> "+x
26+ if has (" clipboard" )
27+ " CTRL-X and SHIFT-Del are Cut
28+ vnoremap <C-X> "+x
29+ vnoremap <S-Del> "+x
2930
30- " CTRL-C and CTRL-Insert are Copy
31- vnoremap <C-C> "+y
32- vnoremap <C-Insert> "+y
31+ " CTRL-C and CTRL-Insert are Copy
32+ vnoremap <C-C> "+y
33+ vnoremap <C-Insert> "+y
3334
34- " CTRL-V and SHIFT-Insert are Paste
35- map <C-V> "+gP
36- map <S-Insert> "+gP
35+ " CTRL-V and SHIFT-Insert are Paste
36+ map <C-V> "+gP
37+ map <S-Insert> "+gP
3738
38- cmap <C-V> <C-R> +
39- cmap <S-Insert> <C-R> +
39+ cmap <C-V> <C-R> +
40+ cmap <S-Insert> <C-R> +
41+ endif
4042
4143" Pasting blockwise and linewise selections is not possible in Insert and
4244" Visual mode without the +virtualedit feature. They are pasted as if they
4345" were characterwise instead.
4446" Uses the paste.vim autoload script.
4547" Use CTRL-G u to have CTRL-Z only undo the paste.
4648
47- exe ' inoremap <script> <C-V> <C-G>u' . paste #paste_cmd[' i' ]
48- exe ' vnoremap <script> <C-V> ' . paste #paste_cmd[' v' ]
49+ if 1
50+ exe ' inoremap <script> <C-V> <C-G>u' . paste #paste_cmd[' i' ]
51+ exe ' vnoremap <script> <C-V> ' . paste #paste_cmd[' v' ]
52+ endif
4953
5054imap <S-Insert> <C-V>
5155vmap <S-Insert> <C-V>
@@ -99,6 +103,18 @@ inoremap <C-F4> <C-O><C-W>c
99103cnoremap <C-F4> <C-C><C-W> c
100104onoremap <C-F4> <C-C><C-W> c
101105
106+ if has (" gui" )
107+ " CTRL-F is the search dialog
108+ noremap <C-F> :promptfind<CR>
109+ inoremap <C-F> <C-\><C-O> :promptfind<CR>
110+ cnoremap <C-F> <C-\><C-C> :promptfind<CR>
111+
112+ " CTRL-H is the replace dialog
113+ noremap <C-H> :promptrepl<CR>
114+ inoremap <C-H> <C-\><C-O> :promptrepl<CR>
115+ cnoremap <C-H> <C-\><C-C> :promptrepl<CR>
116+ endif
117+
102118" restore 'cpoptions'
103119set cpo &
104120if 1
0 commit comments