summaryrefslogtreecommitdiffstats
path: root/runtime/mswin.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /runtime/mswin.vim
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/mswin.vim')
-rw-r--r--runtime/mswin.vim24
1 files changed, 22 insertions, 2 deletions
diff --git a/runtime/mswin.vim b/runtime/mswin.vim
index 1c28cad..b2a3670 100644
--- a/runtime/mswin.vim
+++ b/runtime/mswin.vim
@@ -1,7 +1,7 @@
" Set options and add mapping such that Vim behaves a lot like MS-Windows
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2023 Aug 10
+" Last Change: 2024 Mar 13
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Bail out if this isn't wanted.
@@ -24,6 +24,9 @@ set backspace=indent,eol,start whichwrap+=<,>,[,]
" backspace in Visual mode deletes selection
vnoremap <BS> d
+" the better solution would be to use has("clipboard_working"),
+" but that may not be available yet while starting up, so let's just check if
+" clipboard support has been compiled in and assume it will be working :/
if has("clipboard")
" CTRL-X and SHIFT-Del are Cut
vnoremap <C-X> "+x
@@ -39,6 +42,23 @@ if has("clipboard")
cmap <C-V> <C-R>+
cmap <S-Insert> <C-R>+
+else
+ " Use the unnamed register when clipboard support not available
+
+ " CTRL-X and SHIFT-Del are Cut
+ vnoremap <C-X> x
+ vnoremap <S-Del> x
+
+ " CTRL-C and CTRL-Insert are Copy
+ vnoremap <C-C> y
+ vnoremap <C-Insert> y
+
+ " CTRL-V and SHIFT-Insert are Paste
+ noremap <C-V> gP
+ noremap <S-Insert> gP
+
+ inoremap <C-V> <C-R>"
+ inoremap <S-Insert> <C-R>"
endif
" Pasting blockwise and linewise selections is not possible in Insert and
@@ -47,7 +67,7 @@ endif
" Uses the paste.vim autoload script.
" Use CTRL-G u to have CTRL-Z only undo the paste.
-if 1
+if has("clipboard")
exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']
endif