annotate runtime/mswin.vim @ 11820:24a3bec6e317 v8.0.0790

patch 8.0.0790: MSVC compiler warning for strncpy in libvterm commit https://github.com/vim/vim/commit/fa228f716a4b63bf508887a49ce56bf4c07364d3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 28 14:19:19 2017 +0200 patch 8.0.0790: MSVC compiler warning for strncpy in libvterm Problem: MSVC compiler warning for strncpy in libvterm. Solution: Add a define to stop the warnings. (Mike Williams)
author Christian Brabandt <cb@256bit.org>
date Fri, 28 Jul 2017 14:30:05 +0200
parents 9130644aec5c
children 77960063e2e7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Set options and add mapping such that Vim behaves a lot like MS-Windows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
4 " Last change: 2017 Feb 09
21
db5102f7e29f updated for version 7.0013
vimboss
parents: 7
diff changeset
5
db5102f7e29f updated for version 7.0013
vimboss
parents: 7
diff changeset
6 " bail out if this isn't wanted (mrsvim.vim uses this).
db5102f7e29f updated for version 7.0013
vimboss
parents: 7
diff changeset
7 if exists("g:skip_loading_mswin") && g:skip_loading_mswin
db5102f7e29f updated for version 7.0013
vimboss
parents: 7
diff changeset
8 finish
db5102f7e29f updated for version 7.0013
vimboss
parents: 7
diff changeset
9 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " set the 'cpoptions' to its Vim default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if 1 " only do this when compiled with expression evaluation
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 let s:save_cpo = &cpoptions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 behave mswin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " backspace and cursor keys wrap to previous/next line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 set backspace=indent,eol,start whichwrap+=<,>,[,]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " backspace in Visual mode deletes selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 vnoremap <BS> d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
26 if has("clipboard")
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
27 " CTRL-X and SHIFT-Del are Cut
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
28 vnoremap <C-X> "+x
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
29 vnoremap <S-Del> "+x
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
31 " CTRL-C and CTRL-Insert are Copy
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
32 vnoremap <C-C> "+y
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
33 vnoremap <C-Insert> "+y
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
35 " CTRL-V and SHIFT-Insert are Paste
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
36 map <C-V> "+gP
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
37 map <S-Insert> "+gP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
39 cmap <C-V> <C-R>+
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
40 cmap <S-Insert> <C-R>+
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
41 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Pasting blockwise and linewise selections is not possible in Insert and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Visual mode without the +virtualedit feature. They are pasted as if they
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " were characterwise instead.
720
e180933b876a updated for version 7.0219
vimboss
parents: 654
diff changeset
46 " Uses the paste.vim autoload script.
3682
11d40fc82f11 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 819
diff changeset
47 " Use CTRL-G u to have CTRL-Z only undo the paste.
720
e180933b876a updated for version 7.0219
vimboss
parents: 654
diff changeset
48
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
49 if 1
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
50 exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
51 exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
52 endif
720
e180933b876a updated for version 7.0219
vimboss
parents: 654
diff changeset
53
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 imap <S-Insert> <C-V>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 vmap <S-Insert> <C-V>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " Use CTRL-Q to do what CTRL-V used to do
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 noremap <C-Q> <C-V>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " Use CTRL-S for saving, also in Insert mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 noremap <C-S> :update<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 vnoremap <C-S> <C-C>:update<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 inoremap <C-S> <C-O>:update<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " For CTRL-V to work autoselect must be off.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " On Unix we have two selections, autoselect can be used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 if !has("unix")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 set guioptions-=a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " CTRL-Z is Undo; not in cmdline though
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 noremap <C-Z> u
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 inoremap <C-Z> <C-O>u
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " CTRL-Y is Redo (although not repeat); not in cmdline though
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 noremap <C-Y> <C-R>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 inoremap <C-Y> <C-O><C-R>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " Alt-Space is System menu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 if has("gui")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 noremap <M-Space> :simalt ~<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 inoremap <M-Space> <C-O>:simalt ~<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 cnoremap <M-Space> <C-C>:simalt ~<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " CTRL-A is Select all
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 noremap <C-A> gggH<C-O>G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 cnoremap <C-A> <C-C>gggH<C-O>G
816
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 720
diff changeset
90 onoremap <C-A> <C-C>gggH<C-O>G
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 816
diff changeset
91 snoremap <C-A> <C-C>gggH<C-O>G
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 816
diff changeset
92 xnoremap <C-A> <C-C>ggVG
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " CTRL-Tab is Next window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 noremap <C-Tab> <C-W>w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 inoremap <C-Tab> <C-O><C-W>w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 cnoremap <C-Tab> <C-C><C-W>w
816
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 720
diff changeset
98 onoremap <C-Tab> <C-C><C-W>w
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " CTRL-F4 is Close window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 noremap <C-F4> <C-W>c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 inoremap <C-F4> <C-O><C-W>c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 cnoremap <C-F4> <C-C><C-W>c
816
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 720
diff changeset
104 onoremap <C-F4> <C-C><C-W>c
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
10863
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
106 if has("gui")
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
107 " CTRL-F is the search dialog
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
108 noremap <C-F> :promptfind<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
109 inoremap <C-F> <C-\><C-O>:promptfind<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
110 cnoremap <C-F> <C-\><C-C>:promptfind<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
111
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
112 " CTRL-H is the replace dialog
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
113 noremap <C-H> :promptrepl<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
114 inoremap <C-H> <C-\><C-O>:promptrepl<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
115 cnoremap <C-H> <C-\><C-C>:promptrepl<CR>
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
116 endif
9130644aec5c patch 8.0.0321: errors when trying to use scripts in tiny version
Christian Brabandt <cb@256bit.org>
parents: 3713
diff changeset
117
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " restore 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 set cpo&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 let &cpoptions = s:save_cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 unlet s:save_cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif