aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-03-04 22:36:57 +0100
committerChristian Clason <c.clason@uni-graz.at>2024-03-04 23:03:09 +0100
commit971602029311c33353c88175f761557431330528 (patch)
treea7ffc0f6de88f156c7c206479b22791fb4cdec63
parent66c9f987e703d780a68b2d688082c39db8468ad4 (diff)
downloadrneovim-971602029311c33353c88175f761557431330528.tar.gz
rneovim-971602029311c33353c88175f761557431330528.tar.bz2
rneovim-971602029311c33353c88175f761557431330528.zip
vim-patch:d9ebd46bd090
runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813) * Use unnamed register while clipboard not exist * Do not need to specify the unnamed register explicitly fixes: vim/vim#13809 https://github.com/vim/vim/commit/d9ebd46bd090c598adc82e683b4462909f2d4ea5 Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
-rw-r--r--runtime/mswin.vim23
1 files changed, 20 insertions, 3 deletions
diff --git a/runtime/mswin.vim b/runtime/mswin.vim
index 815667ead9..107a2acc2e 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 3
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Bail out if this isn't wanted.
@@ -27,7 +27,7 @@ set backspace=indent,eol,start whichwrap+=<,>,[,]
" backspace in Visual mode deletes selection
vnoremap <BS> d
-if has("clipboard")
+if has("clipboard_working")
" CTRL-X and SHIFT-Del are Cut
vnoremap <C-X> "+x
vnoremap <S-Del> "+x
@@ -42,6 +42,23 @@ if has("clipboard")
cmap <C-V> <C-R>+
cmap <S-Insert> <C-R>+
+else
+ " Use unnamed register while clipboard not exist
+
+ " 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
@@ -50,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_working")
exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']
endif