[vim/vim] Cannot use ctrl+x to cut using mswin.vim (Issue #10965)

10 views
Skip to first unread message

Firestar-Reimu

unread,
Aug 23, 2022, 10:57:52 AM8/23/22
to vim/vim, Subscribed

Steps to reproduce

put in vimrc:

set clipboard=unnamedplus
source $VIMRUNTIME/mswin.vim

https://github.com/vim/vim/blob/master/runtime/mswin.vim

open a file and ctrl+a ctrl+x

Expected behaviour

all the words of the file has been cut to clipboard and the file will go blank

But the truth is:

clipboard is empty and file has not changed

PS: ctrl+c does not work in Normal mode, only in Insert mode

Version of Vim

9.0.0236

Environment

Archlinux Konsole bash

+acl               -dnd               +listcmds          +postscript        +termresponse
+arabic            -ebcdic            +localmap          +printer           +textobjects
+autocmd           +emacs_tags        +lua/dyn           +profile           +textprop
+autochdir         +eval              +menu              -python            +timers
-autoservername    +ex_extra          +mksession         +python3/dyn       +title
-balloon_eval      +extra_search      +modify_fname      +quickfix          -toolbar
+balloon_eval_term -farsi             +mouse             +reltime           +user_commands
-browse            +file_in_path      -mouseshape        +rightleft         +vartabs
++builtin_terms    +find_in_path      +mouse_dec         +ruby/dyn          +vertsplit
+byte_offset       +float             +mouse_gpm         +scrollbind        +vim9script
+channel           +folding           -mouse_jsbterm     +signs             +viminfo
+cindent           -footer            +mouse_netterm     +smartindent       +virtualedit
-clientserver      +fork()            +mouse_sgr         -sodium            +visual
-clipboard         +gettext           -mouse_sysmouse    -sound             +visualextra
+cmdline_compl     -hangul_input      +mouse_urxvt       +spell             +vreplace
+cmdline_hist      +iconv             +mouse_xterm       +startuptime       +wildignore
+cmdline_info      +insert_expand     +multi_byte        +statusline        +wildmenu
+comments          +ipv6              +multi_lang        -sun_workshop      +windows
+conceal           +job               -mzscheme          +syntax            +writebackup
+cryptv            +jumplist          +netbeans_intg     +tag_binary        -X11
+cscope            +keymap            +num64             -tag_old_static    -xfontset
+cursorbind        +lambda            +packages          -tag_any_white     -xim
+cursorshape       +langmap           +path_extra        +tcl/dyn           -xpm
+dialog_con        +libcall           +perl/dyn          +termguicolors     -xsmp
+diff              +linebreak         +persistent_undo   +terminal          -xterm_clipboard
+digraphs          +lispindent        +popupwin          +terminfo          -xterm_save

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10965@github.com>

Ahnaf Al Nafis

unread,
Aug 23, 2022, 11:24:03 AM8/23/22
to vim/vim, Subscribed

You mswin cannot be activated by default in Linux. You can remap them.

nnoremap <C-A> ggVG
nnoremap <C-X> d
nnoremap <C-C> y


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10965/1224228696@github.com>

Ahnaf Al Nafis

unread,
Aug 23, 2022, 11:33:26 AM8/23/22
to vim/vim, Subscribed

STEP 1: Install either xsel or xclip with pacman.
STEP 2: Notice that you have not Vim compiled with clipboard (vim --version | grep clip). Either compile Vim with clipboard or install gVim. Because gVim has clipboard support. Also if you want to use TUI Vim you can do so. Because gVim has a command-line version too. Just run vim.
STEP 3: As far as I know mswin is not sourced/activated by default in Linux. You can either source mswin with runtime! mswin or remap them.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10965/1224240622@github.com>

Gary Johnson

unread,
Aug 23, 2022, 11:43:00 AM8/23/22
to reply+ACY5DGAR6DVOE4SJF7...@reply.github.com, vim...@googlegroups.com
On 2022-08-23, Ahnaf Al Nafis wrote:
> You mswin cannot be activated by default in Linux.

Why do you think that? The OP explicitly sourced
$VIMRUNTIME/mswin.vim in their vimrc. When I source that file in
gvim on my Ubuntu 20.04 system, Ctrl-A, Ctrl-C and Ctrl-V behave as
they would on Windows.

Regards,
Gary

vim-dev ML

unread,
Aug 23, 2022, 11:43:16 AM8/23/22
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10965/1224254045@github.com>

Firestar-Reimu

unread,
Aug 23, 2022, 8:58:24 PM8/23/22
to vim/vim, vim-dev ML, Mention

@vim-ml You are right. Ctrl+A Ctrl+C and Ctrl+V behave right. But Ctrl+X/Shift+Del do not work.


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225042549@github.com>

K.Takata

unread,
Aug 23, 2022, 10:58:55 PM8/23/22
to vim/vim, vim-dev ML, Mention

Ctrl+X and some other mappings are enabled only when the clipboard feature is available:
https://github.com/vim/vim/blob/dde77a7c4d72622284dc5fb72557bde42c314fa6/runtime/mswin.vim#L26-L41

Your version result shows that the clipboard feature is disabled: -clipboard.


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225122761@github.com>

Firestar-Reimu

unread,
Aug 23, 2022, 11:08:23 PM8/23/22
to vim/vim, vim-dev ML, Mention

What about using set clipboard=unnamedplus


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225127374@github.com>

Ahnaf Al Nafis

unread,
Aug 23, 2022, 11:15:48 PM8/23/22
to vim/vim, vim-dev ML, Mention

the first 2 steps that I mentioned earlier


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225130948@github.com>

Firestar-Reimu

unread,
Aug 24, 2022, 1:35:04 AM8/24/22
to vim/vim, vim-dev ML, Mention

Can I edit mswin.vim to make it working when -clipboard and set clipboard=unnamedplus?


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225218483@github.com>

Bram Moolenaar

unread,
Aug 24, 2022, 6:05:21 AM8/24/22
to vim/vim, vim-dev ML, Mention

This has turned into a user discussion, therefore closing.


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issues/10965/1225505468@github.com>

Bram Moolenaar

unread,
Aug 24, 2022, 6:05:23 AM8/24/22
to vim/vim, vim-dev ML, Mention

Closed #10965 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you were mentioned.Message ID: <vim/vim/issue/10965/issue_event/7249454011@github.com>

Reply all
Reply to author
Forward
0 new messages